Changelog
One error format (November 2026)
Changed
- Breaking: every error uses one OpenAI-compatible body.
{"error": {"message", "type", "param", "code", "request_id"}}, with all five fields always present (paramisnullwhen it doesn’t apply) andrequest_idequal to thex-request-idheader.metadatais added only when it has content. Branch on the status andcode, which are stable; messages may change. See Response format and the Error reference for every code. - Breaking: validation errors are
400 invalid_request, not422. FastAPI’s{"detail": [...]}body is gone.paramis the path of the failing field (messages.0.role), down to the deepest field that failed, and the message names it. - Breaking: running out of budget is
402 budget_exhausted, not400.typeisinsufficient_quota, andmetadatacarries the limit that blocked the request, in theGET /v1/licenseformat. See Insufficient balance. - Breaking: a guardrail block is
403 content_policy_violation, not400. - Breaking: provider failures are no longer one
503. A provider5xx, a body that isn’t JSON, an error mid-stream, or a dropped connection is502 provider_error; a timeout or a provider408is504 upstream_timeout; a provider rate limit is429 rate_limit_exceeded, withretry-afterwhen the provider sent one; our credentials being missing or rejected, or our credit, quota or plan limit with the provider running out (402,429 insufficient_quota), is503 provider_misconfigured. A policy that can’t be evaluated is503 policy_unavailable. - Breaking: a modality no provider accepts is
404 model_not_found, not400.paramismodel. - Breaking: the chat completions stream error carries a string
code. The error line is now the same body as a JSON error ("code": "provider_error");codeused to be the numeric status. - Breaking: the Responses stream
errorevent carries the error code incode. It used to carry the error type (server_error). A provider’s ownerrororresponse.failedevent is no longer passed through: the stream ends with the router’s event instead. - Credential errors have their own codes.
401ismissing_api_key,invalid_api_key,api_key_expired, orlicense_inactive, instead of one message for every failure. - A provider’s context-window refusal is
400 context_length_exceeded. Each provider’s wording is recognised, and the message is ours.paramis the field to shorten:messageson chat completions,inputon responses and embeddings. 405and unexpected500errors use the same body.405 method_not_allowedkeeps theallowheader; a500 internal_erroris JSON instead of plain text, and carries the CORS headers so a browser can read it.
Added
x-should-retry: falseon500 internal_error,503 policy_unavailable, and503 provider_misconfigured, so the OpenAI and Anthropic SDKs don’t retry errors a retry won’t fix. See Retries.
Notes
- Provider details never reach a
5xxbody. A provider’s own message is kept only on400 invalid_requestand404 model_not_found. - Unchanged: an unknown model id is still forwarded to a provider, which decides;
GET /v1/healthstill answers{"status": "error"}when unhealthy; and a path the router doesn’t serve is still passed to the management API.
Request IDs (November 2026)
Added
x-request-idon every response, streams and errors included. Include it when you contact support. OpenAI SDKs expose it as_request_idon results andrequest_idon errors, and browsers can read it (it is inAccess-Control-Expose-Headers). See Request IDs.
Changed
- An inbound
traceparentis no longer continued. Each request starts its own trace, so its ID is unique to that request. Previously a client that propagated W3C trace context set the router’s trace ID.
Prices on /v1/models (October 2026)
Changed
- Breaking:
costis removed fromGET /v1/models. It was our internal provider cost. Each model now hasprice, what your API key is charged, andreference_price, the market price, shown for display only. Both use the same rate keyscosthad and can benull. See Models.
CheaperInference and model search (October 2026)
Added
- CheaperInference as a provider (
cheaperinference) onPOST /v1/chat/completionsandPOST /v1/responses. It serves catalog models below list price. Its Responses route is stateless, soprevious_response_idreturns400. See Providers. searchonGET /v1/models.?search=filters the list by a case-insensitive substring of the model’s name, id, or author. Omitted or blank returns the full list.
Changed
- CORS preflights allow the
User-Agentheader. Browsers that ask for it (Firefox does, with SDKs such as the Vercel AI SDK) no longer fail the preflight.
Documentation corrections
- Running out of budget is documented as
400(Your license is out of budget), not402. The API has not changed; the docs were wrong. - Request validation errors are documented as
422with FastAPI’s{"detail": [...]}body, not400. - Errors have their own section: an overview of formats, check order, and retries, and an error reference listing every error the router returns with a sample body. The old
/concepts/errorspage redirects to the overview.
Browser access and auth hardening (September 2026)
Added
- CORS support. The API answers
OPTIONSpreflights and sendsAccess-Control-*headers, so you can call it from a web page. Allowed request headers areAuthorization,Content-Type,X-Quantized-ProviderandX-Quantized-Metadata; allowed methods areGET,POSTandOPTIONS. - Extra usage in
GET /v1/license. When your license type allows usage beyond its limits,budget.lifetimeand each entry inbudget.periodsalso carryextra_limitandtotal_remaining.
Changed
- Inactive licenses and license types are rejected. Requests authenticated with a key or JWT whose license or license type is inactive now return
401 Invalid API key. Previously only the key’s own status and expiry were checked.
Fixed
- Provider-native model names route like their canonical id. A provider’s own name for a model (e.g.
gemma-4-31b-it), sent to an endpoint that provider does not serve, is now routed among the model’s other providers with their own alias, price and modality check, instead of going to an arbitrary provider.
Page text on /v1/web-search (September 2026)
Added
include_textandmax_charactersonPOST /v1/web-search.include_text: truereturns page text on each result;max_characters(default 4000, 100–100000) caps it. Neither costs extra. See Getting page content.textandscoreon each result. Tavily now returns its relevance snippet and score by default, andacademicresults carry the paper’s abstract intext. Exa returns text only withinclude_text.
Notes
- All fields are additive. Existing calls keep the fields they had; the new ones are
nullwhere a provider has nothing to put in them.
Academic search on /v1/web-search (August 2026)
Added
typeonPOST /v1/web-search—"general"(the default) or"academic".academicsearches Consensus, which indexes peer-reviewed papers, without you naming a provider. Omitting the field keeps the previous behaviour exactly.- Consensus as a provider (
consensus). Web search only; it has no content-fetch capability, so pinning it onPOST /v1/fetchreturns a400.
Notes
- Nothing changes for existing calls.
typedefaults togeneral, and Consensus is never chosen by default, so a plain{"query": ...}search will not start returning papers. - An explicit
X-Quantized-Provideralways wins, in both directions:type: "academic"withX-Quantized-Provider: exasearches the general web, andX-Quantized-Provider: consensusreaches Consensus with notypeat all. typenever widens what your license can reach. If your license type is pinned to providers that exclude Consensus,type: "academic"returns a400rather than falling back to a general provider.- The response shape is unchanged, so the same client code reads both kinds of result. On
academic,urlis the paper’sconsensus.apppage,idis its DOI, andusage.search_timeis alwaysnull. Journal, citation count and abstract are not exposed today. - Consensus serves about one search at a time. Parallel academic searches return
503; sequential ones succeed. Each takes several seconds. Failed searches are not billed. - A
typeother thangeneraloracademicis a422, raised before a provider is chosen.
Providers validate models (August 2026)
Changed
- An unknown model id is now the provider’s call, not ours. The router no longer keeps a catalog gate in front of the providers. A model id it cannot resolve is forwarded as sent, and the status and message come back from OpenAI, Google or AWS. The same mistake therefore gets different answers per provider: AWS Bedrock returns
400 The provided model identifier is invalid., Google returns404, OpenRouter and OpenAI return404with their own wordings. On an endpoint with several eligible providers it is not stable across repeated calls either. Do not branch on message text, and do not assume an unknown model is always a404. See Who validates the model.POST /v1/aws-bedrock/embeddingspreviously answered an unseeded Bedrock model id with404. It is now a400carrying Bedrock’s message.POST /v1/images/generationspreviously answered an unknown id with404, and a retired model with400 No active providers available. Neither is produced any more.
- The modality error names providers, not the model.
"Model 'X' does not support audio input"is now"No available provider for model 'X' supports audio input". A model’s hosts can differ on what they accept, so the router skips a provider that cannot serve the request and only fails when every reachable one refuses.
Added
- Per-provider catalog attributes. Cost, reasoning dialect, context limits, capabilities and modality can now be stated per provider rather than once per model, so a model hosted in two places can carry each host’s real numbers.
GET /v1/modelsgainedcontext_limits,knowledge_cutoff,is_open_weightsandlogo_url. cost.prompt_batch— the discounted input rate for a provider’s batch endpoint, used by Gemini embeddings at half the single-content rate.
Fixed
max_tokensworks on OpenAI reasoning models again. The router sendsmax_completion_tokenson the OpenAI Direct route, so clients no longer have to special-case theo-seriesandgpt-5families.
Notes
costis not a fixed schema. Read the keys present rather than assuming any of them, and bill againstusage.credits_usedon the response. An emptycostmeans the catalog carries no rate, not that the call is free.GET /v1/modelsdoes not say which provider serves a model, so it cannot be used to check whether anX-Quantized-Providerpin will work.- Image generation is served by OpenAI and Google Gemini. AWS Bedrock image models are not currently routable, and DALL-E 2 and DALL-E 3 were retired by OpenAI in 2026.
Connection pinning (August 2026)
Added
X-Quantized-Provider: <provider>/<connection>pins one specific connection of a provider. A malformed value returns400.
Changed
- The provider pin never widens your license.
X-Quantized-Providernarrows the providers your license type allows; pinning one outside them returns400. GET /v1/modelsrespects your license type’s provider pins. It lists only the models reachable through the providers your license type is restricted to.
Default embeddings provider is now OpenRouter (June 2026)
Changed
POST /v1/embeddingsdefaults to OpenRouter instead of OpenAI Direct. Default provider routing is now driven by data (theis_defaultflag per provider), not by endpoint-specific logic. OpenAI embeddings remains available asX-Quantized-Provider: openai(cheaper, native). Chat completions, responses, web search, and image generation defaults are unchanged.
Native OpenAI Responses API (June 2026)
Added
- OpenAI Direct on
POST /v1/responses— setX-Quantized-Provider: openaito drive OpenAI’s first-party/v1/responsesdirectly. Same seven first-party models, alias rewriting, and local-rate billing as the chat route.reasoningis passed as an object ({"effort": "..."}) unchanged — OpenAI’s Responses API takes the object directly, so there’s noreasoning_efforttranslation here. Usemax_output_tokensfor reasoning models.frequency_penalty/presence_penaltyare dropped on the OpenAI route (OpenAI’s Responses endpoint rejects them); they remain available via OpenRouter.- Streaming forwards OpenAI’s typed
event: <type>/data: {...}events and ends onresponse.completed(no[DONE]sentinel).
Native OpenAI chat completions (June 2026)
Added
- OpenAI Direct on
POST /v1/chat/completions— setX-Quantized-Provider: openaito call OpenAI’s first-party API directly instead of through OpenRouter.- Models in scope:
openai/gpt-4o,openai/gpt-4o-mini,openai/gpt-4.1-mini,openai/gpt-4.1-nano,openai/o4-mini,openai/gpt-5,openai/gpt-5.1. Open-weightgpt-ossmodels stay OpenRouter-only. - The catalog id is rewritten to OpenAI’s bare model name upstream and the public id is restored on the response.
- Billing: OpenAI returns no per-call cost, so
credits_usedis computed from the model’s catalog per-token rates (prompt/completion, plus cached input when reported). reasoning/reasoning_effortis translated to OpenAI’s top-levelreasoning_effort; the OpenRouter-onlyrepetition_penaltyis dropped on this route.
- Models in scope:
Notes
- OpenRouter remains the default for chat completions — the OpenAI route is opt-in via the header.
- OpenAI’s o-series models (
o4-mini,gpt-5family for reasoning) requiremax_completion_tokens;max_tokensis rejected upstream.
Embeddings endpoint (May 2026)
Added
POST /v1/embeddings— OpenAI-compatible embeddings endpoint.- Default provider: OpenAI Direct (new provider, slug
openai). - Alternative: OpenRouter via
X-Quantized-Provider: openrouter. OpenRouter passthrough uses the OpenAI rate table for billing because its response does not include cost data. - Supported models:
text-embedding-3-small,text-embedding-3-large,text-embedding-ada-002. - Accepted fields:
model,input(string or list of strings),dimensions,encoding_format(only"float"),user. - Strict validation (
extra="forbid") — unknown fields return422.
- Default provider: OpenAI Direct (new provider, slug
Out of scope (deferred)
- Native Bedrock embeddings (
/v1/aws-bedrock/embeddings) — Titan + Cohere — landing in a follow-up PR. - Token-array input (
list[int]/list[list[int]]). - Multimodal
ContentPart[]input. encoding_format: "base64".output_dtypequantized embeddings.input_type(relevant once Cohere/Gemini providers are wired in).
Multimodal chat completions (April 2026)
Added
- Chat Completions — new content part types:
input_audio— base64 audio withformat(wav/mp3/aiff/aac/ogg/flac/m4a/pcm16/pcm24)video_url— HTTPS URL ordata:video/...;base64,...data URIfile— PDF viafile_data(HTTPS ordata:application/pdf;base64,...) with optionalfilename; alternativelyfile_id
- Model modality validation: chat-completion requests are now validated against the target model’s
input_modalitybefore dispatch. A mismatch (e.g. audio to a text-only model) returns400with a clear message instead of an opaque upstream error.fileparts are exempt — they are handled by OpenRouter’s universal PDF parser across all models.
Provider support
OpenRouter: all four new modalities. Anthropic: text + image only (existing behavior unchanged).
v1.1 — API Lockdown (April 2026)
Strict parameter validation
The API now enforces strict validation on all request parameters. Unknown or unsupported fields are rejected with 422 Unprocessable Entity.
Chat Completions — removed parameters:
top_k, modalities, audio, web_search_options, metadata
Chat Completions — promoted parameters (now supported):
logprobs, top_logprobs, logit_bias, repetition_penalty, user, stream_options
Chat Completions — promoted message fields (now supported):
refusal, reasoning, reasoning_details (assistant role only)
Chat Completions — accepted message fields (not forwarded to providers):
annotations, audio, function_call (accepted from OpenAI SDK responses to avoid 422 in multi-turn conversations)
Chat Completions — removed message fields:
images (in request messages)
Responses API — removed parameters:
store, text, truncation, include, service_tier, background, top_k, metadata, user
Chat Completions — removed response fields:
system_fingerprint, choices[].message.annotations, choices[].message.audio, choices[].message.images
Chat Completions — promoted response fields (now supported):
choices[].logprobs, choices[].message.reasoning, choices[].message.reasoning_details
Strict content part validation
Message content arrays now only accept text and image_url content parts. Other types like input_audio, video_url, or file are rejected.
Strict tool definition validation
Chat completions tools field now validates tool structure: each tool must follow the OpenAI format (type: "function", function: {name, description, parameters}) or Anthropic format (name, input_schema).
Parameter range validation
All generation parameters are validated at the API boundary with clear error messages:
max_tokens/max_completion_tokens/max_output_tokens: minimum 1temperature: 0–2top_p: 0–1frequency_penalty/presence_penalty: −2 to 2
Out-of-range values return 422 with a message like: "Input should be greater than or equal to 16".
Type improvements
response_formatvalidates structure:{"type": "json_object"}or{"type": "json_schema", ...}reasoningvalidates effort:{"effort": "none" | "low" | "medium" | "high"}with optionalexcludebooleantool_choicevalidates values:"auto","required","none", or{"type": "function", "function": {"name": "..."}}urlsin/v1/fetchnow requireslist[string]
Error message sanitization
Provider error messages are now sanitized before reaching the user. URLs, email addresses, and provider names are stripped from all client-facing error messages. Internal error details are preserved in the database for debugging.
v1 — Initial Release
Endpoints
POST /v1/chat/completions— OpenAI-compatible chat completionsPOST /v1/responses— Stateful Responses APIPOST /v1/web-search— Web search with structured resultsPOST /v1/fetch— Extract text content from URLsGET /v1/models— List available models and pricingGET /v1/license— Check license info and credit balance
Providers
- OpenRouter — LLMs (default for chat completions, responses, models)
- Anthropic — Claude models directly
- Exa — Web search and content fetch (default)
- Tavily — Web search and content fetch (alternative)
Features
- OpenAI SDK compatibility
- SSE streaming for chat completions and responses
- Unified credit billing across all providers
- JWT authentication with auto-provisioning
- Per-institution configuration
- Provider routing via
X-Quantized-Providerheader