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

# 快速开始

> 获取 API Key 并用 OpenAI 兼容接口发起第一次请求。

# 快速开始

## 1. 获取 API Key

登录 [控制台](https://omniall.ai/dashboard) → **API Keys** → 创建令牌，复制 `sk-...` 密钥。

## 2. 设置 Base URL

将客户端 Base URL 指向 API 主机：

```text theme={null}
https://api.omniall.ai/v1
```

官网 / 控制台：[https://omniall.ai](https://omniall.ai)。API Base URL 需包含 `/v1`。

## 3. 发起请求

```bash theme={null}
curl https://api.omniall.ai/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [{"role": "user", "content": "你好"}]
  }'
```

## 4. 使用 OpenAI SDK

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

client = OpenAI(
    api_key="sk-...",
    base_url="https://api.omniall.ai/v1",
)

resp = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "你好"}],
)
print(resp.choices[0].message.content)
```

更多接口说明见 [API 概览](/zh-CN/api-reference/overview)。


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