> ## 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.

# OpenAI-compatible API

> Use OmniaKey with OpenAI-compatible Chat Completions, Responses, and model list endpoints.

Use the OpenAI-compatible base URL for OpenAI SDKs, Cursor, Codex, Cline, aider,
and most custom tools:

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

## Chat Completions

`POST /v1/chat/completions` is the most portable endpoint. It can call supported
Claude, GPT, and Gemini models by id.

<CodeGroup>
  ```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);
  ```
</CodeGroup>

## Responses

`POST /v1/responses` follows OpenAI's newer Responses shape and serves GPT models.
Use it for Codex-style GPT workflows. For Claude or Gemini, use Chat Completions
unless your tool explicitly requires a different protocol.

```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` is available for clients that call the Responses
compaction path, including Codex-style context compaction flows.

## Models

Use `GET /v1/models` for an OpenAI-compatible model list. For the human-readable
catalog, see [Supported Models](/en/models).
