Error Codes

Error Codes

OpenAI-compatible paths return a unified JSON error shape. Anthropic- and Gemini-compatible paths preserve their protocol behavior where practical, while sharing the same authentication, balance, and limit checks.

config.json
json
{
  "error": {
    "message": "Human-readable description",
    "type": "invalid_request_error",
    "code": "validation_error"
  }
}
HTTPCommon codeMeaningRecommended action
400bad_request / validation_errorInvalid body or parameterCheck required fields such as model and messages
401invalid_api_keyMissing, malformed, or unknown keyUse a valid ck- key
402insufficient_balanceBalance cannot cover the estimated requestTop up and retry
403model_not_allowed / ip_not_allowed / daily_limit_exceededKey policy, IP, or daily cap blocked the requestCheck API key settings
404model_not_found / generation_not_foundModel or generation was not foundCheck /v1/models or the gen- ID
429rate_limit_exceededRequest rate exceeded limitsRetry with exponential backoff
500internal_errorGateway internal errorContact support with X-Request-Id if persistent
502provider_errorUpstream returned an errorRetry later
503provider_unavailableUpstream temporarily unavailableRetry later or choose another model
504provider_timeoutUpstream timed outShorten input/output and retry

Retry-After may appear on some paths or upstream responses, but it is not the current stable public contract. Use exponential backoff in clients.

Error Codes — Chuizi AI Docs | Chuizi AI