Skip to content
docs

Errors & rate limits

Errors use OpenAI's shape, so SDKs raise them the way they raise OpenAI's. Every response carries an x-request-id.

statuscodemeaning
400invalid_requestthe body is wrong; param names the field
400unsupported_parameterthis model doesn't take that parameter; the model's page lists the ones it does
400invalid_buyback_tokenx402 only: the X-Buyback-Token is not a mint, or not eligible for buybacks
400x402_unsupported_modelx402 only: this model's price isn't known until it runs; use a key
401missing_api_keyno key sent; send it as Authorization: Bearer <key>
401invalid_api_keywrong or revoked key
402insufficient_balanceadd funds, or pay this request with x402
402spending_cap_reacheda signed-in app hit its monthly cap; raise it under Connected apps
404model_not_foundunknown or unlisted model id
410media_expired / upload_expiredthe file was deleted after 24 hours; generate or upload it again
413payload_too_largethe request body is too large
429rate_limit_exceededover the rate limit of 600 requests per minute per key; wait for Retry-After
500internal_errorour error; retry, and quote the x-request-id if it repeats
502generation_failedthe model failed to make the file; try again
503no_capacityno capacity for this model right now; wait for Retry-After
504timeoutthe model took too long; try again
error body
{
  "error": {
    "message": "Your balance is too low for this request. Add funds to continue.",
    "type": "insufficient_quota",
    "code": "insufficient_balance",
    "param": null
  },
  "request_id": "7f3c..."
}

We retry a failed upstream attempt for you once before the first byte of a response; a stream that has started is never switched mid-way, and media generations are never retried. Quote the x-request-id when you contact us.