API
6.5 错误码与限流说明
⌘I
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Shape the Future with Tooken!
| 状态码 | 含义 | 处理建议 |
|---|---|---|
| 200 | 成功 | — |
| 400 | 请求参数错误 | 检查请求体格式 |
| 401 | 认证失败 | 检查 API Key 是否正确 |
| 402 | 余额不足 | 充值 Credits 或配置 x402 钱包 |
| 403 | 无权限 | 检查 Key 的模型访问权限 |
| 429 | 超出限流 | 降低请求频率,或联系商务升级限额 |
| 500 | 服务内部错误 | 重试,或联系技术支持 |
| 502 | 上游服务错误 | 平台正在自动切换节点,稍后重试 |
| 503 | 服务不可用 | 流量高峰,系统正在扩容,稍后重试 |
| 账户类型 | 请求/分钟 | Token/分钟 | 并发请求 |
|---|---|---|---|
| 免费 | 10 | 40,000 | 2 |
| 入门版 | 60 | 200,000 | 5 |
| 专业版 | 300 | 1,000,000 | 20 |
| 企业版 | 2,000 | 10,000,000 | 100 |
| 旗舰版 | 自定义 | 自定义 | 自定义 |
import time
import random
def call_with_retry(client, max_retries=3, **kwargs):
for attempt in range(max_retries):
try:
return client.chat.completions.create(**kwargs)
except Exception as e:
if "429" in str(e):
# 指数退避 + 随机抖动
wait_time = (2 ** attempt) + random.uniform(0, 1)
print(f"限流,{wait_time:.1f}秒后重试...")
time.sleep(wait_time)
elif "502" in str(e) or "503" in str(e):
# 上游故障,快速重试
time.sleep(1)
else:
raise e
raise Exception("超过最大重试次数")
| 版本 | 日期 | 主要更新 |
|---|---|---|
| v1.0.0 | 2026-04 | 平台上线,多模型聚合 + Auto 路由 + 链上支付 |
| v1.1.0 | 2026 Q3(计划) | x402 实时结算上线 |
| v2.0.0 | 2027(计划) | Agent 钱包 + ERC-8183 合约层 + A2A 协议 |