Error reference

Every error the router can return, grouped by status code and listed by code. Each
entry shows the body you receive. Messages in 'quotes' are filled in from your
request, and request_id is different on every response.
Errors overview explains the body format, retries, and the order
checks run in.

Branch on status and code, not on message text

The status code and code are the contract and stay stable. Messages are meant for
people and can change. Messages forwarded from a provider are not part of the Quantized
contract at all.

Status code Entry
400 invalid_request Request fails validation
400 invalid_metadata_header Invalid X-Quantized-Metadata header
400 context_length_exceeded Prompt too long for the model
400 no_provider_available No provider available
401 missing_api_key Missing API key
401 invalid_api_key Invalid API key
401 api_key_expired Expired API key or JWT
401 license_inactive Inactive license
402 budget_exhausted License out of budget
403 policy_denied Denied by the license policy
403 content_policy_violation Blocked by a guardrail
404 model_not_found Model not found
404 endpoint_not_found Endpoint not found
405 method_not_allowed Method not allowed
413 request_too_large Request too large
429 rate_limit_exceeded Rate limited by the provider
500 internal_error Internal error
502 provider_error Provider error
503 policy_unavailable Policy unavailable
503 provider_misconfigured Provider misconfigured
504 upstream_timeout Provider timed out

400 Bad Request

All 400 errors have type: "invalid_request_error". Fix the request before sending it
again.

invalid_request

The request body or a header fails validation, or the provider rejected the request.
param names the offending field when there is one.

Request body fails validation

{
  "error": {
    "message": "Invalid value for 'temperature': Input should be less than or equal to 2",
    "type": "invalid_request_error",
    "param": "temperature",
    "code": "invalid_request",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The JSON body is checked against the endpoint’s schema before anything else runs. Only
the first problem is reported. param is its path in the body, with list indexes as
numbers (messages.0.role), and the message reads Invalid value for '<param>': <reason>.
The reasons you will usually see:

Problem param message
Missing field model Invalid value for 'model': Field required
Unknown field top_k Invalid value for 'top_k': Extra inputs are not permitted
Value not allowed messages.0.role Invalid value for 'messages.0.role': Input should be 'user', 'assistant', 'system' or 'tool'
Out of range temperature Invalid value for 'temperature': Input should be less than or equal to 2
Empty string query Invalid value for 'query': String should have at least 1 character
Body isn’t valid JSON null Request body is not valid JSON
Cross-field rule null reasoning and reasoning_effort are mutually exclusive
Unrecognized Bedrock model family model Invalid value for 'model': Unsupported model: expected an amazon.titan-* or cohere.* model id

Every request body is strict: a field that isn’t documented for the endpoint is rejected,
not ignored. This catches typos and parameters from other APIs. A rule that spans several
fields has no single param (null), and the message states the rule. On
/v1/aws-bedrock/embeddings the body shape is chosen by the model prefix
(amazon.titan- or cohere.), so any other prefix is rejected with param: "model".

Validation runs before the check for a missing Authorization header, so a request with
no key and an invalid body gets this 400, not a 401.

Endpoints: every endpoint with a request body.

Malformed X-Quantized-Provider header

{
  "error": {
    "message": "Malformed X-Quantized-Provider header: 'a/b/c'",
    "type": "invalid_request_error",
    "param": "X-Quantized-Provider",
    "code": "invalid_request",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The header must be a provider slug (openrouter) or <provider>/<connection>. An empty
part, or more than one /, is rejected.

Endpoints: all authenticated endpoints, including GET /v1/models and
GET /v1/license.

Unsupported reasoning effort

{
  "error": {
    "message": "Model does not support reasoning effort 'xhigh'",
    "type": "invalid_request_error",
    "param": "reasoning.effort",
    "code": "invalid_request",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The model has a fixed set of reasoning levels on the selected provider, and the effort
you asked for isn’t one of them. Use a lower effort, or "none" to disable reasoning.

Endpoints: /v1/chat/completions, /v1/responses.

previous_response_id not supported

{
  "error": {
    "message": "previous_response_id is not supported by this provider; send the full conversation in `input`.",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_request",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The request was served by a stateless provider (CheaperInference). Send the whole
conversation in input instead of chaining with previous_response_id.

Endpoints: /v1/responses.

Request rejected by the provider

{
  "error": {
    "message": "The provided model identifier is invalid.",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_request",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The provider rejected the request with a 400, 413, or 422, and the router forwards
its message. The wording depends on the provider. A model id the catalog can’t resolve is
the most common cause: see Who validates the model.
A rejection for exceeding the context window is reported as
context_length_exceeded instead.

Endpoints: every endpoint that calls a provider.

invalid_metadata_header

{
  "error": {
    "message": "X-Quantized-Metadata value for 'course' must be a scalar; nested objects/arrays are not allowed",
    "type": "invalid_request_error",
    "param": "X-Quantized-Metadata",
    "code": "invalid_metadata_header",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The header must be a JSON object whose values are all scalars (string, number, boolean,
or null). There are three messages:

Cause message
The value is not valid JSON X-Quantized-Metadata must be a valid JSON object
The value is valid JSON but not an object (for example [1]) X-Quantized-Metadata must be a JSON object
A value is an object or array X-Quantized-Metadata value for 'course' must be a scalar; nested objects/arrays are not allowed

Endpoints: all authenticated endpoints.

context_length_exceeded

{
  "error": {
    "message": "The request exceeds the model's context length. Shorten the messages or lower max_tokens.",
    "type": "invalid_request_error",
    "param": "messages",
    "code": "context_length_exceeded",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The provider refused the request because the prompt, or the prompt plus max_tokens,
doesn’t fit the model’s context window. Each provider says so in its own words; the
router recognises them and always answers with this code and message. Shorten the
conversation, lower max_tokens, or pick a model with a larger context window
(context_limits in GET /v1/models).

param names the field to shorten on that endpoint: messages on chat completions,
input on responses and embeddings, contents on Gemini embeddings and prompt on
image generation.

Endpoints: every endpoint that calls an LLM or embedding provider.

no_provider_available

{
  "error": {
    "message": "No provider available for endpoint 'chat_completions' under the current pins",
    "type": "invalid_request_error",
    "param": null,
    "code": "no_provider_available",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

No provider your license can reach serves this endpoint. With an X-Quantized-Provider
pin, the message ends in under the current pins. Common causes:

  • you pinned a provider that doesn’t serve the endpoint (for example consensus on
    /v1/fetch) or that doesn’t exist;
  • you pinned a provider your license type doesn’t allow; the header can only narrow the
    providers your license allows, never widen them;
  • type: "academic" on /v1/web-search when your license can’t reach Consensus.

Without a pin, the message has no suffix (No provider available for endpoint 'image_generation'). That means no provider is configured for the endpoint on your
license. Contact your institution.

The endpoint name in the message is an internal name: chat_completions, responses,
embeddings, gemini_embeddings, bedrock_embeddings, image_generation,
web_search, or web_fetch.

Endpoints: every endpoint that calls a provider.

401 Unauthorized

All 401 errors have type: "invalid_request_error". See
Authentication.

missing_api_key

{
  "error": {
    "message": "Missing API key. Send it as a Bearer token in the Authorization header.",
    "type": "invalid_request_error",
    "param": null,
    "code": "missing_api_key",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

No Authorization header was sent. If the body is also invalid, you get the
400 invalid_request first.

invalid_api_key

{
  "error": {
    "message": "Invalid API key",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_api_key",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The key or JWT doesn’t exist, doesn’t verify, or has been deactivated.

When the header doesn’t use the Bearer scheme, the code is the same and the message
says so:

{
  "error": {
    "message": "Authorization header must use the Bearer scheme",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_api_key",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The header must be Bearer followed by a space and your key, as in
Authorization: Bearer sk-quantized-.... The scheme is case-sensitive.

api_key_expired

{
  "error": {
    "message": "API key has expired",
    "type": "invalid_request_error",
    "param": null,
    "code": "api_key_expired",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The API key has passed its exp, or the JWT’s exp claim is in the past. Get a new key,
or sign a new JWT.

license_inactive

{
  "error": {
    "message": "License is not active",
    "type": "invalid_request_error",
    "param": null,
    "code": "license_inactive",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The key is valid, but its license or license type has been deactivated. Contact your
institution.

402 Payment Required

budget_exhausted

{
  "error": {
    "message": "Your license is out of budget",
    "type": "insufficient_quota",
    "param": null,
    "code": "budget_exhausted",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
    "metadata": {
      "unit": "micro_credit",
      "dimension": "day",
      "used": 1000250,
      "limit": 1000000,
      "adjustment": 0,
      "remaining": -250,
      "window_start_at": "2026-11-05T00:00:00+00:00"
    }
  }
}

No wallet on your license has budget left in the current period or lifetime limit. The
check runs before the request reaches a provider, so you are not charged.

metadata is the limit that blocked the request, in the same format as budget in
GET /v1/license, plus its unit and its name in dimension
(lifetime, hour, day, week, or calendar_month). window_start_at is null for
lifetime. When your license allows extra usage, metadata also carries extra_limit
and total_remaining. A period limit resets when its next window starts; a lifetime
limit only changes when your institution raises it. See
Insufficient balance.

Endpoints: every endpoint that calls a provider (all POST endpoints).

403 Forbidden

All 403 errors have type: "invalid_request_error". Retrying the same request
returns the same 403.

policy_denied

{
  "error": {
    "message": "'temperature' must be between 0 and 1",
    "type": "invalid_request_error",
    "param": "temperature",
    "code": "policy_denied",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

Your license type’s policy constrains a request field, and your value is outside what it
allows. param names the field. max_tokens also covers max_completion_tokens, and
reasoning_effort also covers reasoning.effort. The message depends on the kind of
rule:

Rule Message
Field not allowed parameter 'logprobs' is not permitted for this license
Fixed value 'model' must be 'openai/gpt-4.1-mini'
Allowed values 'model' must be one of: ['openai/gpt-4.1-mini', 'openai/gpt-4.1-nano']
Range 'temperature' must be between 0 and 1, 'max_tokens' must be <= 1000, 'n' must be >= 1
Excluded value 'model' value 'openai/o3' is not permitted for this license
Maximum length 'user' exceeds maximum length of 64
Maximum items 'tools' exceeds maximum item count of 4
Pattern 'model' value 'x-ai/grok-4' does not match any allowed pattern

When the policy doesn’t enable the endpoint at all, param is null:

{
  "error": {
    "message": "service 'embeddings' is not enabled for this license",
    "type": "invalid_request_error",
    "param": null,
    "code": "policy_denied",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The service names are chat_completions, responses, embeddings,
gemini_embeddings, bedrock_embeddings, image_generation, web_search, and
fetch.

Change the value, or ask your institution to change the policy.

Endpoints: every endpoint that calls a provider.

content_policy_violation

{
  "error": {
    "message": "Request blocked by guardrail",
    "type": "invalid_request_error",
    "param": null,
    "code": "content_policy_violation",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

A guardrail configured by your institution blocked the request. An input guardrail runs
before the provider call, so you are not charged. An output guardrail runs on the
provider’s response, so the call is charged. Streamed responses are never blocked by
output guardrails, because the response has already been sent.

Endpoints: every endpoint that calls a provider.

404 Not Found

All 404 errors have type: "invalid_request_error".

model_not_found

{
  "error": {
    "message": "No available provider for model 'openai/gpt-4.1-nano' supports audio input",
    "type": "invalid_request_error",
    "param": "model",
    "code": "model_not_found",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The model can’t serve the request on this endpoint. Your chat request contains an
image_url, input_audio, or video_url part that no provider serving the model
accepts. The router skips providers that can’t serve the request and only fails when
every reachable one refuses. On /v1/images/generations the same check applies to
output (... supports image output), for example an LLM or embedding model id. Pick a
model whose input_modality / output_modality in GET /v1/models
includes what you need.

The same code is returned when the provider answers 404 for the model, with the
provider’s message:

{
  "error": {
    "message": "The model `nonexistent-model` does not exist or you do not have access to it.",
    "type": "invalid_request_error",
    "param": "model",
    "code": "model_not_found",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

A model id the catalog doesn’t know is not rejected by the router: it is forwarded to a
provider, which decides. The wording varies, and an unknown model isn’t always a 404.
See Who validates the model.

Endpoints: every endpoint that calls a provider.

endpoint_not_found

{
  "error": {
    "message": "Endpoint not found",
    "type": "invalid_request_error",
    "param": null,
    "code": "endpoint_not_found",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

Reserved for a path the router doesn’t serve. Today a path the router doesn’t know is
passed on to the Quantized management API, which answers it with its own response, so
you are unlikely to see this body. Check the path against the API reference.

405 Method Not Allowed

method_not_allowed

{
  "error": {
    "message": "Method not allowed",
    "type": "invalid_request_error",
    "param": null,
    "code": "method_not_allowed",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The path exists but not with this method, for example GET /v1/chat/completions. The
allow header lists the methods the endpoint accepts. Provider-backed endpoints are
POST; /v1/models, /v1/license, and /v1/health are GET.

413 Content Too Large

request_too_large

{
  "error": {
    "message": "Request body is too large",
    "type": "invalid_request_error",
    "param": null,
    "code": "request_too_large",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

Reserved for a request body over the router’s size limit. A provider that rejects a
request as too large returns 400 invalid_request
or 400 context_length_exceeded instead.

429 Too Many Requests

rate_limit_exceeded

{
  "error": {
    "message": "Rate limit exceeded. Retry after a short wait.",
    "type": "requests",
    "param": null,
    "code": "rate_limit_exceeded",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The provider rate-limited the request. The router has no rate limit of its own. When the
provider said how long to wait, the response carries a retry-after header in seconds.
Retry after that delay, or with exponential backoff when there is none. The request is
not charged.

Endpoints: every endpoint that calls a provider.

500 Internal Server Error

internal_error

{
  "error": {
    "message": "An error occurred",
    "type": "server_error",
    "param": null,
    "code": "internal_error",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

An unexpected failure on our side, or a provider answer the router doesn’t map. Sent with
x-should-retry: false. Report it with the request_id.

When your license’s budget configuration can’t be applied (for example an unknown
strategy or period, or a change of budget unit), the message is
Budget configuration error. Retrying won’t help. Contact your institution.

502 Bad Gateway

provider_error

{
  "error": {
    "message": "The upstream provider returned an error",
    "type": "server_error",
    "param": null,
    "code": "provider_error",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The provider answered with a 5xx or with a body that isn’t valid JSON, reported an
error mid-stream, or the connection dropped.
The message is always the same: no provider details are included. Retry with
exponential backoff. The request is not charged.

Endpoints: every endpoint that calls a provider.

503 Service Unavailable

Both 503 errors are sent with x-should-retry: false: retrying won’t fix them. They
use the same message, so branch on code.

policy_unavailable

{
  "error": {
    "message": "Service temporarily unavailable",
    "type": "server_error",
    "param": null,
    "code": "policy_unavailable",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

Your license type’s policy can’t be evaluated (for example it was saved in a format the
router doesn’t support). The request is refused rather than run without its policy. If
it persists on every request, contact your institution.

Endpoints: every endpoint that calls a provider.

provider_misconfigured

{
  "error": {
    "message": "Service temporarily unavailable",
    "type": "server_error",
    "param": null,
    "code": "provider_misconfigured",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

Our credentials for the provider are missing or were rejected: the provider connection
has no usable credentials, the provider answered 401, 402 or 403, or our prepaid
credit, quota or plan limit with the provider has run out (including a 429 the
provider marks insufficient_quota). This is a configuration problem on the Quantized or
institution side, not in your request. Contact your administrator with the request_id,
or pin another provider with X-Quantized-Provider.

Endpoints: every endpoint that calls a provider.

Health check failing

{
  "status": "error"
}

Only from GET /v1/health, when the router can’t reach its database. This is the one
response that doesn’t use the error body.

504 Gateway Timeout

upstream_timeout

{
  "error": {
    "message": "The upstream provider timed out",
    "type": "server_error",
    "param": null,
    "code": "upstream_timeout",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

The provider didn’t answer in time, or answered 408. Retry with exponential backoff. The request is not
charged.

Endpoints: every endpoint that calls a provider.

Errors during a stream

With "stream": true, every check up to the provider call happens before the stream
opens, so those errors come back as the normal JSON responses above. A provider failure
before the first chunk does too: the router waits up to 20 seconds for the first chunk,
and a failure in that time gets the same status and body as without stream. Once the
stream has started, the status is already 200, and a failure is reported inside the
stream instead.

On /v1/chat/completions, the error line carries the same body as a JSON error, and is
followed by the usual terminator:

data: {"error": {"message": "The upstream provider returned an error", "type": "server_error", "param": null, "code": "provider_error", "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"}}

data: [DONE]

On /v1/responses, OpenAI’s error event ends the stream, with no [DONE]. code is
the error code. The event has no request_id; read it from the x-request-id header:

event: error
data: {"type": "error", "code": "provider_error", "message": "The upstream provider returned an error", "param": null}

Treat either as a failed request: discard the partial output, or keep it and show the
response as incomplete. See Streaming.