Errors

Every error is JSON with a stable code you can switch on. The status tells you whether to retry; the code tells you why it happened; the message is for a human.

Envelope#

error
{
  "error": {
    "message": "Model \"openai/gpt-9\" is not allowed for this API key",
    "type": "invalid_request_error",
    "code": "model_not_allowed",
    "request_id": "9550cc20-5c1f-45e1-8413-08874b3f1a64"
  }
}

request_id matches the X-Ahura-Request-Id header and the usage record. Errors from the Anthropic-compatible route use Anthropic’s envelope instead, with the same status codes.

Codes#

StatusCodeCauseWhat to do
400invalid_jsonThe body is not valid JSON.Fix the request.
400invalid_requestA field failed validation; the message names it.Fix the request.
400model_requiredNo model, and no preset that supplies one.Send a model id.
400preset_not_foundX-Ahura-Preset names a preset your organization does not have.Check the name in the dashboard.
400guardrail_blockedThe guardrail was set to block and a critical pattern matched.Review the prompt; see Guardrails.
400self_serve_modelA private adapter that is not being served anywhere.Start a serving pod for it from the dashboard.
401invalid_api_keyMissing, malformed, unknown, revoked or expired key, or a request from outside the key's IP allowlist.Check the key and where you are calling from.
402hard_cap_reachedThis key's monthly hard cap is spent.Raise the cap on the API keys page, or use another key.
402org_hard_cap_reachedThe organization's monthly hard cap is spent.Raise the cap under Inference settings, or wait for the new month.
403model_not_allowedThe key's model allowlist does not include this model.Use an allowed model or widen the allowlist.
404model_not_foundNot a catalog id.Check GET /v1/models.
429rate_limit_exceededOver the key's requests per minute.Wait Retry-After seconds. The SDKs do this.
429upstream_rate_limitedThe model's backend is throttling.Retry with backoff, or switch model.
503model_unavailableThe model is in the catalog but switched off, or its routing could not be read.Retry later or use another model.
503instance_warming_upA hosted model's replicas are all starting.Wait Retry-After seconds and retry.
503embeddings_unavailableThe embeddings endpoint has no provider configured.Not retryable at present.
502 / 503upstream_unavailableThe model's backend rejected our credentials or is down.Retry with backoff; we are alerted.
400 / 422upstream_rejected_requestThe backend refused the request on a rule of its own.Read the message; usually a parameter the model does not accept.
500internal_errorA fault inside the gateway.Retry once; if it persists, contact support with the request_id.

Retry policy#

Retry 429, 502, 503 and 500 with exponential backoff, honouring Retry-After when present. Never retry 400, 401, 402, 403 or 404: the same request will fail the same way until something on your side changes.

Something missing or wrong on this page? Tell us, and quote the page title.