快速开始
创建 UnderSky 账户、生成 API Key、充值使用点数,并通过 curl 或 SDK 发起第一次兼容 OpenAI 的 API 请求。
1. 创建账户
前往 Dashboard,使用 GitHub 或 Google 登录。
2. 获取 API Key
进入 Dashboard → Settings → API Keys 并创建新的 Key。API Key 以 sk- 开头。
请安全保存 API Key。完整 Key 只会显示一次。
3. 发起第一次请求
选择接入方式前,先查询当前模型:
curl -sS https://api.undersky.ai/v1/models | jq '.data[] | .id'curl -X POST https://api.undersky.ai/v1/chat/completions \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'你会收到类似下面的响应:
{
"id": "chatcmpl-abc123",
"choices": [
{
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
}
}
]
}4. 查询余额
在 Dashboard → Settings → Credit & Usage 查看余额与近期用量。
服务集成可以使用带有 credits:read 权限的控制令牌:
curl https://api.undersky.ai/api/v1/credits/balance \
-H "Authorization: Bearer lpc-your-control-token"接下来
- 身份认证 — 了解 API Key 管理
- Chat Completions — 流式响应、工具调用和 JSON 模式
- 图片生成 — 异步图片生成流程