GreenTokens

Search

Search models, guides, docs and the FAQ.

API

Errors

Status codes, error formats and what to do about each.

Status codes

StatusMeaningWhat to do
400Invalid requestFix the request body; the message says which field.
401Missing, invalid, paused or revoked keyCheck the key, or resume it on the API Keys page.
402Insufficient balance, or the key's spend limit is reachedTop up, or raise the key's limit.
403Model not allowed, or account suspendedContact support if you don't expect this.
404Unknown model or routeCheck the model ID against /v1/models.
409Idempotency conflict, or a job that can't be cancelledUse a new Idempotency-Key for a different body.
413Request too largeSend a smaller body or file.
502 · 503 · 504Upstream failure or timeoutRetry with backoff.

Error format

Errors match the format of the route you called, so your SDK parses them as usual: the OpenAI shape on /v1/chat/completions, /v1/responses and the media routes, the Anthropic shape on /v1/messages.

{
  "error": {
    "message": "Insufficient balance. Top up to continue.",
    "type": "insufficient_quota",
    "code": "insufficient_balance",
    "param": null
  }
}
The messages above are examples; read the actual message and code from each error.

Still stuck? Note the x-request-id from the response and contact support.