Appearance
错误码参考
HTTP 状态码
| 状态码 | 说明 |
|---|---|
| 200 | 请求成功 |
| 400 | 请求参数错误 |
| 401 | 认证失败(API Key 无效或缺失) |
| 403 | 权限不足(模型未授权 / 配额为零) |
| 404 | 接口或模型不存在 |
| 413 | 请求体过大 |
| 429 | 请求被限流 |
| 500 | 服务内部错误 |
| 503 | 服务暂不可用(无可用渠道) |
常见业务错误码
| error.code | 说明 | 处理建议 |
|---|---|---|
invalid_api_key | API Key 无效 | 检查 Key 是否正确 |
insufficient_quota | 配额不足 | 充值或更换令牌 |
model_not_found | 模型不存在 | 检查模型名称是否正确 |
rate_limit_exceeded | 请求被限流 | 降低请求频率 |
upstream_error | 上游服务错误 | 稍后重试 |
sensitive_words_detected | 检测到敏感词 | 修改输入内容 |
错误响应格式
OpenAI 格式(默认)
json
{
"error": {
"message": "Model gpt-5 not found",
"type": "invalid_request_error",
"param": "",
"code": "model_not_found"
}
}Claude 格式(使用 Claude 原生接口时)
json
{
"type": "error",
"error": {
"type": "not_found_error",
"message": "Model not found"
}
}TIP
不同接口返回不同的错误格式,{– type: "error"、 流式返回 Claude 格式错误响应(包含 type和error字段),/v1/messages` 接口会自动识别为 Claude 格式并走 Claude 适配器。。