主题
错误码说明
HTTP 状态码
| 状态码 | 含义 | 常见原因与处理 |
|---|---|---|
400 | 请求参数错误 | 检查请求体 JSON 格式、模型名、参数取值 |
401 | 鉴权失败 | Key 缺失、拼写错误或已删除,检查鉴权请求头 |
403 | 无权限 | 密钥未绑定分组(最常见)、余额不足、IP 限制 |
404 | 接口不存在 | 检查 Base URL 与路径、该分组是否支持此协议 |
429 | 触发限流 | 超出并发上限或密钥速率限制,降低并发并退避重试 |
500 | 服务端错误 | 稍后重试;持续出现请通过官网渠道反馈 |
502/503 | 上游不可用 | 上游号池故障,稍后重试或切换分组(见下方提示) |
错误响应格式
推理接口(/v1/*)的错误响应遵循对应平台的格式,例如:
json
{
"error": {
"message": "API Key is not assigned to any group and cannot be used. Please contact the administrator to assign it to a group.",
"type": "permission_error"
}
}未携带 API Key 时返回:
json
{
"code": "API_KEY_REQUIRED",
"message": "API key is required in Authorization header (Bearer scheme), x-api-key header, or x-goog-api-key header"
}常见问题排查
403:API Key is not assigned to any group
密钥没有绑定分组。前往 密钥管理 为密钥选择分组后即可使用。这是新用户最常见的问题。
401 Unauthorized
- 确认 Key 完整复制,没有多余的空格或换行。
- OpenAI / Anthropic 协议用
Authorization: Bearer sk-xxx或x-api-key: sk-xxx。 - 确认 Key 未过期、未被删除。
模型不存在 / 无法调用某模型
- 模型可用范围由密钥分组决定。先确认密钥绑定的分组,再对照 模型列表 检查模型名。
- 调用
/v1/models查看当前密钥实际可用的模型。
429 Too Many Requests
- 检查密钥是否设置了 5h / 1d / 7d 速率限制。
- 降低并发数,使用指数退避重试(1s → 2s → 4s → …)。
502 Bad Gateway
- 上游号池临时故障,稍后重试。
- GPT 分组持续 502 时,可在 密钥管理 将密钥在
GPT Plus与GPT PRO之间切换。