> ## 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 互換 API

> OpenAI 互換の Chat Completions、Responses、モデル一覧エンドポイントで OmniaKey を使う。

OpenAI SDK、Cursor、Codex、Cline、aider、その他の独自ツールでは OpenAI 互換の Base URL を
使います。

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

## Chat Completions

`POST /v1/chat/completions` はもっとも移植性の高いエンドポイントです。対応する Claude、GPT、
Gemini、Grok のモデルを 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` は OpenAI の新しい Responses 形式に従い、GPT モデルを提供します。
Codex 系の GPT ワークフローに使ってください。Claude、Gemini、Grok では、ツールが明示的に
別のプロトコルを必要としない限り Chat Completions を使ってください。

```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` は、Responses のコンパクション経路（Codex 系のコンテキスト
圧縮フローを含む）を呼び出すクライアントで利用できます。

## モデル一覧

OpenAI 互換のモデル一覧には `GET /v1/models` を使います。人が読むためのカタログは
[対応モデル](https://docs.omniakey.com/ja/models.md)を参照してください。


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