Error response format
All error responses follow this structure:
Branch on
error_code, not by parsing message. Every public API response
also includes an X-Request-Id header. Record that identifier with your error
logs and include it when contacting support.
Common stable values include:
Error codes
400 — Bad Request
The request body is malformed or missing required fields. Common causes:- Missing
model,task_type, orinputin the request body - Unknown or unsupported
task_type - Invalid input parameters for the selected task type
401 — Unauthorized
The API key is missing, invalid, or has been revoked. Common causes:- No
x-api-keyheader in the request - API key does not exist or has been deleted
- API key has been disabled
402 — Payment Required
Your account does not have enough available credits to cover the task cost. How to fix: Top up credits in your dashboard.403 — Forbidden
The authenticated account is not currently allowed to create a task.404 — Not Found
The requested resource does not exist. Common causes:- Invalid task ID
- Task belongs to a different user
429 — Too Many Requests
You have exceeded the rate limit. How to fix: Wait for the duration inretry_after_seconds (or the Retry-After header) before retrying.
500 — Internal Server Error
An unexpected error occurred on the server. What to do: For read-only requests, retry after a short delay. ForPOST /api/v1/task, do not automatically submit the same task again when the
result is unknown; the current endpoint does not yet accept an
Idempotency-Key. If you already received a task_id, poll that task instead.
502 — Bad Gateway
The upstream AI provider returned an error or is temporarily unavailable. What to do: If the provider failure is explicit, the failed task follows the normal refund path. For an uncertain network or gateway result fromPOST /api/v1/task, do not blindly create another task. If you already
received a task_id, poll that task instead.