altrouter.ai
CORE

Errors

Every error is returned in the OpenAI envelope with an appropriate HTTP status — compatible with OpenAI SDK error handling.

Error shape

JSON
{
  "error": {
    "message": "Insufficient credits.",
    "type": "insufficient_quota",
    "param": null,
    "code": "insufficient_quota"
  }
}

Status codes

400invalid_request_errorMalformed request body or parameter.
400content_policy_violationContent rejected by moderation.
401authentication_errorThe key is missing or invalid.
402insufficient_quotaNot enough credits (insufficient_quota), or the key’s spending cap is exhausted (spend_limit_exceeded).
403permission_errorThe key is valid but the surface is outside its scopes (insufficient_scope).
404not_found_errorModel does not exist or is unavailable.
429rate_limit_errorKey rate limit exceeded.
500api_errorAn internal gateway error (internal_error).
502api_errorModel-side error.
503service_unavailableThe model is temporarily unavailable.
504api_errorRequest exceeded the allowed time.
i
A 429 includes a Retry-After header. On 402, top up in the Credits section. 5xx errors are safe to retry — the router already tries failover routes before returning one.

You may also see a 499 status with code client_closed in your dashboard logs. That is not a service failure: it marks a request whose connection the client itself dropped — for example, a cancelled stream.

NextLimits & credits