API 文档

OpenAI 兼容:任何 SDK 改一行 base_url 即可接入 · 想跟着一步步做?看「接入」页

接口

端点:POST https://shutong.ai/api/v1/chat/completions。所有模型共用同一端点,通过 model 参数切换;stream: true 开启流式输出;按实际 Token 用量计费。

curl https://shutong.ai/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-gw-你的密钥" \
  -d '{
    "model": "deepseek-chat",
    "stream": true,
    "messages": [{"role": "user", "content": "你好,介绍一下你自己"}]
  }'

可用模型与定价(实时)

模型 ID名称输入 $/1M tokens输出 $/1M tokens
claude-sonnet-4-5Claude Sonnet 4.5$3.90$19.50
claude-haiku-4-5Claude Haiku 4.5$1.30$6.50
deepseek-chatDeepSeek V3$0.35$1.43

Python(OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://shutong.ai/api/v1",
    api_key="sk-gw-你的密钥",
)

resp = client.chat.completions.create(
    model="deepseek-chat",
    messages=[{"role": "user", "content": "你好"}],
    stream=True,
)
for chunk in resp:
    print(chunk.choices[0].delta.content or "", end="")

错误码

401API Key 无效或已停用
402账户余额不足
403账户已被停用,请联系管理员
404模型不存在(检查 model 参数拼写)
429已达每日用量上限
502上游模型服务异常,请稍后重试