# 错误处理 请求失败时返回 HTTP 状态码和 error 对象。请按 error.code 处理,不要依赖 message 文案。 ```json { "error": { "code": "invalid_request", "message": "The request contains an invalid field.", "retryable": false, "request_id": "request_example", "param": "query" } } ``` param 指出无效的字段。联系我们时请附上 request_id。retryable 为 true 时,等待 Retry-After 后重新发送请求。 ## 错误码 | 代码 | 状态 | 可重试 | 含义 | | --- | --- | --- | --- | | `invalid_request` | 400 | false | 输入无效或包含未知字段。 | | `content_blocked` | 400 | false | 内容未通过审核。 | | `unauthorized` | 401 | false | API 密钥缺失或无效。 | | `registration_required` | 403 | false | 请先完成注册。 | | `account_deletion_pending` | 403 | false | 账户正在等待删除。 | | `not_found` | 404 | false | 资源或公共 API 路径不存在。 | | `method_not_allowed` | 405 | false | 不支持此 HTTP 方法。 | | `run_not_cancellable` | 409 | false | 此 Run 无法取消。 | | `source_not_available` | 422 | false | 来源不可用。 | | `page_not_found` | 422 | false | 网页所在网站返回了 404 或 410。 | | `rate_limit_exceeded` | 429 | true | 请求频率超出限制。 | | `daily_credits_exhausted` | 429 | false | 每日额度无法接受本次操作。 | | `weekly_credits_exhausted` | 429 | false | 每周额度无法接受本次操作。 | | `outstanding_run_limit` | 429 | false | 进行中的 Run 过多。 | | `request_cancelled` | 499 | false | 调用方取消了请求或断开了连接。 | | `internal_error` | 500 | true | 服务器发生意外错误。 | | `temporarily_unavailable` | 503 | true | 服务暂时不可用。 |