OpenRouter vs LiteLLM: Hosted API or Your Own Gateway
November 18, 2026

OpenRouter vs LiteLLM looks like a choice between two tools that do the same job. It isn't. OpenRouter is a service you sign up for. LiteLLM is software you run.
Both give you one OpenAI-style API in front of many models. The difference is who sits in the middle:
- OpenRouter is a hosted router. You buy credits, get one key, and call hundreds of models. OpenRouter holds the provider accounts and sends you one bill.
- LiteLLM is an open-source Python SDK and gateway. You bring your own provider keys and run it on your own machine or cluster. Nothing passes through a third party.
So the short answer:
- Want access to many models in ten minutes, with one invoice? OpenRouter.
- Want your own keys, your own network, and per-team budgets? LiteLLM.
- Want both? LiteLLM documents OpenRouter as a provider, so you can put one behind the other.
Everything below comes from each project's docs, pricing page and published security posts as they read today.
Quick Comparison
| OpenRouter | LiteLLM | |
|---|---|---|
| What it is | Hosted API and model catalog | Open-source SDK and self-hosted gateway |
| Who runs it | OpenRouter | You (a hosted option is sold through sales) |
| Licence | Proprietary service | MIT, with a separately licensed enterprise directory |
| Provider accounts | OpenRouter's, or your own keys (BYOK) | Your own |
| Catalog | 600+ models from 80+ providers, per OpenRouter | 100+ providers, per LiteLLM |
| Cost of the tool | A fee when you buy credits, no markup on inference | No fee and no markup, plus your hosting. Enterprise licence is paid |
| Where prompts travel | Through OpenRouter to the provider | From your gateway straight to the provider |
| Routing | Automatic across providers, tunable per request | Load balancing and fallbacks you configure |
| Team controls | Workspaces, budgets, guardrails, SSO on Enterprise | Virtual keys, budgets, spend tracking. SSO and audit logs on Enterprise |
| What you maintain | Nothing | The gateway, its database and its upgrades |
What Each One Actually Is
OpenRouter: one account, many models
OpenRouter describes itself as a unified API for the major models, with billing and usage analytics in one place. Its site lists 600+ models from 80+ providers today. You point any OpenAI-compatible client at OpenRouter's base URL, pick a model ID, and send requests.
You don't need an account with Anthropic, Google or anyone else. That is the appeal, and it is why OpenRouter is a common way to try a new model the day it ships, or to run Claude Code against other models.
LiteLLM: an SDK and a gateway
LiteLLM comes in two parts, and people often mix them up:
- The Python SDK is a library. You call one function with a model name like
anthropic/...orbedrock/..., and it translates the request and response into the OpenAI format. - The AI Gateway (also called the Proxy Server) is a server you deploy. Apps in any language call it by changing their base URL. It adds virtual keys, budgets, rate limits, spend tracking, an admin UI, guardrails and an MCP gateway.
LiteLLM's own guidance is to use the SDK when one Python app calls models directly, and the gateway when several apps, teams or coding agents share models.
You supply every provider key. LiteLLM doesn't resell inference.
Cost: A Fee on Credits vs Running It Yourself
OpenRouter passes through provider pricing with no markup on inference, and charges when you add money. The FAQ states a 5.5% fee on credit purchases, with a $0.80 minimum, and 5% for crypto payments. The pricing page shows that platform fee as 5.5% on the Standard plan and 8% on the Business plan, with discounts negotiated on Enterprise. There is also a no-cost plan limited to 50 requests a day on a small set of models.
If you bring your own provider keys, OpenRouter's BYOK docs say the first $25,000 of list-price inference each month carries no fee on pay-as-you-go plans. Above that, the fee is 5% of what the same model and provider would normally cost on OpenRouter.
LiteLLM is open source under MIT, and the docs state there is no markup on model spend. Your costs are elsewhere:
- A server or container to run the gateway, plus a database for keys and spend.
- Someone's time to deploy it, upgrade it and watch it.
- An Enterprise licence if you need the features behind it. LiteLLM says that pricing depends on deployment size.
| OpenRouter | LiteLLM | |
|---|---|---|
| Fee model | Percentage when buying credits | None for open source |
| Inference price | Provider's price | Whatever your provider accounts charge |
| Fixed costs | None | Hosting and maintenance |
| Volume discounts from providers | Not yours to negotiate, unless you use BYOK | Yours, on your own contracts |
At small volume the OpenRouter fee is a rounding error and LiteLLM's hosting isn't. At large volume it flips: a percentage of a big bill is real money, and negotiated provider rates only help if the traffic runs on your accounts.
Data and Privacy: Who Sees Your Prompts
This is the section most teams actually decide on.
With OpenRouter, your prompts pass through a middle party. Its data collection page says OpenRouter does not store prompts or responses unless you opt in to logging or to letting it use your data, in exchange for a 1% discount. Both are off by default. It does store request metadata such as token counts and latency.
There are caveats, and OpenRouter states them plainly:
- Each provider endpoint has its own data policy. OpenRouter labels them in three tiers: ZDR, Safety Retention, and Retention and Training.
- You can enforce Zero Data Retention globally, per guardrail or per request, so requests only reach ZDR endpoints. Some models then become unavailable.
- Even with ZDR enforced, self-serve accounts still allow Safety Retention endpoints unless you switch to "ZDR only". On those endpoints prompts may be kept to prevent abuse, but not for training. "ZDR only" is the default for enterprise accounts.
- OpenRouter's docs carry a notice dated October 27, 2026 that it will screen all inference requests, including ZDR traffic, for child sexual abuse material, and that flagged content may be retained where the law requires.
With LiteLLM, there is no middle party. Its data security page says no data or telemetry is stored on LiteLLM servers when you self-host, and usage telemetry is off by default. Prompts go from your gateway to the provider you chose, under the contract you signed with that provider.
That doesn't make LiteLLM private by magic. The provider's own retention policy still applies, and the gateway's logs and database are now yours to secure.
Routing, Fallbacks and Team Controls
OpenRouter routes for you. One model is often served by several providers. By default OpenRouter picks between them using each provider's measured price, throughput, latency and reliability, and falls back when one is down. Its provider routing docs list a provider object you can attach to a request to:
- set a preferred
order, or allowonlycertain providers - turn fallbacks off with
allow_fallbacks sortby price, throughput or latency- cap cost with
max_price - restrict to ZDR endpoints with
zdr
There is also an Auto Router that picks the model itself.
LiteLLM routes what you configure. You list your deployments, for example the same model on two cloud accounts, and the router load-balances and fails over between them. Nothing is chosen for you, which is the point: you decide which account and region each request uses.
For teams, the open-source gateway already includes virtual keys, budgets and rate limits per key, spend tracking and an admin UI. LiteLLM's Enterprise page lists what the paid licence key adds on the same image:
- SSO and SCIM (SSO is included for up to 5 users without a licence)
- Audit logs with retention policies
- Organization and team admin roles
- Secret manager integrations and IP allowlists
- Per-team logging and multi-region deployment
- Some built-in guardrail integrations
The licence detail matters if you fork the code. The repository's LICENSE file says everything is MIT except the litellm/enterprise/ directory, which carries a separate BerriAI Enterprise licence that requires a paid agreement for production use.
OpenRouter covers similar ground on the hosted side: workspaces, budgets and spend controls on paid plans, with SSO, managed policy enforcement and contractual SLAs on Enterprise.
Security Track Record
Running your own gateway means its security is your job too. LiteLLM has had a rough 2026 here, and it has been open about it.
March 24, 2026. LiteLLM reported that two PyPI releases, 1.82.7 and 1.82.8, were malicious. They were live for about 40 minutes before PyPI quarantined them, and carried credential-harvesting code. LiteLLM said it believes the cause was a compromised third-party scanner used in its CI pipeline, and that users of the official Docker image were not affected. It later shipped a clean release from a rebuilt pipeline.
October 21, 2026. A second incident hit release v1.107.0. LiteLLM's root cause write-up says its release pipeline published a compromised package to PyPI and to its container registries, and that the releases were pulled within a few hours. The cause was different this time: an administrative key for an internal service had been committed to a public repository in May and never revoked. LiteLLM published a follow-up on what it is changing.
Separately, the project's GitHub security advisories list a number of proxy vulnerabilities published during 2026, several rated critical.
What to take from this:
- Pin exact versions. Both incidents hit people installing the newest release as it came out. A signature check alone would not have helped in October, because LiteLLM says its own pipeline signed that release.
- Patch on a schedule. A gateway holds every provider key you own.
- This isn't a verdict on OpenRouter. A hosted service has a different risk shape, not zero risk. You can't audit it or pin it, and you depend on its uptime and its handling of your traffic.
Our LiteLLM alternatives guide covers other gateways you can self-host if these incidents changed your mind.
Using OpenRouter and LiteLLM Together
You don't have to choose. LiteLLM's OpenRouter provider page documents OpenRouter as one of its providers. You set an OPENROUTER_API_KEY and call models with the openrouter/ prefix in front of the usual model ID.
One layout that follows from this:
- Direct provider keys in LiteLLM for the models you use heavily, on your own contracts.
- OpenRouter added as one more provider, for the long tail of models you only need now and then.
- LiteLLM's virtual keys and budgets on top, so every team's spend lands in one place.
You pay OpenRouter's credit fee only on the traffic that goes through it.
How to Choose
Choose OpenRouter if:
- You're one person or a small team and want to start today.
- You switch models often, or want access to ones you have no account for.
- You're fine with a hosted service in the request path, with ZDR settings where you need them.
Choose LiteLLM if:
- Prompts can't leave your network except to providers you've contracted with.
- You already have provider accounts, committed spend or cloud credits to use.
- Several teams or agents share models and you need per-key budgets.
- You have someone who can own a production service and keep it patched.
Use both if you want control over your main traffic and convenience for everything else.
If neither fits, compare the wider field in OpenRouter alternatives and Portkey alternatives.
Where Taku Fits
Gateways are plumbing for people building AI products. If you'd rather run an AI tool someone has already built than wire up models and keys yourself, that's where Taku comes in. Taku Apps and Sites, built by the best AI minds. Find one, run it, and keep it in your Mac Dock. Taku is in Beta, and the Mac app is available now.
FAQ
Is LiteLLM the same as OpenRouter?
No. OpenRouter is a hosted service that resells access to many models through one account. LiteLLM is open-source software that translates between providers using your own keys, on infrastructure you run.
Is LiteLLM open source?
Yes. The core is under the MIT licence. Code in the litellm/enterprise/ directory has its own commercial licence, and Enterprise features such as audit logs and SCIM need a licence key.
Does OpenRouter mark up model prices?
OpenRouter says it passes through provider pricing without markup on inference. It charges a fee when you buy credits instead: 5.5% on the Standard plan, per its pricing page today.
Can LiteLLM call OpenRouter models?
Yes. LiteLLM's docs list OpenRouter as a supported provider. You add your OpenRouter key and prefix the model name with openrouter/.
Does OpenRouter store my prompts?
By default, OpenRouter says it doesn't store prompts or responses, only request metadata. Logging and data-use options are opt-in. The provider that serves the request has its own policy, which you can restrict with OpenRouter's Zero Data Retention settings.
Is LiteLLM safe to use after the 2026 incidents?
LiteLLM disclosed two compromised releases in 2026 and published the causes and its fixes. Whether that is acceptable is your call. If you run it, pin exact versions, wait before adopting a new release, and track its security advisories.