Skip to content

Errors, timeouts and failover

OpenAI-style endpoints (/v1/* except Anthropic Messages and Gemini, and /prism/*) return:

{"error": {"type": "invalid_request_error", "code": "invalid_request", "message": "...", "param": null}}

The X-Prism-Error-Class header repeats code, so a client can branch on it without parsing the message. X-Request-Id identifies the request.

/v1/messages uses the Anthropic shape, /v1beta/... the Google shape and /api/* the Ollama shape; see Ingress dialects. The codes below are the same; only the envelope differs.

Every code below is promised: a client may branch on it, and it keeps its meaning in 1.x. The messages are not promised.

Code HTTP Meaning
invalid_request 400 Malformed JSON, invalid field, unknown model, invalid prism intent
invalid_request_size 400 Body over [server] max_request_body_bytes (default 4 MiB), or top_n above 128 on rerank. Prism answers 400, not 413, except for a request with Idempotency-Key (see request_too_large)
request_too_large 413 A request with Idempotency-Key whose body is over [server] max_request_body_bytes. On /v1/messages it is also the Anthropic error type of any 413
invalid_idempotency_key 400 Idempotency-Key is not one visible-ASCII value of at most 128 bytes; see Headers
invalid_idempotency_reset 400 X-Prism-Idempotency-Reset is not true or false, or comes without Idempotency-Key
streaming_response_guard_unavailable 400 A streamed request under a [traffic_guard] policy that redacts or blocks answers; such a policy needs a request without streaming. No provider was called
session_identity_conflict 400 X-Prism-Session and body session_id differ
personal_key_required 401 Main address in an organization: every model request needs a personal Prism key, the owner’s included. Discovery, health and the model list stay open
unauthorized 401 Managed address: no valid key. A request with a Prism key on either address: the key is revoked, expired or unknown, or the request carries a query parameter that names a credential, or one outside the list of an image, audio, file or batch route (see Requests with a Prism key). For one key that is revoked, expired or unknown (an app that was disconnected included), the message is “This Prism key is not valid: it was revoked or expired, or the app was disconnected. Sign in again from the app, or use a current key.”; every other case has the message unauthorized. Control and status endpoints: no valid token
billing_required 402 Every provider tried asks for payment or a top-up
forbidden 403 A request with a Prism key carries a header the managed address refuses, or the key may not use this address or route
policy_denied 403 The key’s policy does not allow the request; the message names the part of the policy (endpoint, model, provider, spend, latency, concurrency and the like)
origin_not_allowed 403 A browser request from an origin that is not in [server] cors_allowed_origins and carries no Prism key
corporate_unavailable 403 A paid feature without an active subscription whose edition includes it; the body adds unavailable{capability, reason, message, requires}, where requires is the lowest edition that opens it (pro, teams or enterprise). When the edition does not include the feature (reason: edition_required) or no subscription is bound, the message is “This feature needs Prism . Please upgrade your plan.”
batch_spend_unverifiable 403 Batch creation on the managed address
openai_access_suspended 403 Teams and Enterprise: the organization suspended your requests to OpenAI models and no other company’s model can serve this request
route_not_found 404 No endpoint at that method and path
thread_not_found 404 /v1/messages: an Anthropic message thread Prism cannot continue (its connection or model is gone, or the binding expired); Anthropic shape with error.details.error_code
method_not_allowed 405 A wrong method on most endpoints (the passthrough routes answer 400 invalid_request)
idempotency_conflict 409 Idempotency-Key is already bound to another request, or X-Prism-Idempotency-Reset named a request that still runs
channel_gone 410 Every provider tried reports the model as permanently gone
traffic_guard_blocked 422, or 502 [traffic_guard] blocked the request (422, no provider was called) or withheld the provider’s answer (502)
prism_overloaded 429, Retry-After: 1 Prism is behind on writing the records of answered keyed requests; retry shortly
budget_exceeded 429 A [[budget.limits]] threshold with action = "reject" was reached, or every route of the request is closed by a spent [[budget.account_limits]] or [[budget.model_limits]] entry; Retry-After says when the earliest window resets
server_error 500 Configuration or internal error
server_configuration_error 500 Prism’s configuration does not pass its own check for serving model requests
integrity_incomplete 500 A keyed request’s plan or record could not be saved, so it was not sent
traffic_guard_error 500, or 502 [traffic_guard] could not check the request (500) or the answer (502)
idempotency_incomplete 503, or 500 An idempotent request was cancelled by a shutdown (503 with Retry-After; a retry with the same key runs it again) or produced no answer (500)
endpoint_not_supported 501 File, image, audio or batch endpoint with no OpenAI-compatible provider
invalid_upstream_body 502 The provider’s answer could not be read in the dialect the client asked for (for example a Responses or Gemini answer that is neither that object nor a chat completion)
upstream_error 502, or the provider’s status The provider failed. A provider’s own JSON error body is passed on with its status, and X-Prism-Upstream-Status names that status
all_attempts_failed provider’s status Every attempt of a routed request failed; see below
overload 503, Retry-After: 5 Prism’s request queue is full, or a key already runs its limit of requests at once
prism_starting 503, Retry-After: 2 Prism is still loading its state after a start; the answer carries X-Prism-Starting: 1
prism_store_inconsistent 503 Prism found its record of keyed requests inconsistent at start and refuses keyed requests until the store is repaired
idempotency_capacity 503 The store of idempotent answers is full for now; retry later or without Idempotency-Key
session_lock_unavailable 503 The conversation is locked to one model and provider that cannot serve now; Prism does not substitute another
orchestration_buffer_limit 503 A stream Prism checks before passing it on reached its size or time bound before the answer was complete; the provider call was cancelled and nothing was sent to the client
providers_unavailable 503 No provider can serve the request now (none connected, all unhealthy, or none offers the API). May carry prism_switch_offer
providers_rate_limited 503, provider’s Retry-After Every provider tried is rate limited
no_eligible_executor 503 The request’s requirements (local-only, capabilities, quality, effort) leave no model; error.prism lists the exclusions
privacy_route_unavailable 503 A local-only request and no local model that can serve now; error.prism.exclusions names each local route that is out, its health state and the class behind it
timeout 504 A provider or the queue did not answer in time

Retry overload, prism_overloaded, prism_starting and timeout with a delay, not at once.

The status, cost, fact, route-event, outcome and trace endpoints answer the codes above where they apply, and these:

Code HTTP Meaning
invalid_cost_period, invalid_cost_window 400 /prism/cost: a period other than day, week, month or all; a from/to window that does not parse or is longer than 366 days
invalid_outcome, invalid_outcome_body 400 /prism/outcomes: an outcome event that does not follow the schema, or a body that is not one
invalid_trace_id 400 /prism/traces/{trace_id}: not a trace id
session_required 400 /prism/session/last-served without X-Prism-Session
not_found 404 /prism/requests/{id}/route: no such request for this caller
outcome_reference_unknown 404 An outcome event names a request or session Prism does not know
outcomes_not_enabled 404 The outcome endpoint is off on this installation
trace_not_found 404 Tracing is off, or the trace does not exist or expired
served_model_not_found, served_model_history_not_enabled 404 /prism/session/last-served: no finished request for the session, or the history is off
route_event_stream_limit 429 Too many route-event streams are open
internal_error, cost_payload_error, trace_store_error, streaming_unsupported 500 The report or trace could not be read
status_payload_not_configured, cost_payload_not_configured, cost_selectors_unavailable 501 This build or start has no status or cost report, or its cost report does not take window, grouping or consumer selectors
facts_unavailable, cost_unavailable, route_events_unavailable 503 The fact, cost or route-event store is not available now

Console and administration endpoints add codes of their own. These concern keys and Smart: 409 app_connection when a key of an app the person signed in to would be changed (it can only be disconnected), 409 smart_band_unavailable and 409 smart_cascade_unavailable when the Smart quality band or checked cascade is switched on without the official build or the routing store, and 403 owner_required when someone other than the installation owner changes them. Two concern editions: 409 seat_limit (“every paid seat is taken; add seats to the subscription first”) when an invitation would bring in a person beyond the installation’s seat limit (Free 3; Pro and Teams their paid seats, at most 5 and 10; Enterprise its paid seats), and 409 edition_limit (“several teams need Prism Enterprise”) for a second team below Enterprise.

A provider::model pin to an OAuth account awaiting reauthentication returns 503 providers_unavailable, not an unknown-model 400. Its message directs the connection owner to Connections in the Prism console to sign in again. This applies to Chat, Messages and Responses and does not switch to a sibling account. There is no Retry-After: retrying alone cannot repair the login. Unknown connection names still return 400 invalid_request.

When Prism tried several models and all failed, it returns:

{"error": {"type": "upstream_error", "code": "all_attempts_failed",
"message": "auto route failed on all attempted providers: claude-oauth/claude-opus-5-5 content_filter, openrouter/z-ai/glm-5.3-flash unavailable",
"attempts": [{"provider": "...", "model": "...", "status": 503, "reason": "...", "latency_ms": 812}]}}

The message names each provider and model tried with its reason, for clients that show only the message. X-Prism-Attempts, X-Prism-Attempt-Providers and X-Prism-Attempt-Reasons summarise the same list. content_filter means the provider withheld the answer (finish_reason: content_filter, Anthropic stop_reason: refusal). The body holds no request content, provider response or credential.

For a request Prism routes itself (auto, a strategy, a role, a bare model id), an attempt that fails with a retryable error (timeout, 5xx, rate limit, unavailable model, a model refusing the request with 403) moves to the next candidate in the order. A model that refused a client this way is skipped for that client, recognised by its User-Agent, for the next six hours; other clients still reach it. The tool results of a tool loop go to the model that asked for the tools; only when that model withholds its answer (content_filter) does the turn move to the next model. Prism never retries after the first byte of a streamed answer has reached the client.

When an OpenAI model refuses a request (content_filter, or an OpenAI invalid_prompt usage-policy rejection), Prism does not send it to any other route to an OpenAI model: not another subscription account, not the OpenAI API, not OpenRouter openai/* or another reseller. OpenAI’s Usage Policies forbid working around its safeguards. Models of other creators are still tried; gpt-oss served by another company counts as that company’s model. The routing record carries openai_refusal_held: true.

An Anthropic model’s refusal is held the same way (content_filter: Anthropic stop_reason: refusal, or a usage-policy rejection): Prism does not send the request to another route to an Anthropic model, whether another Claude subscription account, the Anthropic API or OpenRouter anthropic/*. Anthropic’s Usage Policy from 2026-11-12 forbids coordinating across accounts to circumvent its guardrails. Other creators’ models are still tried, and a rate limit or server error of a Claude route is not a refusal. The routing record carries anthropic_refusal_held: true.

A provider::model request stays on that provider unless failover to other providers is allowed; see Choosing a model.

A 429 marks only that model as cooling down, not the whole provider. A provider is marked unhealthy when two of its models fail within about a minute, or on authentication, transport or gateway errors. An unhealthy provider returns to routing after its probes succeed again.

An answer that names a capability the model does not have, or that blames the request itself, is never counted against the model or the provider, whatever HTTP status the provider chose. A text-only model answering an image request (image input is not supported, Multimodal projector is not loaded, At most 0 image(s), or OpenRouter’s No endpoints found that support image input) records vision=false for that route and stays in routing; so does a request the server could not read (Failed to load image, Unable to process input image, Invalid content type) and an ordinary bad parameter. Credential and funding refusals still take the account out, a model the account may not use stays refused, and a model the provider no longer lists still leaves routing.

Phase Remote provider Self-hosted / local provider
Stream opening (until the provider answers with HTTP 200) 8 s; 60 s for models that reason before answering 90 s
Whole non-streaming attempt 120 s; 600 s for models that reason before answering 600 s
Silence inside a running stream 120 s 600 s

A model counts as reasoning when its provider’s model list says so, when another provider that sells the same model says so (a vendor’s own list often does not), or when one of its answers through this Prism carried reasoning text or reasoning tokens. Only a list that says the model does not reason, with no such answer seen, keeps it at the shorter wait.

A provider counts as self-hosted when its address is loopback, a private network, 100.64.0.0/10 or .local, or when self_hosted = true is set. Change the values in [runtime_policy]:

[runtime_policy]
stream_open_timeout_remote_ms = 8000
stream_open_timeout_remote_reasoning_ms = 60000
stream_open_timeout_local_ms = 90000 # self-hosted/local providers
upstream_request_timeout_remote_ms = 120000
upstream_request_timeout_remote_reasoning_ms = 600000
upstream_request_timeout_local_ms = 600000
stream_idle_timeout_remote_ms = 120000 # 0 disables
stream_idle_timeout_local_ms = 600000 # 0 disables

Models that think for a long time before the first token can trip a client’s own stream timeout. /v1/models gives each chat model a prism.ttfb entry: class: "thinking" means its 90th-percentile time to first byte through this Prism is 8 seconds or more. To keep a client connection alive during that silence on a Chat Completions stream sent straight to one model, set [server] stream_open_keepalive_ms (for example 5000): after the provider answers HTTP 200, Prism sends SSE comment lines until the first byte arrives. Off by default. It does not apply to Responses streams or to streams Prism buffers to check the answer before passing it on (default routing of auto streams).