Claude Opus 5.5 đã có trên SeedRouter
SeedRouter Docs
API Reference

Lỗi

Cách hiểu lỗi yêu cầu và các tác vụ tạo ảnh thất bại.

View Markdown

Cách đọc một lỗi

Mã trạng thái HTTP mô tả chính yêu cầu gửi tới API, còn error.code mô tả nguyên nhân thất bại. Đây là hai trường riêng biệt: HTTP 200 không phải là mã lỗi nghiệp vụ.

  • Một yêu cầu bị từ chối sẽ trả về mã trạng thái HTTP lỗi kèm đối tượng error.
  • Truy vấn tác vụ thành công trả về HTTP 200. Hãy đọc status để biết quá trình tạo đang ở processing, completed hay failed.
  • Với tác vụ thất bại, hãy rẽ nhánh theo error.code chứ không theo nội dung của message. Nguyên nhân thất bại khác nhau có mã khác nhau; cùng một nguyên nhân dùng cùng một mã trên mọi mô hình.
  • 60002 là giá trị dự phòng khi không thể xác định nguyên nhân công khai cụ thể hơn. Hãy xử lý các mã mới chưa biết trong tương lai như một lỗi chung.

Các mã lỗi và thông báo trong bảng dưới đây được API trả về nguyên văn nên vẫn giữ tiếng Anh: chúng trùng khớp từng ký tự với error.message mà client của bạn thực sự nhận được.

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."
  }
}

Nếu chính lần gửi bị hết thời gian chờ, hãy kiểm tra lịch sử tác vụ trước khi gửi lại: yêu cầu đầu tiên có thể đã được tiếp nhận.