Dagon InferenceDocs Console

Reliability

Errors

Errors use the shape of the endpoint you called: OpenAI-style on Chat Completions, Responses and the other routes, Anthropic-style on /v1/messages. Every error carries a stable code; branch on it, not on the message.

On this page

Shapes

JSON
// OpenAI-style
{ "error": { "message": "This key has no credit available. Add credits first.",
             "type": "billing_error", "param": null, "code": "insufficient_credits" } }

// Anthropic-style (/v1/messages, /v1/messages/count_tokens)
{ "type": "error",
  "error": { "type": "invalid_request_error", "message": "This key has no credit available. Add credits first.",
             "code": "insufficient_credits" } }

Errors from the gateway carry x-gateway-request-id; quote it when you contact support. Retry-After is set wherever retrying later can succeed. An error from the provider itself is passed through in its own shape; a provider's 401, 402 or non-policy 403 becomes a 502/503 from the gateway, since it is never your billing problem.

Types by status

StatusOpenAI typeAnthropic type
400invalid_request_errorinvalid_request_error
401auth_errorauthentication_error
402billing_errorinvalid_request_error
403permission_errorpermission_error
404not_found_errornot_found_error
409invalid_request_errorapi_error
413invalid_request_errorrequest_too_large
429rate_limit_errorrate_limit_error
451unavailable_for_legal_reasonsapi_error
503provider_erroroverloaded_error
otherprovider_errorapi_error

Request errors (400, 404, 408, 413)

CodeMeaning
invalid_json, invalid_bodyThe body is not a JSON object.
unsupported_parameterA field the gateway does not forward (it names it in param), an unsupported tool or tool_choice, content stored upstream, or an anthropic-beta.
web_search_not_supportedWeb search is billed per search upstream and is not available.
missing_max_tokens, invalid_max_tokens, max_tokens_too_largeMessages needs max_tokens; caps must be positive integers within the model's limit.
invalid_nn must be 1 to 8, on chat only.
unsupported_endpointThe model is not served on this endpoint; see its endpoints.
model_not_foundUnknown model id (404). List models with GET /v1/models.
request_timeoutThe body did not arrive in time (408).
request_too_largeThe body is over the limit (413); see limits.

Authentication (401, 403)

CodeMeaning
missing_api_keyNo key was sent.
invalid_api_keyUnknown or revoked key.
key_expiredThe key's expiry has passed.
key_disabledThe key or its account was deleted or disabled.
session_not_allowed, session_required, invalid_session, session_expiredConsole session problems; see passkeys.
key_suspended403: an automatic safety suspension. See Safety.
forbidden403: this credential may not do that (a child managing children, a session deleting its account).
reauth_required403: log in with a passkey again before changing passkeys.

Billing (402)

CodeMeaning
payment_requiredNo key: pay with x402 or send a key.
insufficient_creditsThe key's available balance is below this request's hold. Add credit or lower the output cap.
insufficient_fundsA transfer between root and child is larger than what is available.
paid_daily_cap_exceededThe account received $2,000 of paid credit in 24 hours.
settlement_pending, duplicate_settlement, invalid_exact_svm_…x402 payment problems; see x402 error codes.

Limits and capacity (429, 503)

CodeMeaning
too_many_requestsToo many requests in flight for the key, the account, or (without credit) the client address.
rate_limitedAn hourly limit was reached; see the message and Retry-After.
too_many_open_checkoutsFive unpaid checkouts are open on this key.
service_busyThe gateway is at capacity. Retry shortly.
service_pausedThe gateway is temporarily not taking requests.
upstream_unavailableNo provider can take the request right now.

Upstream and other

CodeMeaning
upstream_unreachable502: the provider could not be reached. Nothing is charged.
upstream_failed502: the provider failed while answering, or sent more than the request allows.
upstream_timeout504: the provider did not finish in time.
request_cancelled499: the client went away.
location_blocked451: the service is not offered where the request comes from.
internal_error500: a gateway fault. Quote the request id.

Last updated