Skip to content

Error codes

Errors are returned via HTTP status codes and the detail field.

Status codes#

CodeNameDescription
400Bad RequestInvalid request. Unsupported model ID, a disallowed model/tier (key scope restriction), a parameter out of range, and so on.
401UnauthorizedMissing API key, invalid key, expired key, or deleted user.
402Payment RequiredInsufficient credits (insufficient_credits): top up and retry. Key monthly budget exceeded (monthly_budget_exceeded): adjust the key's budget in Dashboard → API Keys.
403ForbiddenResource access denied. Occurs with a disabled key or access to a model outside the allowed set.
429Too Many RequestsRate limit exceeded. Default 60 RPM per API key. Wait a moment and try again.
502Bad GatewayUpstream provider error. The request still failed after automatic retries and fallback. No credits are charged.

Structured errors#

Billing/consent-related errors include a machine-readable code string in detail.error.

402 — insufficient_credits
{
  "detail": {
    "error": "insufficient_credits",
    "message": "Insufficient available credits: ₩120 < ₩540"
  }
}
403 — forbidden
{
  "detail": {
    "error": "forbidden",
    "message": "You do not have access to this resource"
  }
}

Retry guidance#

Retry 429 and 502 with exponential backoff. The server already retries provider calls twice, so we recommend a client retry interval of at least 1 second. For 4xx, retrying produces the same result until you fix the request.