OpenRouter is an aggregation layer for model APIs: one key, one balance, and access to hundreds of models from dozens of providers through an OpenAI-compatible endpoint, with routing, price comparison and failover between them.
The Problem It Removes
When you evaluate several models at once, the time sink isn't the code — it's repeating onboarding, key management, billing and error handling four times over. OpenRouter collapses that into one entry point: switching models is usually a change to one model-name string.
For products already in production, the value sits at the other end — automatic fallback when a provider degrades, without waiting for a status page to update.
Getting Started in Three Steps
- Sign up and create an API key in the dashboard; buy credits if you want paid models.
- Point your existing OpenAI SDK's base URL at
https://openrouter.ai/api/v1and swap in your OpenRouter key. - Name models in the "provider/model" format; the models list shows each model's exact ID, context length and per-provider pricing.
from openai import OpenAI
client = OpenAI(base_url="https://openrouter.ai/api/v1", api_key="your OpenRouter key")
reply = client.chat.completions.create(
model="provider/model-name", # copy from the models list
messages=[{"role": "user", "content": "Hello"}],
)How Billing Works
According to the official FAQ, model prices are passed through at the underlying provider's rate with no markup; the platform earns its fee when you buy credits:
- Credit purchase fee: 5.5% for card payments (Stripe) with a $0.80 minimum; 5% for crypto payments.
- Free models: 50 requests a day with no credits purchased, rising to 1,000 a day once you've bought at least $10 in credits.
- Bring your own key (BYOK): route through OpenRouter with your own provider keys; on pay-as-you-go the first $25,000 of usage each month is free, and usage beyond that costs 5% of OpenRouter's standard price. The Enterprise allowance is $200,000 a month.
So a $100 top-up yields less than $100 of usable credit after the fee, and with small, frequent top-ups the $0.80 minimum pushes the effective rate higher — it's cheaper to top up in larger amounts.
Knobs Worth Knowing
- Routing variants: pick providers dynamically by cost or performance.
- Per-request price ceiling: set a threshold, and the request isn't sent if no provider meets it.
- Data policies: restrict routing to providers you trust. Per the official docs, prompts and completions aren't logged by default; opting in to logging earns a 1% discount.
When Not to Use It
If your product uses one model and needs no fallback, this layer is pure overhead — go direct. Also note that when a provider changes rates, requests keep routing there and bill at the new price, so pair budget-sensitive workloads with the price cap.
Enterprises with strict data-compliance requirements should also note that requests pass through OpenRouter on their way to the provider, adding one more party that processes the data.
How It Compares
- If you want to control the gateway yourself and keep data away from third parties, self-host an open-source gateway such as LiteLLM; see our LiteLLM gateway deployment guide and guide to building your own API relay.
- If you just want to chat with several providers' models in one interface without writing code, Poe is more direct.
- If you want to run open models locally: Ollama.
Using It From China
Reaching openrouter.ai from mainland China requires your own network arrangements, and buying credits usually needs an overseas bank card or crypto.
