Skip to navigation

Errors

Every error code Gateway returns, grouped by HTTP status

Gateway errors carry a stable code to branch on and a source saying whether Gateway or the upstream vendor failed. Under a routing policy, Gateway already retries some failures on another route, so read what fails over before adding client retries.

The error envelope

Model endpoints (/v1/responses, the SDK-compatible surfaces, embeddings, media, and batches) return:

{
"error": {
"type": "not_found_error",
"message": "Model 'openai/gpt-9' is not supported. Check /v1/models for available models.",
"code": "model_not_found",
"param": "model",
"source": "gateway",
"provider": null
}
}
FieldMeaning
typeBroad category: invalid_request_error, authentication_error, invalid_api_key, permission_error, blocked_by_policy, blocked_by_pi_protection, not_found_error, budget_exceeded, payment_failed, rate_limit_error, provider_error, internal_error, or service_unavailable
codeThe specific identifier. Branch on it, not on message. Some errors have no code, so check type too.
paramThe request field at fault, when there is one
sourcegateway when Gateway rejected the request, provider when the upstream vendor failed
providerThe model’s author (for example openai) when source is provider

Rejections before Gateway reads the body (authentication, budgets, rate limits, blocklist rules, model access, prompt injection, and DLP) send only type, message, and usually code, so read param, source, and provider defensively. Schema validation failures on native POST /v1/responses return 422 with a detail array instead of error.

The Retry column says whether resending the same request can succeed: “Yes” means back off and resend, “No” means change the request or your configuration first.

Invalid requests: 400

Model and routing

codeMeaningRetryWhat to do
model_requiredNo model, and no routing policy resolved (or the resolved policy has no models)NoSend model, or set a default routing policy
invalid_model_formatThe model string matched nothingNoUse provider/model from GET /v1/models
ambiguous_base_modelA bare model name matched several providersNoSend the qualified provider/model
model_unavailableEvery model in the routing policy is inactiveNoUpdate the policy’s models
unsupported_endpoint_for_modelThe model doesn’t serve chat, such as an image or video model on a chat endpointNoCall the endpoint named in the message
alias_not_supportedAn @alias/ model was sent to embeddings, images, audio, video, decisions, or live sessionsNoAliases work on chat surfaces only. Send a model ID.
alias_routing_policy_conflictAn @alias/ model and routing_policy_id in the same requestNoSend one or the other
routing_policy_mismatchBody routing_policy_id and the X-Merge-Routing-Policy-Id header disagreeNoSend one value
routing_policy_requires_customer, routing_policy_requires_projectThe policy is scoped to a customer or project the request doesn’t resolve toNoSend the matching customer or use a key for that project
self_hosted_unsupported_strategyA fallback policy resolves only to self-hosted modelsNoUse a cost-based strategy for self-hosted models
invalid_priority_orderpriority_order is empty, has more than 10 entries, has an entry with no model or empty vendors, or is combined with routing_policy_id, vendor, or vendorsNoFix the list. Native /v1/responses returns 422 for these.
priority_order_model_conflictmodel isn’t the first priority_order entryNoOmit model or match the first entry. Native returns 422.
priority_order_routing_policy_conflictpriority_order sent with a routing policy id in the body or headerNoSend one or the other
vendor_unavailableThe vendor or vendors pin can’t serve the modelNoCheck the model’s vendors in GET /v1/models/{model}
capability_unavailableNo vendor for the model supports the requested capabilitiesNoDrop the capability or pick another model
vendor_restrictions_unavailableNo vendor survives your vendor allow and deny lists or region restrictionsNoLoosen the restriction or pick another model
zdr_vendor_unavailableZero data retention is on and no ZDR vendor serves the modelNoPick a model with a ZDR vendor
unsupported_paramsThe route can’t serve part of the request, such as tool calling, structured outputs, an input type, or the requested service_tierNoRemove the parameter or route elsewhere

Scope

codeMeaningRetryWhat to do
project_mismatchThe request’s project conflicts with a project-scoped keyNoDrop project_id or use the matching key
customer_mismatchcustomer conflicts with the header or with a customer API key’s customerNoSend one customer
customer_project_conflictA request combines a customer with any project scopeNoSend customer traffic without a project
invalid_customer, invalid_routing_policy_idX-Merge-Customer or X-Merge-Routing-Policy-Id isn’t a UUIDNoSend the UUID

Request body

codeMeaningRetryWhat to do
empty_input, empty_messagesinput or messages is emptyNoSend at least one item
invalid_input_itemA Responses input message has no valid roleNoUse system, developer, user, or assistant
invalid_message_content, invalid_tool_messagesMessage content or the tool call and tool result sequence is malformedNoFix the message the error names
invalid_openai_responses_requestThe OpenAI Responses payload isn’t an objectNoSend a JSON object body
invalid_request_body, malformed_request_bodyThe body can’t be parsed, or a gzip body is corruptNoFix the body or its Content-Encoding
invalid_response_formatresponse_format or text.format is malformed, such as json_schema without a schemaNoFix the format object
invalid_thinking_budgetthinking.budget_tokens isn’t a positive integer (SDK-compatible surfaces)NoSend a positive integer
unsupported_reasoning_effortThe effort isn’t one of none, minimal, low, medium, high, xhigh, or max. A known level the route doesn’t accept is clamped with a warning instead.NoSend a known level
output_budget_exhaustedThe model spent its whole output budget on reasoning and returned nothingNoRaise the output token limit or lower reasoning effort
unknown_tagsA tag key-value pair isn’t defined for your organizationNoList available pairs with GET /v1/tags
previous_response_id_unsupported, conversation_unsupportedconversation was sent, or previous_response_id can’t be resumed for your organizationNoSend the full conversation in input
invalid_previous_response_idprevious_response_id isn’t a stringNoSend the resp_ id
input_too_longSpeech input is over the vendor’s character limitNoShorten or split the text
invalid_dateA usage endpoint date isn’t YYYY-MM-DDNoFix the date

Tools and web search

codeMeaningRetryWhat to do
invalid_tool_definition, invalid_tool_name, invalid_tool_parametersA tool is malformed, has an empty name, or parameters isn’t a JSON Schema objectNoFix the tool
unsupported_tool_typeA tool type the route can’t execute, such as code_interpreter, file_search, mcp, local_shell, or custom on native /v1/responsesNoRemove the tool
unsupported_provider_native_toolAn Anthropic server tool such as web_search_20250305 on a non-Anthropic routeNoUse merge:web_search, or route to Anthropic
openai_tool_search_requires_openai, openai_web_search_requires_openaiAn OpenAI hosted tool on a request that can’t reach OpenAI directlyNoRoute to an openai/ model on the openai vendor
web_search_requires_providerA vendor-hosted search tool on a route whose vendor can’t run it, under the native web search modeNoUse merge:web_search, or route to the hosting vendor
invalid_web_search_modeprovider_options.web_search isn’t auto, native, or mergeNoSend a valid mode
web_search_unavailableThe chosen web search engine has no key configuredNoPass the engine’s api_key or pick another engine
unsupported_web_search_engineUnknown engineNoUse an engine the message lists
invalid_server_tool_parameters, invalid_search_context_sizeA web search parameter is out of range, such as max_results above 25NoFix the parameter
duplicate_server_toolMore than one web search toolNoSend one
server_tool_zdr_unavailableThe engine isn’t ZDR-compliant and zero data retention is onNoUse an engine the message lists
web_search_output_budget_exhaustedOpenAI hosted search ran out of output tokens before answeringNoRaise max_output_tokens or leave it unset

Fusion and images

codeMeaningRetryWhat to do
fusion_config_required, fusion_stream_unsupported, fusion_unsupported_tools, fusion_routing_policy_unsupportedA Fusion constraint: no config, streaming, unsupported tools, or a routing policyNoAdjust the request as the message says
image_input_unsupportedThe model on /v1/images/edits doesn’t accept image inputNoPick a model with image input
image_required, image_empty, too_many_images, image_too_large, uploads_too_large, stream_unsupportedAn image edit upload is missing, empty, more than 16 images, over 50 MB each or 100 MB total, or stream: trueNoFix the upload

Vendor-reported

codeMeaningRetryWhat to do
context_window_exceededThe vendor rejected the request as too long (source: provider)NoShorten the input or pick a larger context window
content_policy_violationThe vendor’s content policy blocked it (source: provider)NoChange the content. A routing policy fails over to another author.
unsupported_parameterThe vendor doesn’t accept a parameter (source: provider). Batches also use it for an unknown provider option.NoRemove the parameter
The vendor’s own codeAny other vendor 400, with type: provider_error and source: providerNoRead message

Authentication: 401

type (no code)MeaningRetryWhat to do
invalid_request_errorMissing key, or an Authorization header that isn’t Bearer <key>NoSend the key
invalid_api_keyUnknown, expired, or inactive key; a management key on a model endpoint; or a model key on /v1/keysNoUse an active key of the right kind
authentication_errorNo credential exists for any vendor in the route, such as a BYOK-only setup with no keyNoAdd the vendor key in your organization settings

Payment and budgets: 402

All have type: budget_exceeded except payment_failed. Gateway checks them before calling any vendor.

codeMeaningRetryWhat to do
budget_exceededOrganization credit is used upNoAdd credits or upgrade
payment_failedService is suspended for a failed paymentNoUpdate the payment method
project_budget_exceededThe project hit its hard limitNoRaise the budget. Changes take up to an hour to apply.
api_key_limit_exceededThe key hit its spend limitAfter resetRaise limit or wait for the limit_reset window
(none)An Embedded Routing customer hit its budgetAfter resetRaise the customer’s budget

Every response carries the budget headers for limits that exist: X-Credit-Balance-USD, X-Budget-Limit-USD, X-Project-Budget-Remaining-USD, X-Project-Budget-Limit-USD, X-Key-Limit-Remaining-USD, and X-Key-Limit-USD. X-Budget-Warning, X-Project-Budget-Warning, and X-Key-Limit-Warning appear near a limit. Customer API keys don’t get organization or project headers.

Blocked by policy: 403

codeMeaningRetryWhat to do
customer_blocked, customer_pinned, customer_model_blocked, provider_blocked, model_blockedA blocklist rule matchedNoChange the rule or the model
vendor_access_requiredThe model’s author isn’t enabled for your organizationNoRequest provider access
model_not_allowedThe key’s allowed_models excludes the modelNoUse an allowed model or update the key
free_tier_model_not_allowedThe model isn’t on the Free plan’s listNoAdd a payment method
(none), permission_errorThe customer is deactivated or deletedNoReactivate the customer

A block on the requested model has type: blocked_by_policy. When every model in a routing policy is blocked, the same codes come with type: permission_error.

Not found: 404

codeMeaningRetryWhat to do
model_not_foundUnknown model or alias. The compat GET .../models/{id} routes and unknown priority_order entries return it as 400.NoCheck GET /v1/models
vendor_not_foundUnknown vendor on GET /v1/vendors/{vendor_id}NoCheck GET /v1/vendors
customer_not_foundUnknown Embedded Routing customerNoCheck the customer id
provider_credentials_missingThe route needs your own vendor key and none exists for the customer or organizationNoAdd the key the message names
previous_response_not_found, response_not_foundThe stored response expired (an hour after last use), belongs to another organization, or wasn’t stored with store: trueNoSend the full conversation
video_job_not_foundUnknown video idNoCheck the id from POST /v1/videos
The vendor’s own codeThe vendor returned 404 (source: provider)NoA routing policy fails over

Too large: 413

codeMeaningRetryWhat to do
payload_too_largeInline base64 media over 20 MB per request for images, documents, or video, or 25 MB for audioNoSend a URL instead
request_too_largeA gzip body over 64 MB once decompressedNoSend a smaller body

Blocked by guardrails: 422

The body also carries guardrails when you set include_guardrails_metadata.

codeMeaningRetryWhat to do
blocked_by_dlp_policyA DLP rule blocked the request (type: invalid_request_error)NoRemove the data or change the rule
dlp_redacted_emptyThe prompt was empty after DLP redactionNoChange the prompt
pi_block_thresholdPrompt injection protection scored the input above the block threshold (type: blocked_by_pi_protection)NoReview the input or the threshold
pi_indirect_two_signals, pi_indirect_signal_and_structuralIndirect injection was detected in tool results or other untrusted contentNoReview the untrusted content
sidecar_errorThe scan couldn’t run and your policy fails closedYesRetry

Rate limited: 429

codeMeaningRetryWhat to do
(none), source: providerThe vendor throttled the request. A routing policy fails over first.YesBack off. No Retry-After is forwarded.
(none), no sourceThe key’s rate_limit_rpm was reachedYesWait for Retry-After
free_tier_daily_limitA Free plan organization used its daily requestsAfter resetAdd a payment method. Retry-After is the seconds until the UTC day resets.

See Rate limits.

Gateway and vendor failures: 5xx

StatuscodeMeaningRetryWhat to do
500internal_errorUnexpected Gateway errorYesContact support if it persists
500response_store_unavailableThe stored conversation couldn’t be read in timeYesRetry, or send the full conversation
500org_vendor_api_base_missing, org_vendor_credential_missing, org_vendor_credential_undecryptable, vendor_credential_key_missingA self-hosted endpoint or vendor credential is misconfiguredNoRe-save the endpoint or credential
503provider_authentication_failedThe vendor rejected the credential serving the routeNoFor BYOK, check your vendor key
503provider_account_restrictedThe vendor declined for account or billing reasons on your credentialNoCheck your vendor account
503upstream_account_unavailableThe vendor declined on Merge-managed credentialsYesRetry, or use another model
503model_vendor_unhealthyThe route is marked unhealthy after repeated failuresYesRetry, or use a routing policy
503(none), provider_errorTransient vendor failure, overload, or a stalled streamYesRetry with backoff
503model_resolution_unavailable, org_vendor_store_unavailable, or (none) with internal_errorAn alias, self-hosted endpoint, or customer setting couldn’t be read, so Gateway failed closedYesRetry
503(none), service_unavailableGateway is starting upYesRetry
503byor_no_qualifying_modelBYOR routing found no model that meets its thresholds and has no fallback. The error is nested under detail.NoLoosen the thresholds or set a fallback model

Batches

Batch endpoints use the same envelope. Line-level errors name the custom_id.

StatuscodeRetryWhat to do
400unsupported_batch_endpoint, empty_batch, invalid_custom_id, duplicate_custom_id, batch_model_mismatch, invalid_status_filter, invalid_created_filterNoFix the batch or the query
400stream_unsupported, empty_messages, empty_input, max_tokens_required, invalid_request_body, unsupported_params, unsupported_parameter, unsupported_batch_mediaNoFix the line
402batch_budget_exceededNoAdd credits or wait for other batches to bill
403batch_not_supportedNoPick a model and endpoint with a batch price
404batch_not_foundNoCheck the batch id
409batch_results_not_ready, batch_not_cancellable, batch_not_deletableNoWait until the batch is in the right status
413batch_body_too_large, batch_too_largeNoSplit the batch
422blocked_by_dlp_policy, batch_media_blocked_by_dlp, web_search_unsupportedNoRemove the blocked data, media, or web search tool
429too_many_open_batches, batch_submit_busy, provider_batch_queue_full, provider_rate_limitedYesRetry later, honoring Retry-After

Management and platform APIs

The Management API, the Embedded Routing Stack API, the Evals API, and the Migrations API return {"detail": ...}. Most have a string detail and a standard status: 400 validation, 401 missing or invalid key, 403 missing scope, 404 not found, 409 conflict, 422 schema. Cases worth branching on carry {"detail": {"code", "message"}}:

StatuscodeWhereWhat to do
400customer_inactiveCreate customer API keyReactivate the customer
403customer_scoped_key_forbiddenOrganization-level routes called with a customer API keyUse an organization-level key
403customer_scoped_key_forbidden_fieldA customer API key changing anything but its own name, or its own controlsUse an organization-level key
403scoped_controls_loosening_forbiddenA management key widening organization controls on a projectMake the change in the dashboard
409org_api_key_limit_reachedCreating an API key when the organization already has 1,000Delete unused keys or contact support
429customer_api_key_rate_limitedMinting more than 10 API keys per minute for one customerRetry after the Retry-After header
409PROJECT_HAS_ACTIVE_API_KEYSDeleting a project with active keysRevoke the project’s keys first
503DATA_PLANE_UNAVAILABLEDeleting a project when its keys can’t be checkedRetry
400unknown_model, no_cases, unknown_case, duplicate_output, too_many_cases, input_too_large, duplicate_external_idEvals suites, case sync, and run triggersFix the request as the message says
409suite_name_taken, run_in_flight, not_cancellableEvals: a name clash, 3 runs already in progress, or cancelling a finished runRename, wait, or skip the cancel
429(none)Evals run triggers over 10 per minute per organizationRetry after a minute
400vendor_access_required, unknown_suiteMigrations: a gated model, or a suite that doesn’t existRequest access or fix the suite id
409baseline_has_overrideMigrations: the baseline is already overridden by a completed migrationRevert that migration first

What fails over

Under a routing policy, vendor 429, 5xx, timeouts, billing errors, vendor 404, output_budget_exhausted, and content-policy refusals move to the next route instead of reaching you, so client retries on them usually repeat work. Gateway’s own 400 to 404, credential 401 and 403, and budget 402 stop (failover rules).

Three kinds of 200 response also fail over, on non-streaming requests only:

ResponseFails over to
Empty content, no tool calls, and finish_reason stop, on a request without stop sequencesThe next candidate route
finish_reason content_filter (a vendor safety filter blocked the prompt or the output) and no tool calls, even with partial contentA model from a different direct provider
A body that breaks a strict json_schemaA different model. See Structured outputs.

When every route returns one of these, you get the last response rather than an error. Each attempt is billed at the route that ran it.

Errors during streaming

If Gateway rejects a streamed request or the vendor’s first frame is an error, you get the same HTTP status and body as a non-streaming request, with no stream. Once the stream opens the status is 200, and failures arrive as frames: response.error on native /v1/responses, error then response.failed on /v1/openai/responses, and an error event on the Anthropic surface.

Requests that run with changes, such as a dropped tool or a clamped effort level, succeed with a warnings array.

Next steps