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

# 快速开始

> 5 分钟内用 OmniaKey 发出第一条 API 请求。

这个页面用 OpenAI 兼容接口演示第一条请求。如果你要配置 Claude Code、Cursor、Codex、Cline 或 aider，请看 [工具与 SDK](https://docs.omniakey.com/zh/coding.md)。

## 第 1 步：创建 API key

在 [API Keys dashboard](https://omniakey.com/dashboard/tokens) 创建一把 key。所有 API 请求都使用：

```bash theme={null}
Authorization: Bearer your-omniakey-api-key
```

## 第 2 步：安装 SDK

OmniaKey 不需要专用 SDK。OpenAI 官方 SDK 可以直接使用。

```bash Python theme={null}
pip install openai
```

```bash Node.js theme={null}
npm install openai
```

## 第 3 步：发送请求

把 base URL 设置为 `https://api.omniakey.com/v1`，模型 ID 从 [支持模型](https://docs.omniakey.com/zh/models.md) 复制。

```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": "Explain what a race condition is."}],
)

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

```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": "Explain what a race condition is."}]
  }'
```

## 第 4 步：开启流式输出

```python theme={null}
stream = client.chat.completions.create(
    model="claude-opus-4-8",
    messages=[{"role": "user", "content": "Write a haiku about clean code."}],
    stream=True,
)

for chunk in stream:
    if chunk.choices[0].delta.content is not None:
        print(chunk.choices[0].delta.content, end="")
```

## 下一步

> [card] [API 参考](https://docs.omniakey.com/zh/api.md)
>
> 查看三套协议和能力边界

> [card] [工具接入](https://docs.omniakey.com/zh/coding.md)
>
> 配置 Claude Code、Cursor、Codex、Cline、aider

> [card] [支持模型](https://docs.omniakey.com/zh/models.md)
>
> 复制当前可用模型 ID


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