Skip to content
bestokens

Ошибки

Коды состояния, типы ошибок и стратегия повторов.

Обновлено: 2026-10-27

Errors follow the OpenAI error envelope so existing retry logic keeps working.

              {
  "error": {
    "message": "Insufficient credit balance.",
    "type": "insufficient_quota",
    "code": "balance_exhausted"
  }
}
            

Status codes

StatustypeMeaningAction
400invalid_request_errorMalformed body or unsupported parameterFix the request
401authentication_errorMissing, invalid or revoked keyCheck the Authorization header
403permission_errorKey lacks scope, or region blockedUse a key with the right scope
404not_found_errorUnknown model id or routeList models via GET /v1/models
402insufficient_quotaCredit balance exhaustedTop up in the dashboard
429rate_limit_errorPer-key or per-IP limit hitBack off exponentially
499client_closed_requestClient disconnected mid-streamNo action
500api_errorUpstream failure after retriesRetry once, then report
503service_unavailableNo healthy channel for this modelRetry later or pick another model

Retry guidance

  • Retry 429 and 5xx with exponential backoff and jitter, starting at 500 ms, capped at 30 s.
  • Do not retry 400, 401, 402 or 404 — the same request will fail the same way.
  • Include an Idempotency-Key header on retried POSTs to avoid double billing on network flushes.

Техническая документация ведётся на английском языке.