Skip to content

Errors and limits

Errors come back as JSON, with a status code and a message you can show.

JSON
{
  "error": {
    "code": "insufficient_balance",
    "message": "Your balance does not cover this request.",
    "type": "billing_error"
  }
}

Status codes

StatusCodeWhat to do
400invalid_requestFix the request. The message says what is wrong.
401unauthorizedCheck your key. It may be revoked.
402insufficient_balanceYour balance does not cover the text. Add credit.
429rate_limitedWait for the seconds in Retry-After, then retry.
503unavailableThe queue is full or the model server is down. Wait for Retry-After, then retry.

You are charged when the render finishes. A failed render is never charged, so retrying after an error costs nothing extra.

Limits

LimitValue
Input2,000 characters a request
Concurrency2 requests at once per key, and 2 per account
Rate60 requests a minute per key
Keys10 active keys per account
QueueBounded across all accounts. When it is full, requests answer 503.