Switching from OpenRouter to a direct provider usually comes down to one change: swapping a base URL and an API key. The harder question is when router economics stop making sense: typically once you serve one or two models at sustained volume. This guide covers the triggers, the migration steps, and the honest reasons to stay.
Key takeaways
- The code change is typically 2 lines (
base_urlandapi_key) because OpenRouter and most direct providers expose the same OpenAI-compatible chat-completions API. - OpenRouter's core value is breadth: one key, one bill, and a catalog spanning hundreds of model endpoints. Going direct trades that convenience for one fewer intermediary and a direct commercial relationship.
- OpenRouter says it passes through upstream token pricing and charges a fee when you purchase credits; at sustained volume, that fee structure is worth modeling against direct pricing.
- Keeping OpenRouter configured as a fallback during migration gives you 2 layers of availability while you validate the new provider.
- If you call a long tail of models each month or you're still benchmarking, staying on OpenRouter is usually the correct decision.
What you're actually paying OpenRouter for
OpenRouter is a routing and aggregation layer. You send one OpenAI-compatible request; it forwards that request to an upstream inference provider hosting the model, then returns the response. In exchange, you get a unified catalog, one API key, consolidated billing, provider fallbacks, and routing controls.
So what's the OpenRouter markup? OpenRouter says it charges the same per-token rates as the upstream providers and monetizes through a fee applied when you buy credits. It also offers a bring-your-own-key option for some providers, where you supply your own upstream credentials and OpenRouter acts purely as the router. Fee structures change, so treat the pricing page and docs as the source of truth rather than any article, including this one.
The practical implication: the "markup" isn't hidden in the token price; it's a visible fee layer plus the operational cost of having an intermediary in your request path. Whether that layer is worth it depends almost entirely on your usage shape.
When does switching from OpenRouter to a direct provider make sense?
You've converged on one or two models at sustained volume
Routers earn their keep when you need breadth. If your traffic has settled (say, one chat model and one embeddings or classification model running continuously), you're paying for aggregation you no longer use. At sustained volume, even a small per-dollar fee layer compounds into a line item worth eliminating, and direct providers may offer committed-use arrangements that a router can't pass through. For a framework on modeling that crossover, see our guide to finding the cheapest LLM API for your workload shape.
You need direct data-governance terms
Compliance teams often want a data-processing agreement with the entity that actually runs the GPUs. Through a router, your prompts transit an additional company's infrastructure, and retention is governed by a stack of policies: the router's plus each upstream provider's. Going direct shortens that chain to one counterparty and one set of terms to negotiate and audit.
You want capacity guarantees and a support relationship
At meaningful scale, direct providers can discuss rate-limit headroom, dedicated capacity, and SLAs. A router can route around an outage, but it can't guarantee you throughput on a specific upstream deployment.
Latency discipline matters
Every intermediary adds a network hop and a queueing point. Going direct removes one hop from the path. Whether that difference is material for your product is something only your own measurements can answer. Don't take anyone's marketing page as evidence, including ours.
When should you stay on OpenRouter? (The honest list)
This is the part most migration guides skip. Stay on OpenRouter if:
- You're still exploring. If your model choice changes month to month, a router's catalog is the cheapest benchmarking infrastructure available.
- You call a long tail of models. Five, ten, or fifty models across different providers means five, ten, or fifty direct accounts, keys, bills, and quota dashboards. The aggregation fee is often cheaper than the engineering time.
- You rely on automatic fallbacks. If OpenRouter's provider failover is your availability story, going direct means rebuilding that yourself: health checks, retry logic, secondary providers.
- Your volume is low or spiky. Below a meaningful scale threshold, the fee layer is noise and the operational simplicity dominates.
- You already use bring-your-own-key. If you supply your own upstream keys, you've effectively already gone direct; OpenRouter is just your routing layer.
How to switch: a six-step migration playbook
Step 1: Audit 30 days of usage
Export or reconstruct your request logs. You need four numbers per model: request count, token volume, error rate, and latency distribution. Most teams discover their traffic is far more concentrated than they assumed, which either confirms the case for going direct or kills it.
Step 2: Shortlist direct providers on identical criteria
Evaluate candidates on the same axes: exact model variant and quantization available, context window, throughput and rate limits, published pricing, data-retention terms, regions, and OpenAI-API compatibility. Direct providers fall into a few categories: first-party APIs from model developers, serverless inference clouds, and decentralized inference marketplaces such as Morpheus. Assess all of them against the same checklist. Our OpenRouter alternatives roundup profiles the categories in more depth.
Step 3: Make the code change
Because both sides speak the OpenAI-compatible API, the migration is usually configuration, not code. Python:
from openai import OpenAI
client = OpenAI(
base_url="https://api.your-provider.example/v1", # was https://openrouter.ai/api/v1
api_key=os.environ["PROVIDER_API_KEY"], # was OPENROUTER_API_KEY
)
resp = client.chat.completions.create(
model="your-provider-model-id", # check the provider's exact model naming
messages=[{"role": "user", "content": "Hello"}],
)
And the equivalent curl check:
curl https://api.your-provider.example/v1/chat/completions \
-H "Authorization: Bearer $PROVIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "your-provider-model-id",
"messages": [{"role": "user", "content": "Hello"}]
}'
Step 4: Map model names and parameter quirks
Model IDs differ between OpenRouter's namespaced naming and each provider's own identifiers. Check the provider's model list and confirm the variant matches; the same open-weight model may be served at different quantizations or context lengths across providers. Also check how the parameters you depend on behave: max_tokens, temperature, streaming, tool calling. Any OpenRouter-specific routing options you were passing will need direct equivalents.
Step 5: Run shadow traffic, then cut over
Before flipping production, replay a slice of real traffic against the direct endpoint and compare outputs, latency, and error rates against your OpenRouter baseline. Then shift a small percentage of live traffic, watch your application-level metrics, and ramp. This is your evaluation to run. No third-party benchmark substitutes for your own prompts on your own workload.
Step 6: Keep a fallback and set a review date
Leave OpenRouter configured as a secondary route during the transition; it's a ready-made failover while you build confidence in the direct path. Set a calendar reminder 60 to 90 days out to compare actual spend and reliability against your projections. Migrations that looked right on paper sometimes get honestly reversed.
The privacy question: OpenRouter's policy vs going direct
OpenRouter's privacy policy governs what it logs and retains as your prompts transit its infrastructure, and each upstream provider applies its own data terms on top. OpenRouter's docs also describe routing preferences that let you restrict which upstream providers may receive your traffic. Useful, but it means your data posture depends on a configuration layer you have to maintain.
Going direct collapses that to one policy: the provider's. That's simpler to audit, but apply the same skepticism everywhere — any provider's zero-retention or "we can't see your prompts" language is a policy statement, not an independently verified technical guarantee. If verifiable privacy is a hard requirement, that points toward architectures like local inference or providers with attestation mechanisms, which is a separate evaluation entirely.
FAQ
Does OpenRouter add a markup to model prices?
OpenRouter says it passes through upstream providers' token pricing and earns money through a fee on credit purchases. Terms can change, so confirm on its pricing page. Going direct removes that fee layer but adds per-provider billing overhead.
What does switching from OpenRouter to a direct provider mean?
It means calling an inference provider's own API endpoint with its own API key instead of routing through OpenRouter. Because both typically expose an OpenAI-compatible API, the change is usually a base-URL and key swap, not a rewrite.
How does OpenRouter handle prompt privacy?
OpenRouter is an intermediary: prompts transit its infrastructure on the way to upstream providers, and retention depends on its privacy policy plus each provider's data terms. Any provider's zero-retention language is a policy statement, not a verified guarantee.
When should I stay on OpenRouter instead of going direct?
Stay if you're still exploring models, call a long tail of models each month, rely on its automatic fallbacks, or run low, spiky volume where per-token fees matter less than operational simplicity.
Questions
- Does OpenRouter add a markup to model prices?
- OpenRouter says it passes through upstream providers' token pricing and earns money through a fee on credit purchases. Terms can change, so confirm on its pricing page. Going direct removes that fee layer but adds per-provider billing overhead.
- What does switching from OpenRouter to a direct provider mean?
- It means calling an inference provider's own API endpoint with its own API key instead of routing through OpenRouter. Because both typically expose an OpenAI-compatible API, the change is usually a base-URL and key swap, not a rewrite.
- How does OpenRouter handle prompt privacy?
- OpenRouter is an intermediary: prompts transit its infrastructure on the way to upstream providers, and retention depends on its privacy policy plus each provider's data terms. Any provider's zero-retention language is a policy statement, not a verified guarantee.
- When should I stay on OpenRouter instead of going direct?
- Stay if you're still exploring models, call a long tail of models each month, rely on its automatic fallbacks, or run low, spiky volume where per-token fees matter less than operational simplicity.
Sources
- OpenRouter Documentation — OpenRouter
- OpenRouter Privacy Policy — OpenRouter
- OpenRouter Model Catalog — OpenRouter
- OpenAI API Reference — OpenAI
- Hugging Face Inference Providers Documentation — Hugging Face
About DeAI
DeAI is an independent publication covering open-weight AI models, private inference, and decentralized infrastructure — the tools for running AI you actually control. We test providers on price, privacy, and refusal behavior and publish the numbers, not the vibes. DeAI is powered by Morpheus (mor.org), a decentralized inference marketplace, and covers it on the same terms as every other provider.
Powered by Morpheus and StrandCMS
Morpheus is a decentralized inference marketplace, covered on the same terms as every other provider — we rank it wherever the data lands. StrandCMS is the open-source, agent-first framework this site is built on.
