What OpenRouter Actually Is: One API for 300+ Models
OpenRouter is an OpenAI-compatible API gateway that routes chat, completion, and related calls to hundreds of models across many providers through one base URL, one key shape, and one request format.
You pick a model slug. OpenRouter picks (or you constrain) which upstream provider actually serves the tokens.
OpenRouter is a unified inference gateway, not a model trainer. It normalizes provider APIs into an OpenAI-style /api/v1 surface and bills usage through credits (or BYOK).
Insight: Agent stacks change models often. One integration, fallback routing, and shared analytics beat maintaining separate SDKs and invoices per lab.
Key Concepts:gateway, model slug, provider routing, OpenAI compatibility, credits vs BYOK, data-policy filters.
When to Use: Multi-model agents, evals across vendors, cost/latency routing, or teams that want one key and one observability surface.
Limitations/Trade-offs: You accept a hop through OpenRouter, credit-purchase fees (not inference markup), provider policy variance, and less direct enterprise terms than a single-lab contract.
Related Topics: unified API normalization, credits and billing, free models, BYOK, data policies, setup and routing.
Client authenticates with an OpenRouter API key (Authorization: Bearer ...).
Client sets model to a slug (for example anthropic/claude-sonnet-4 or an alias like ~openai/gpt-latest - verify at build).
OpenRouter selects an eligible provider endpoint for that model (price/latency/quality ranking, plus your filters).
If the first endpoint errors and fallbacks are allowed, OpenRouter tries the next eligible provider.
Usage is metered in tokens (and sometimes per-request or image fees); cost is deducted from credits, or usage goes through BYOK keys with platform fee rules.
You get an OpenAI-shaped response, plus OpenRouter-specific metadata (provider used, generation id, etc.) when available.
Compatibility is the integration story.
Most OpenAI SDKs and agent frameworks accept a custom base_url / baseURL. Pointing that at OpenRouter is enough for chat completions, streaming (SSE), and tool/function calling when the target model supports it.
Optional headers (HTTP-Referer, X-OpenRouter-Title) attribute traffic to your app for rankings. They are not required for correctness.
Agents care about three OpenRouter features more than branding:
Feature
What it does for agents
Model swap by slug
Eval and production can change models via config
Provider fallback
Softens single-vendor outages mid-loop
Routing preferences
Trade cost, latency, or tool-call reliability (:floor, :nitro, :exacto)
Billing and privacy are separate control planes.
Credits fund shared OpenRouter capacity. BYOK attaches your provider keys so inference bills the lab while OpenRouter still normalizes the API (with a free monthly request threshold, then a percentage fee - verify at build).
Data policies let you prefer zero-retention or non-training endpoints - critical when agents touch customer data.
For multi-agent systems, treat OpenRouter as infrastructure, not as the agent framework.
LangGraph, CrewAI, Vercel AI SDK, OpenAI Agents SDK, and similar stacks remain the loop owners. OpenRouter is the model transport.
Patterns that work well:
Router agent + specialist models: cheap model for classification, expensive model for hard reasoning, both via one client.
Eval harnesses: same prompts against many slugs without N SDKs.
Graduated privacy: ZDR or data_collection: deny filters on sensitive tools; freer routing on public content.
Hybrid spend: BYOK for high-volume production providers; credits for long-tail models.
Trade-offs versus direct provider APIs:
Approach
Strength
Weakness
Best fit
OpenRouter only
One integration, broad catalog, fallbacks
Extra hop; credit fee on purchase
Multi-model agents, startups, evals
Direct provider APIs
Closest SLA/features; simple vendor relationship
N integrations; hard failover
Single-provider products
Hybrid (direct primary + OpenRouter backup)
Control + safety net
Two billing systems
Enterprises with a preferred lab
Self-hosted open weights
Data residency and cost at scale
Ops burden
Air-gapped or high-volume open models
Enterprise buyers should still review Terms, Privacy, subprocessors, and whether specific model endpoints meet compliance - the gateway does not magically unify every lab's legal terms.
"OpenRouter is a model." It is a gateway to models hosted by others (and some free endpoints).
"OpenRouter always marks up token prices." Public docs state pass-through inference pricing; fees apply on credit purchase and after BYOK free-request thresholds (verify at build).
"One API means one data policy." Each upstream provider (and sometimes each endpoint) has its own retention and training rules. OpenRouter exposes filters; you must set them.
"Free models are production-ready." Free variants have low platform rate limits and often weaker capacity guarantees.
"Pointing base_url at OpenRouter replaces agent architecture." You still need loops, tools, stop conditions, and evals.
The request/response shape is intentionally compatible, so OpenAI SDKs usually work with a different base URL and key. Upstream models, pricing, routing, and headers are OpenRouter-specific.
How many models are available?
Hundreds across many providers. Treat any fixed count as stale; check the models API or site catalog at build time. This guide's stack pin uses ~315+.
Do I need a different client per provider?
No. One OpenRouter client can call Claude, GPT, Gemini, Llama hosts, and others by changing the model slug (when each is listed).
What is a model slug?
A string ID such as google/gemini-2.5-flash that selects the model (and optional behavior via suffixes like :free or :nitro). Exact slugs change over time - verify at build.
Does OpenRouter train on my prompts?
By default OpenRouter does not log prompt/completion content for training; logging is opt-in. Upstream providers may have different policies. Use privacy settings and data-policy filters for enterprise control.
When should I skip OpenRouter?
When you are locked to one provider's exclusive features, need a pure bilateral enterprise contract without a gateway, or must stay fully on-prem with no external hop.
Can agents use tool calling through OpenRouter?
Yes when the selected model and provider endpoint support tool/function calling. Normalize tool schemas on your side; capability still varies by model.
What fails when a provider is down?
OpenRouter can fall back to other providers for the same model if your routing allows it. If no eligible endpoint remains, you get an error (often 503-class) and your agent should retry or degrade.
Is streaming supported?
Yes via server-sent events when stream: true, similar to OpenAI-compatible streaming.
How does this relate to LangChain or Vercel AI SDK?
Those frameworks orchestrate agents. Configure their model provider/base URL to OpenRouter so the framework keeps control of tools and memory while OpenRouter supplies models.
Are free and paid variants the same quality?
Often related weights, but free variants may differ in capacity, rate limits, logging, or hosting. Never assume parity without evals.
What should I store in secrets management?
OpenRouter API keys, and separately any BYOK provider keys. Scope keys per environment and set per-key spend limits when available.
Does OpenRouter replace MCP or A2A?
No. MCP and A2A are tool/agent protocols. OpenRouter is model inference transport.
Where do I see cost and usage?
OpenRouter's activity dashboard and credits/key APIs. Agent platforms should still log their own traces with model slug, tokens, and provider when exposed.