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

# 快速开始

> 获取 API Key、替换 Base URL 并发起首个请求。

## 第一步：获取 API Key

1. 登录 [出海营 API 控制台](https://aiid.edu.kg/console)
2. 进入令牌页面创建 API Key
3. 后续通过 `Authorization: Bearer YOUR_API_KEY` 使用

## 第二步：配置 Base URL

```bash theme={null}
API_BASE_URL="https://api.aiid.edu.kg"
```

如果现有客户端默认写的是：

* `https://api.openai.com`
* `https://api.openai.com/v1`

则分别替换为：

* `https://api.aiid.edu.kg`
* `https://api.aiid.edu.kg`

## 第三步：发起第一个请求

### Python

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

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.aiid.edu.kg",
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello, what can you do?"}],
)

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

### cURL

```bash theme={null}
curl https://api.aiid.edu.kg/v1/chat/completions   -H "Content-Type: application/json"   -H "Authorization: Bearer YOUR_API_KEY"   -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello world!"}]
  }'
```

## 接入建议

* 新项目优先从 OpenAI 兼容接口开始
* 图片编辑必须注意 `multipart/form-data` 与文件字段要求
* 视频任务接口应先保存 `task_id` 或 `operation_name` 再查询
* 调试失败时优先看 HTTP 状态码、`error.code` 和 `error.message`

## 下一步

* 在线调试：见 `cn/online-debug`
* AI 生成调用代码：见 `cn/ai-codegen`
* 模型分组与能力：见 `cn/models`
