> ## 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](/cn/coding)。

## 第 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 可以直接使用。

<CodeGroup>
  ```bash Python theme={null}
  pip install openai
  ```

  ```bash Node.js theme={null}
  npm install openai
  ```
</CodeGroup>

## 第 3 步：发送请求

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

<CodeGroup>
  ```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."}]
    }'
  ```
</CodeGroup>

## 第 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="")
```

## 下一步

<CardGroup cols={3}>
  <Card title="API 参考" icon="code" href="/cn/api">
    查看三套协议和能力边界
  </Card>

  <Card title="工具接入" icon="terminal" href="/cn/coding">
    配置 Claude Code、Cursor、Codex、Cline、aider
  </Card>

  <Card title="支持模型" icon="cubes" href="/cn/models">
    复制当前可用模型 ID
  </Card>
</CardGroup>
