Skip to content

API docs · Reliability

Error codes

The common error body and every error code.

All errors share one structure (see the example on the right). The table below lists the error.code values the API can return and their HTTP statuses; one status can map to several error codes:

HTTPcodeWhenRetryableWhat to do
400invalid_requestMalformed JSON, Content-Type is not application/json, or Idempotency-Key is missing or too long; a request body over 1 MB returns 413NoFix the request and resend
401invalid_api_keyKey does not exist, or is revoked, expired or disabledNoCheck the key status in the console
401unauthenticatedConsole session is missing or expiredNoSign in again
402quota_exceededNot enough available quota in the account; the reserve ceiling exceeds max_budget (param is max_budget); or asset storage is fullNoTop up, adjust max_budget or clean up assets, then retry
402key_limit_exceededThe key's total or daily limit is insufficientNoRaise the key limit, then retry
403permission_deniedKey lacks the scope, the model is not in the key's allowlist, or the model is not enabled for the accountNoGrant the key the permission in the console, or contact our operations team to enable the model
403csrf_failedConsole request has a missing or expired CSRF tokenNoRefresh the page and try again
403account_suspendedThe account is suspendedNoContact our operations team
404not_foundResource does not exist or does not belong to youNoCheck that the ID is correct
404not_availableFeature is only offered on the Global site and is not available on this siteNoUse the site that offers it
403terms_requiredLatest top-up terms not yet acceptedNoRead and accept the top-up terms, then retry
409idempotency_conflictSame idempotency key with a different request bodyNoUse a new idempotency key for a new request
409conflictResource state conflictNoFetch the latest state, then try again
409group_not_emptyThe group still contains assetsNoMove or delete its assets first
422invalid_parameterInvalid parameter or unsupported combination (never silently dropped)NoFix the parameters against the model capabilities
422asset_not_readyAsset is still processingYesRetry once its status is available
422authorization_requiredReal-person asset lacks a valid authorizationNoComplete real-person authorization, then retry
429rate_limitedKey RPM exceeded, or the account's / key's concurrency limit reachedYesBack off per Retry-After, then retry
500internal_errorInternal platform errorYesRetry with the same idempotency key

When retryable is true, retry with backoff. Retries of task creation must use the same Idempotency-Key.

Failures that occur only after a task is accepted (for example, no processing route is currently available) are not returned as API errors; they appear in the task's error.code instead. See task failure codes.

Error response
HTTP/1.1 422 Unprocessable Entity
X-Request-Id: req_xxx

{
  "error": {
    "code": "asset_not_ready",
    "message": "Asset asset_xxx is still processing. Retry once its status is available.",
    "param": "inputs[0].asset_id",
    "retryable": true,
    "request_id": "req_xxx"
  }
}