Bản lưu ngày / Snapshot of 2026-10-17 · Xem bản mới nhất / See the latest version
WanduraDocsBeta
BetaDocs đang ở bản beta và còn thay đổi. Thấy chỗ sai, khó hiểu hoặc còn thiếu? Hãy cho chúng tôi biết.
API tạo ảnh và video (v2)

Lỗi

Markdown
Trên trang này

Tóm tắt — Rẽ nhánh theo error.code, không theo thông điệp. Chỉ thử lại các mã ghi Có, và lỗi mạng, với cùng Idempotency-Key. Mỗi lỗi có link tới đúng mục của nó trên trang này.

Lỗi là JSON: {"error": {"code": "...", "message": "..."}}. Rẽ nhánh theo code; thông điệp dành cho người đọc và có thể đổi. Mọi phản hồi có header X-Request-Id: gửi nó khi liên hệ hỗ trợ.

Chỉ thử lại các mã ghi Có dưới đây và lỗi mạng, với cùng Idempotency-Key. Chờ Retry-After nếu phản hồi có, không thì lùi dần kèm jitter. Đừng thử lại các mã khác: cùng request sẽ lỗi y như cũ.

Thân lỗi và header

Đang triển khai. Mọi câu trả lời lỗi của /v2, ở cả hai dạng (run và Jobs API), có thêm các mục sau, ngoài mọi field đã có:

Ở đâu Tên Nói gì
Body error.docs_url Link tới mục của mã này trên trang này, ví dụ https://docs.wandura.ai/developers/api-v2/errors#product-busy. Mã chưa có mục riêng thì link tới trang này.
Body error.retryable true khi gửi lại y nguyên request sau đó có thể thành công: mọi 429 và 5xx (ví dụ product_busy, service_unavailable). false với lỗi đầu vào và lỗi khoá. Lỗi Jobs API vốn đã có field này.
Header Wandura-Error-Code Cùng giá trị với error.code.
Header Wandura-Should-Retry true hoặc false, cùng giá trị với error.retryable.

Retry-After và X-Request-Id giữ nguyên. Cả bốn mục đều không bắt buộc: không dùng thì bỏ qua, và thiếu retryable thì làm theo bảng dưới.

HTTP/1.1 429
Retry-After: 5
Wandura-Error-Code: product_busy
Wandura-Should-Retry: true

{"error":{"code":"product_busy","message":"…","limit":20,"retry_after_s":5,"retryable":true,"docs_url":"https://docs.wandura.ai/developers/api-v2/errors#product-busy"}}

Lỗi của run

HTTP code Thử lại?
400 invalid_request Không
400 idempotency_key_required Không
400 end_user_id_required Không
401 invalid_api_key Không
401 api_key_expired Không
402 wallet_empty Không
403 insufficient_scope Không
403 style_not_allowed Không
404 style_not_found Không
404 run_not_found Không
404 not_found Không
409 idempotency_key_reused Không
409 run_not_cancelable Không
413 file_too_large Không
415 unsupported_content_type Không
429 end_user_cap_reached Có
429 gateway_rate_limited Có
429 uploads_rate_limited Có
429 product_busy Có
500 internal_error Có
503 style_unavailable Có
503 uploads_unavailable Có
503 service_unavailable Có

Câu trả lời submit, kể cả 429, có X-Concurrency-Limit, X-Concurrency-Running và X-Concurrency-Waiting. Mỗi câu trả lời product_busy và gateway_rate_limited là một lần bị từ chối: nó được liệt kê ở GET /v2/queue/refusals. Xem Hàng chờ và nghẽn.

Run lỗi sau khi đã được nhận không phải lỗi HTTP: run kết thúc failed hoặc nsfw kèm lý do miễn phí, và bạn không bị tính tiền.

invalid_request

400, không thử lại. The body or a parameter is wrong; the message says which.

idempotency_key_required

400, không thử lại. Send an Idempotency-Key header (max 255 chars) on every submit.

end_user_id_required

400, không thử lại. end_user_id is required: the id of the person in your app this run is for.

invalid_api_key

401, không thử lại. Missing, unknown or revoked API key.

api_key_expired

401, không thử lại. This API key has expired. Create or rotate a key.

wallet_empty

402, không thử lại. The product wallet and the org pool cannot cover this run. Add money, then retry.

insufficient_scope

403, không thử lại. Đang triển khai. Key này có quyền Read only (chỉ đọc): đọc được run và style, không gửi, huỷ, chia sẻ hay tải tệp lên được. Dùng key có quyền Run styles.

style_not_allowed

403, không thử lại. Đang triển khai. Key này chỉ được chạy một số style, và style này không nằm trong đó. Dùng key có style này, hoặc nhờ admin của org.

Chỉ key tạo kèm quyền hoặc danh sách style được phép mới nhận 403 (xem Khoá API). Key tạo không kèm hai thứ đó không bao giờ nhận.

style_not_found

404, không thử lại. No style with that id for your org (or not public).

run_not_found

404, không thử lại. No run with that id for this product.

not_found

404, không thử lại. No such endpoint.

idempotency_key_reused

409, không thử lại. This Idempotency-Key was already used with a different body. Use a new key for a new run.

run_not_cancelable

409, không thử lại. Only queued runs can be canceled.

file_too_large

413, không thử lại. The file is over the size limit for its type.

unsupported_content_type

415, không thử lại. Uploads accept JPEG, PNG, WEBP, MP4, MOV and WEBM.

end_user_cap_reached

429, thử lại. This end user reached the daily run cap. Retry after the Retry-After header (resets 00:00 UTC).

gateway_rate_limited

429, thử lại. A gateway key's product reached its runs-per-minute limit. Retry after the Retry-After header.

uploads_rate_limited

429, thử lại. Your org reached its presigned uploads per minute. Retry after the Retry-After header.

product_busy

429, thử lại. Your product's concurrency slots and its queue are full. Retry after the Retry-After header (about 5 s).

internal_error

500, thử lại. Something went wrong on our side. Retry with the same Idempotency-Key; quote X-Request-Id to support.

style_unavailable

503, thử lại. This style cannot run on a live key right now (no model behind it). Test keys still return a sample.

uploads_unavailable

503, thử lại. Uploads are not available on this deployment right now.

service_unavailable

503, thử lại. The job queue is briefly unavailable; nothing was created or charged. Retry with the same Idempotency-Key after the Retry-After header.

Lỗi của Jobs API

Jobs API (/v2/jobs, /v2/models, GET /v2/styles) trả {"error": {"code", "message", "retryable"}}, thêm details với INVALID_INPUT, bằng mã riêng:

HTTP code retryable
422 INVALID_INPUT false
401 UNAUTHORIZED false
402 INSUFFICIENT_CREDITS false
403 FORBIDDEN false
404 NOT_FOUND false
409 IDEMPOTENCY_KEY_REUSED false
409 JOB_NOT_CANCELLABLE false
429 RATE_LIMITED true
429 PRODUCT_BUSY true
429 END_USER_LIMIT_REACHED true
500 INTERNAL_ERROR true
503 SERVICE_UNAVAILABLE true

INVALID_INPUT

422, không thử lại. The body or a header is wrong; details[] lists each {field, reason}. Các endpoint run (POST /v2/runs, POST /v2/styles/{style}) trả cùng mã này với 400 khi resolution hoặc số file không hợp style.

UNAUTHORIZED

401, không thử lại. Missing, unknown, revoked or expired API key.

INSUFFICIENT_CREDITS

402, không thử lại. The product's wallet cannot cover the job. Add funds, then retry.

FORBIDDEN

403, không thử lại. Key hợp lệ nhưng không được làm việc này. Đang triển khai: key quyền Read only gửi hoặc huỷ job, hoặc key chỉ được chạy style khác (xem Khoá API). Trước đó: chưa trả.

NOT_FOUND

404, không thử lại. No such job, model or endpoint for this key.

IDEMPOTENCY_KEY_REUSED

409, không thử lại. This Idempotency-Key was already used with a different body. Use a new key for a new job.

JOB_NOT_CANCELLABLE

409, không thử lại. Only queued jobs can be cancelled.

RATE_LIMITED

429, thử lại. Too many jobs submitted this minute for this product. Retry after the Retry-After header.

PRODUCT_BUSY

429, thử lại. Your product's concurrency slots and its queue are full. Retry after the Retry-After header (about 5 s).

END_USER_LIMIT_REACHED

429, thử lại. This end user reached the daily job cap. Retry after the Retry-After header (resets 00:00 UTC).

INTERNAL_ERROR

500, thử lại. Something went wrong on Wandura's side. Retry with the same Idempotency-Key.

SERVICE_UNAVAILABLE

503, thử lại. This style cannot run on a live key right now (test keys still return a sample). Or the job queue is briefly unavailable: nothing was created or charged; retry after Retry-After with the same Idempotency-Key.

Job kết thúc không có kết quả (failed, timeout) không phải lỗi HTTP: error.code của nó nằm ở mục Trạng thái trên trang Jobs API.

Cập nhật 16/10/2026 · Lịch sử thay đổi (4)

↑↓ chọnEnter mởEsc đóng

Gửi góp ý

Góp ý được gửi thẳng tới đội Wandura, kèm địa chỉ trang này.

0 / 4000