快速开始
1. 获取 API Key
登录 控制台 → API Keys → 创建令牌,复制sk-... 密钥。
2. 设置 Base URL
将客户端 Base URL 指向 API 主机:/v1。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
获取 API Key 并用 OpenAI 兼容接口发起第一次请求。
sk-... 密钥。
https://api.omniall.ai/v1
/v1。
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": "你好"}]
}'
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)