Claude Opus 5.5 已在 SeedRouter 上线
SeedRouter Docs
API Reference

错误

解读请求错误与失败的图像任务。

View Markdown

如何解读一个错误

HTTP 状态码描述的是发往 API 的这次请求,error.code 描述的是失败的原因。两者是彼此独立的字段:HTTP 200 并不是一个业务错误码。

  • 被拒绝的提交会返回 HTTP 错误状态码,并带有一个 error 对象。
  • 成功的任务查询返回 HTTP 200。请读取 status 来判断生成处于 processing、completed 还是 failed。
  • 对于失败的任务,请基于 error.code 分支处理,而不是基于 message 中的文本。不同的失败原因对应不同的错误码;同一原因在不同模型下使用相同的错误码。
  • 当无法确定更具体的对外原因时,会回落到 60002。对于将来新增的、你尚未识别的错误码,请按通用失败处理。

下表中的错误码与提示语由 API 直接返回,因此保持英文原文,与客户端实际收到的 error.message 字符串逐字一致。

Request errors

These HTTP statuses describe a rejected or unconfirmed submission, or a failed task query. A submission timeout does not prove that no task was created.

Error code (error.code)HTTP statusMeaningNext step
10001401The API key is missing or invalid.Check the Authorization header and API key.
10002403You do not have permission to make this request.Check access permissions.
20001400, 413, 422The request was rejected. Check the parameters against the API documentation.Correct the request parameters before retrying.
20002400The requested model is not available.Select a model listed in the model catalog.
30001402Not enough credits to run this request.Add credits before submitting.
30002429Too many requests. Please wait and try again.Wait and retry with backoff. Do not repeat accepted submissions.
50001404Task not found.Check the task ID and use the owning account’s key.
50002503Submission could not be confirmed. Check your tasks before submitting again.Check task history before submitting again; the request may have been accepted.
90001503The service is temporarily unavailable.Back off; retain any task ID already received.

Task failures

A successful task query returns HTTP 200 even when generation failed. Check status: "failed" and error.code in the response. These codes describe the task outcome, not the HTTP request. Failed tasks are not charged.

Error code (error.code)MeaningNext step
20001The request was rejected. Check the parameters against the API documentation.Correct the request parameters before retrying.
50003The task did not complete within the allowed time. Please try again.The task is not charged. You may submit a new task.
60001The request was rejected by the content policy. Please revise the prompt or input images.Revise the prompt or media input.
60002Generation could not be completed. Please try again.The task is not charged. You may submit a new task.
60003No output was generated. Please revise the prompt or try again.Revise the input or submit a new task.
60004The generated output could not be delivered. Please try again.The task is not charged. Try again later.
90001The service is temporarily unavailable.Back off; retain any task ID already received.
{
  "id": "task_...",
  "status": "failed",
  "error": {
    "code": 60002,
    "message": "Generation could not be completed. Please try again."
  }
}

如果提交本身超时,请先检查你的任务历史再重新提交:第一次请求有可能已经被受理。