What is OpenRouter? How its routing, pricing, and data controls work

Explainer · Gateways

OpenRouter is a hosted API that puts hundreds of language models behind one OpenAI-compatible endpoint, one API key, and one prepaid credit balance. You choose a model by its ID, and OpenRouter chooses which provider runs the request, retries elsewhere when a provider fails, and deducts the cost from your credits. This explainer covers what OpenRouter is and how its routing, fallbacks, pricing, bring-your-own-key option, and data controls work, from OpenRouter's own documentation as of November 2026. It belongs to the AI gateways and LLM routing hub.

What is OpenRouter?#

OpenRouter is a hosted model aggregator that gives developers one API, one account, and one bill for hundreds of models, and picks a provider to serve each request. Its pricing page lists 600+ models from 80+ providers on paid plans as of November 2026, and 25+ free models from 4 providers on the free plan.

Most of OpenRouter's behavior follows from the difference between a model and a provider. A model, such as meta-llama/llama-3.3-70b-instruct, is what you ask for; a provider is a company that runs it on its own hardware. An open-weights model is often served by several inference providers at different prices, speeds, and quantization levels, and OpenRouter treats each deployment as an endpoint it can route to.

In gateway terms, OpenRouter supplies the unified API, provider routing, and failover parts of an AI gateway as a managed service, so every prompt passes through its servers. The explainer on what an AI gateway is covers the self-hosted side of that comparison.

How an OpenRouter request works#

An OpenRouter request makes one hop from your application to OpenRouter, one or more attempts at provider endpoints, and one deduction from your credit balance. Between those steps, OpenRouter checks the key's credits and limits, filters and ranks the endpoints that serve the requested model, sends the request to the top choice, and normalizes whatever comes back.

An app sends one request to OpenRouter, which checks the key, ranks three provider endpoints for the model, sends to the first, falls back to the second on error, and excludes the third. Your appOpenRouter key + model IDOpenRouterkey, credits, budgets, guardrailsfilter and rank endpointsnormalize response, deduct costProvider Aranked firstProvider Bnext on errorProvider Cover your max_priceone endpointfirst tryfallback
Figure 1: OpenRouter ranks every endpoint that serves the requested model, sends the request to the top one, and retries the next on a provider error.
  1. The application sends a request to https://openrouter.ai/api/v1 with an OpenRouter key and a model ID, or an ordered list of model IDs.
  2. OpenRouter checks the key's credit balance, any per-key credit cap, and the workspace's budgets and guardrails.
  3. It filters the model's endpoints by the request's constraints, such as data policy, required parameters, and price cap, and ranks the rest.
  4. It sends the request to one endpoint and, if that provider returns an error, retries another endpoint for the same model.
  5. It returns one response schema, with a model field naming the model that answered and a usage block with token counts.
  6. It deducts the cost. Under Zero Completion Insurance, a response that errors, or has no output tokens and no finish reason, is not billed for model tokens.

Passing the response id to GET /api/v1/generation returns token counts and cost after the request completes.

The OpenRouter API and model catalog#

The OpenRouter API is wire-compatible with OpenAI's REST API and SDKs, so switching usually means changing three settings: the base URL, the API key, and the model ID. OpenRouter serves the Responses API, Chat Completions, and an Anthropic Messages endpoint at /api/v1/messages, and it normalizes request and response schemas across models and providers.

import os
from openai import OpenAI
 
client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key=os.environ["OPENROUTER_API_KEY"],
)
resp = client.chat.completions.create(
    model="meta-llama/llama-3.3-70b-instruct",
    messages=[{"role": "user", "content": "Classify this ticket: refund request"}],
)
print(resp.model, resp.usage)

Model IDs take an author/slug form. The models API (GET /api/v1/models) returns each model's context_length, its context window in tokens, its pricing in USD per token, its supported_parameters, and an expiration_date set when an endpoint is scheduled for deprecation. A canonical_slug never changes, and aliases resolve to the current ID.

The catalog changes under a running application: a model whose price changes is served at the new rate, and a deprecated model returns a 404 error. Read prices from the models API at runtime, and give long-lived features a fallback model.

Model variants#

A suffix on a model ID changes how OpenRouter handles the request. The model variants page lists these as of November 2026:

Suffix What it does Status
:free Free-tier version of the model with its own endpoints and rate limits Active
:nitro Sorts providers by throughput and admits priority service tier endpoints Active
:floor Sorts providers by price and admits flex service tier endpoints Active
:exacto Sorts providers by quality signals tuned for tool-calling reliability Active
:batch Batch-priced version of the model, served by the Batch API Active
:thinking, :online, :extended Use the reasoning parameter and the openrouter:web_search server tool instead; no model offers :extended Deprecated

Suffixes can be combined, as in :free:nitro.

Letting OpenRouter pick the model#

Setting the model to openrouter/auto hands model choice to the Auto Router. A fast decision model rates the request, and the routing policy weighs that rating against live prices, cache status, and benchmark results to pick a model and reasoning effort. The router adds no fee, and an allowed_models list restricts it to approved models. A router that switches models also changes outputs, so pipelines with evaluation baselines usually pin a model; the guide to LLM routing covers that trade-off.

How OpenRouter routes between providers#

By default, OpenRouter sends each request to the provider endpoint expected to give a good response at the lowest real cost, measured from recent production traffic. Providers near the best share most traffic, picked at random by weight, and a provider with far more errors or 429s than its peers gets none until it recovers.

The provider routing docs list the inputs to that score:

  • Effective price, reflecting the provider's real cache hit rate and its mix of input and output tokens
  • Throughput, in output tokens per second
  • Time to first token
  • How often the provider returns 429 errors because it is out of capacity
  • How often requests fail because of the provider
  • Whether the provider's tool calls come back well formed

Follow-up requests in a conversation stay on the same provider while its prompt cache is warm. Default routing is bypassed when a request sets sort or order, uses :nitro or :floor, or runs on your own provider key.

The provider object#

A provider object in the request body overrides default routing for that request:

Field Default What it does
sort None "price", "throughput", or "latency"; tries providers in that order
order None Provider slugs to try first, such as ["anthropic", "openai"]
allow_fallbacks true false stops OpenRouter from using backup providers
only, ignore None Provider slugs to allow or skip
require_parameters false true uses only providers that support every parameter sent
data_collection "allow" "deny" skips providers that may store data
zdr None true restricts the request to Zero Data Retention endpoints
quantizations None Filters by precision, such as ["fp8", "bf16"]
max_price None Highest price accepted, per million prompt and completion tokens

This request asks for structured output only from endpoints that support it, retain no data, run at FP8 or BF16, and cost at most $0.50 and $1.50 per million prompt and completion tokens:

{
  "model": "qwen/qwen3-next-80b-a3b-instruct",
  "messages": [{ "role": "user", "content": "Return the invoice total as JSON." }],
  "response_format": { "type": "json_object" },
  "provider": {
    "require_parameters": true,
    "zdr": true,
    "quantizations": ["fp8", "bf16"],
    "max_price": { "prompt": 0.5, "completion": 1.5 }
  }
}

max_price is a hard filter: if no endpoint is under the cap, the request does not run. Performance preferences such as preferred_max_latency only make matching providers preferred.

Provider and model fallbacks on OpenRouter#

OpenRouter has two fallback layers. Provider fallback retries the same model at another provider and is on by default. Model fallback moves to a different model from a models list you supply, and by default any error can trigger it, including context-length validation errors, moderation flags, rate limits, and downtime.

With order set, OpenRouter tries the listed providers one at a time, then other providers unless allow_fallbacks is false. With fallbacks disabled and no order, only the top-ranked endpoint serves the request. Model fallback works down the models array in priority order and returns the last model's error if every model fails.

OpenRouter tries model A at two providers that both fail, falls back to model B, which answers, and bills the request at model B's price. Your appOpenRouterModel A hostsproviders 1 and 2Model B hostprovider 31models: [A, B]2model A, provider 13429 out of capacity4retry at provider 25503 error6fall back to model B7completion8model: B, billed at B
Figure 2: Provider fallback retries the same model at another host; model fallback moves down the models list once every host of the first model fails.

Billing follows the model that served the request. A :free model that falls back to a paid model is billed at the paid rate, so a request stays free only when every entry in models is a :free variant. Provider fallback cannot help when every host of a model is down or a prompt exceeds the model's context window; a second model from another lab covers both. The glossary entry on model failover compares how other gateways implement the pattern.

OpenRouter pricing: plans, fees, and credits#

OpenRouter bills inference at the providers' list prices with no markup and charges a fee when you buy credits: 5.5% on the Standard plan, with a $0.80 minimum, and 8% on the Business plan, as of November 2026. Its FAQ puts the fee on crypto payments at 5%. Each request then deducts its cost from the prepaid balance.

Plan Fee on credit purchases Models Rate limits Notable features
Free None 25+ free models from 4 providers 50 requests per day Community support
Standard 5.5% 600+ from 80+ providers Passed through from providers Budgets, data policy routing, email support
Business 8% 600+ from 80+ providers Passed through from providers EU and US in-region routing, Workload Identity Federation, up to 1,000 workspaces
Enterprise Discounts by contract 600+ from 80+ providers Higher allowances available SAML SSO, SCIM, contractual SLAs, invoicing

The fee scales with spend: on $10,000 of credit purchases a month, 5.5% is $550 and 8% is $800. Before a large top-up, note that OpenRouter reserves the right to expire unused credits one year after purchase, and unused credits can be refunded only within 24 hours of the transaction; platform fees and crypto payments are not refundable.

Each API key can carry its own credit cap, and workspace guardrails add budgets that reset daily, weekly, or monthly, plus model and provider allowlists. The lower limit wins. These controls cover part of what virtual keys do in a self-hosted gateway, scoped to OpenRouter traffic.

OpenRouter free models and rate limits#

OpenRouter's free models are :free variants capped at 20 requests per minute and 50 requests per day for accounts that have bought less than $10 of credits in total, and 1,000 requests per day once they have bought at least $10. Those caps make free models suitable for testing and prototypes, not for serving production traffic.

Paid models have no OpenRouter request quota beyond DDoS protection. According to OpenRouter's limits documentation, rate limits on paid models come from the upstream providers, fallback routing retries other providers when one returns a 429, and extra keys or accounts do not raise limits because capacity is governed globally. A negative credit balance can produce 402 errors even on free models, and GET /api/v1/key reports the remaining credit limit and the free-model daily counter.

OpenRouter BYOK: using your own provider keys#

Bring your own key (BYOK) lets you add your own provider API keys to OpenRouter, so the provider bills you for inference while OpenRouter still routes the requests. On Standard and Business, the first $25,000 of list-price inference each month carries no OpenRouter fee; above that, OpenRouter deducts 5% of the equivalent OpenRouter price from your credits.

The BYOK docs define a fixed order: prioritized keys first, then OpenRouter's shared endpoints, then fallback keys. The default matters for compliance. If every one of your keys hits a rate limit or fails, OpenRouter falls back to its shared capacity and spends your credits. Setting a prioritized key to never use shared capacity for any model on that provider keeps traffic on your own account.

When a request sets order, each named provider's BYOK key is tried before that provider's shared capacity. BYOK traffic follows the same Zero Data Retention rules as credit-funded traffic unless you declare ZDR on a key under your own provider agreement.

Is OpenRouter safe? Data handling and residency#

OpenRouter does not store prompts or completions by default; it stores request metadata such as token counts and latency. The larger variable is the provider. The default data_collection setting allows providers that store data non-transiently and may train on it, so teams sending customer data should deny those providers or require Zero Data Retention.

Two opt-in settings, both off by default, change OpenRouter's own storage, according to its data collection page. Private logging shows prompts and completions in your logs, and a separate setting lets OpenRouter use them to improve its product in exchange for a 1% discount on model usage.

Zero Data Retention (ZDR) routes only to endpoints with no routine storage of prompts or responses after processing. It can be enforced in privacy settings, in a guardrail, or per request with "zdr": true, and the request flag cannot remove an account-wide rule. The ZDR page adds these caveats:

  • Safety Retention endpoints, where data may be kept only to prevent abuse, stay eligible on self-serve accounts unless you choose "ZDR only".
  • Since October 18, 2026, Google has required Safety Retention for Google models on Vertex, so "ZDR only" excludes most Google models.
  • ZDR covers provider routing for inference, not plugins and server tools such as web search.
  • OpenRouter announced in-flight CSAM screening of all inference requests, ZDR traffic included, from October 27, 2026.

Workspace guardrails add content controls: regex-based prompt injection detection, redaction of sensitive information, and custom regex filters.

In-region routing, on Business and Enterprise, keeps prompt and completion processing in Europe through eu.openrouter.ai or in the US through us.openrouter.ai, and a request fails rather than leave the region. Account data, billing records, security logs, and abuse-monitoring metadata may still be processed in the US, and the Batch API runs only on the global endpoint.

OpenRouter vs direct API access#

OpenRouter suits teams that want many models behind one integration and accept a hosted service in the request path. Calling a provider directly suits teams that spend heavily with one or two labs, depend on provider-specific features that a normalized API may not expose, or cannot let a third party process prompts.

Consideration Through OpenRouter Direct to the provider
Integration One API, key, and bill for 600+ models One SDK, account, and invoice per lab
Inference price List price plus 5.5% or 8% on credit purchases, or the BYOK fee above $25,000 a month List price or a negotiated contract
Availability Automatic provider fallback, optional model fallback Your own retries and failover
Rate limits Passed through from providers; free models capped daily Your account's own tier
Data path Prompts pass through OpenRouter, then the provider Prompts go only to the provider

OpenRouter tends to fit when you compare or switch models often, call open-weights models that several hosts serve, want one prepaid balance with per-key caps, or prototype within the free-model caps. It tends to be the wrong fit when:

  • A security review rules out another company processing prompts in transit.
  • You need data residency on the Standard plan, since in-region routing starts at Business.
  • The credit fee at your volume costs more than the integration work it saves.
  • You need per-team keys and logs inside your own network. A self-hosted gateway covers that, and some, such as LiteLLM, can use OpenRouter as one upstream provider.

That covers what OpenRouter is and how it bills. For the wider category, the AI gateways directory lists hosted and self-hosted options by deployment model, and the comparison of LiteLLM alternatives puts OpenRouter next to gateways you run yourself.

Frequently asked questions

What is OpenRouter used for?

OpenRouter is used to reach many language models through one API without opening an account with each lab. Developers use it to compare and switch models by changing a model ID, to call open-weights models that several inference providers host with failover between them, and to prototype on free models. Apps can also use its OAuth PKCE flow so end users bring their own OpenRouter key and pay for their own inference.

Is OpenRouter free?

OpenRouter has a free plan with 25+ free models from 4 providers, but paid models cost money. The free :free variants are capped at 20 requests per minute and 50 requests per day, rising to 1,000 requests per day once an account has bought at least $10 of credits. If a free model falls back to a paid model, the request is billed at the paid model's rate.

Is OpenRouter cheaper than using the API directly?

Usually not for heavy use of one provider. OpenRouter charges each model at the provider's list price with no markup, but adds a fee on credit purchases: 5.5% on Standard with a $0.80 minimum, or 8% on Business, as of November 2026. Direct contracts avoid that fee. The fee buys one integration, automatic provider fallback, and price-aware routing across the hosts of open-weights models.

Is OpenRouter safe to use?

OpenRouter's own defaults are conservative, but its provider defaults are not. By default it stores request metadata such as token counts and latency, not prompts or completions. The default data_collection setting, however, allows providers that store data and may train on it. Setting data_collection to deny, or enforcing Zero Data Retention in privacy settings or per request, restricts routing to stricter endpoints.

Does OpenRouter work with the OpenAI SDK?

Yes. OpenRouter is wire-compatible with OpenAI's REST API and its official Python and TypeScript SDKs. Point the client's base URL at https://openrouter.ai/api/v1, pass an OpenRouter API key, and use OpenRouter model IDs such as openai/gpt-4o-mini. Tool calling works when the underlying model supports it, and OpenRouter-only fields such as provider or models go in the request body, through extra_body in the Python SDK.

What types of models does OpenRouter support?

OpenRouter's catalog is mostly text-generation models, which its models API returns by default, but it also lists image and video generation, text-to-speech, transcription, embedding, and rerank models. Passing the output_modalities parameter to GET /api/v1/models lists them. Many text models also accept images, PDFs, audio, or video as input, which each model's input_modalities field shows.

Terms in this guide

Cite this guide

The AI Engineering Editors. "What is OpenRouter? How its routing, pricing, and data controls work." The AI Engineering, updated Nov 24, 2026. https://theaiengineering.com/articles/what-is-openrouter

Title
What is OpenRouter? How its routing, pricing, and data controls work
Author
The AI Engineering Editors
Publisher
The AI Engineering
Published
Updated
View as Markdown

The AI Engineering Editors ·