错误码
| 状态码 | 类型 | 说明 |
|---|---|---|
| 400 | invalid_request / invalid_request_error | 请求格式错误或上游拒绝请求参数 |
| 401/403 | missing_api_key / invalid_api_key / key_suspended / key_revoked | 未提供 API Key、Key 无效、已暂停或已撤销 |
| 402 | insufficient_balance / account_in_arrears | 账户余额不足,或存在未清偿应收款 |
| 403 | model_forbidden / user_inactive | API Key 未显式获得目标模型权限,或账号不可用 |
| 404 | model_not_found / not_found_error | 模型未知或当前环境未启用 |
| 429 | rate_limit_exceeded / key_budget_exceeded | 超过 API Key 速率限制或月预算阻断阈值 |
| 400 | duplicate_tool_call_id | 工具调用或工具结果 ID 重复 |
| 502 | upstream_error / timeout | 上游服务商错误或响应超时 |
| 503 | model_temporarily_unavailable | 已发布模型暂时不可用 |
- 模型可用但当前 Key 未显式授权时返回 403,
error.code=model_forbidden。 - Chat Completions 的 404/503 使用 OpenAI 错误对象,分别通过
error.code=model_not_found和error.code=标识。model_temporarily_unavailable - Responses 的 404/503 同样使用 OpenAI 错误对象和上述
error.code;对应error.type分别为invalid_request_error和model_unavailable。 - Messages 使用 Anthropic 错误信封且没有独立
error.code:404 为error.type=not_found_error;503 为error.type=api_error,并在 message 中携带model_temporarily_unavailable。