Chuyển đến nội dung chính

Tài liệu

Lỗi

Các hướng dẫn chi tiết và tài liệu tham chiếu API chỉ có bằng tiếng Anh.

Error format

Every error uses the same JSON envelope:

{
  "error": {
    "code": "insufficient_credits",
    "message": "not enough credits",
    "plan": "credits",
    "details": { "required": 120, "available": 80 }
  }
}
  • code is stable and meant for your code. message is for people and may change.
  • plan is "credits" or null. An error about credits names the plan.
  • details depends on the code; it is always an object.

Error codes

HTTPCodeMeaningDetails
400plan_requiredplan is missing; set it to credits
401unauthorizedMissing, malformed or revoked API key
402insufficient_creditsNot enough creditsrequired, available
403bannedThe account is suspended
403first_payment_requiredAPI keys and webhooks unlock after the first USDT payment
403terms_not_acceptedYou must accept the current terms in the web appcurrent_version
404not_foundThe job does not exist, is not yours, or the content URL is not valid
409idempotency_conflictThe Idempotency-Key was used with a different body, or a duplicate request is still running
409not_cancellableThe job already runs and cannot be cancelled
410result_expiredThe download window of the result has endedexpired_at
413invalid_parametersThe request body is too largemax_bytes
422invalid_parametersA parameter is wrong (for example plan: "studio", a plan that was retired on 2026-11-19)field, reason
422content_policy_violationThe prompt was blocked by the content policy; nothing is charged
429rate_limitedToo many requests or downloadsscope: key, plan, auth, ip, bandwidth, job, concurrency; for bandwidth and job limit_bytes. concurrency (reason: concurrent_uploads) means too many large requests from your account are running at once
429queue_fullYou have 20 jobs waitingmax_pending
502result_unavailableThe result cannot be retrieved right nowgeneration_id
503model_unavailableThe model is under maintenance or paused
503server_busyThe server is handling too many large requests (for example videos sent as base64). Wait for Retry-After seconds and send the same request again
504generation_pendingThe OpenAI compatible endpoint timed out waiting for the imagegeneration_id
500internalSomething went wrong on our side

details.reason of invalid_parameters can be required, too_long, unsupported, not_allowed, too_few, too_many, max_keys, max_endpoints, invalid_range, multi_range_not_supported, among others.

A job that starts and then fails is reported on the job itself: status: "failed", error_code and error (with a safe reason such as timeout or source_failed). When the generation server's celebrity filter blocks the request, the job fails with content_policy_violation and reason: "prominent_people" (or "unsafe_content" when the model's safety filter blocks it); use a prompt or reference image without recognisable real people. Failed jobs get their credits back.

Retries

  • 429 and 5xx are safe to retry with the same Idempotency-Key; wait for Retry-After seconds when the header is present.
  • 4xx other than 429 will not succeed on a retry without a change on your side.