> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omniakey.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Kompatibel OpenAI

> Gunakan OmniaKey dengan endpoint Chat Completions, Responses, dan daftar model yang kompatibel OpenAI.

Gunakan base URL kompatibel OpenAI untuk SDK OpenAI, Cursor, Codex, Cline, aider,
dan sebagian besar alat buatan sendiri:

```text theme={null}
https://api.omniakey.com/v1
```

## Chat Completions

`POST /v1/chat/completions` adalah endpoint paling portabel. Endpoint ini bisa
memanggil model Claude, GPT, Gemini, dan Grok yang didukung berdasarkan ID.

```bash cURL theme={null}
curl https://api.omniakey.com/v1/chat/completions \
  -H "Authorization: Bearer your-omniakey-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "messages": [{"role": "user", "content": "Refactor this function for readability."}]
  }'
```

```python Python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="your-omniakey-api-key",
    base_url="https://api.omniakey.com/v1",
)

response = client.chat.completions.create(
    model="claude-opus-4-8",
    messages=[{"role": "user", "content": "Refactor this function for readability."}],
)

print(response.choices[0].message.content)
```

```typescript TypeScript theme={null}
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "your-omniakey-api-key",
  baseURL: "https://api.omniakey.com/v1",
});

const response = await client.chat.completions.create({
  model: "claude-opus-4-8",
  messages: [{ role: "user", content: "Refactor this function for readability." }],
});

console.log(response.choices[0].message.content);
```

## Responses

`POST /v1/responses` mengikuti bentuk Responses OpenAI yang lebih baru dan melayani
model GPT. Gunakan untuk alur GPT bergaya Codex. Untuk Claude, Gemini, atau Grok,
gunakan Chat Completions kecuali alat Anda secara eksplisit memerlukan protokol
lain.

```bash theme={null}
curl https://api.omniakey.com/v1/responses \
  -H "Authorization: Bearer your-omniakey-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "input": "Refactor this function for readability."
  }'
```

`POST /v1/responses/compact` tersedia untuk klien yang memanggil jalur pemadatan
Responses, termasuk alur pemadatan konteks bergaya Codex.

## Model

Gunakan `GET /v1/models` untuk daftar model yang kompatibel OpenAI. Katalog yang
mudah dibaca manusia ada di [Model yang Didukung](https://docs.omniakey.com/id/models.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.