Error codes

The canonical error table.

The gateway returns a stable code in every error body so clients can branch deterministically.

StatusCodeMeaningClient action
400invalid_requestMalformed JSON body or unsupported parameters.Fix the body and retry.
401invalid_api_keyMissing or invalid API key.Send a valid key.
402model_allowance_exhaustedPlan allowance for this model is exhausted and balance fallback is off. Carries reset_at.Wait until reset_at, switch model, or enable fallback.
402insufficient_balancePrepaid balance too low. Carries reset_at.Top up or wait.
402upstream_spend_limit_reachedUpstream spend cap reached. Carries reset_at when available.Wait or switch model.
403model_not_in_planThe model is not enabled on your plan.Use an allowed model.
404not_foundUnknown model or endpoint.Check the model name.
429rate_limitedPer-key request rate limit exceeded.Retry after Retry-After.
429upstream_rate_limitedAll upstream keys are rate-limited or cooling down.Retry after Retry-After.
502upstream_errorAll upstream attempts failed.Retry; contact support if it persists.

The response also carries x-air-request-id for support. x-air-model echoes the canonical model you requested.