The short version
Most comparisons of these two get the framing wrong on the first line, and everything after it inherits the error. OpenRouter and LiteLLM are not two answers to the same question. They sit at different layers, and the interesting choice is not which one — it is whether you want to be a customer or an operator.
OpenRouter is a reseller. You buy credits, it buys tokens from providers, and you get one API key that reaches 400+ models. You never hold a provider key. You never run anything.
LiteLLM is a proxy. It is MIT-licensed software you deploy on your own infrastructure. It speaks the OpenAI format to your app and translates to 100+ providers behind it — using your provider keys, on your provider bills. LiteLLM never sells you a token.
Which reframes the whole comparison. The question is not "which gateway is better". It is: is a few percent of your model spend worth more or less than running a piece of infrastructure?
OpenRouter is a managed aggregator running on Cloudflare's edge, offering 400+ models across, by its own varying counts, 50 to 70+ providers. One key, one balance, one invoice.
The routing controls are more sophisticated than most people use. You can pin provider order, ignore providers, sort by price or throughput or latency, require parameter support, demand zero data retention, and — importantly — filter by quantization (int4 through fp32).
By default it load-balances by price, weighting providers by the inverse square of their cost and deprioritising anything that errored in the last 30 seconds. Model variants let you append intent to a slug: :nitro for throughput, :floor for price, :exacto for tool-calling reliability.
SOC 2 Type 2, GDPR, an account-wide or per-request zero-data-retention toggle with a programmatic list of ZDR-capable endpoints, and EU in-region routing for enterprise. Prompts are not stored unless you opt in — and if you do opt in, you get a 1% discount, which is an unusually honest way to price a data trade.
LiteLLM ships as two things: a Python SDK and an AI Gateway proxy you run in Docker or Kubernetes. It is MIT-licensed, has over 240 million Docker pulls and 52,000 GitHub stars, and speaks to 100+ providers.
The open-source tier is unusually generous and this surprises people: virtual keys, per-key budgets, teams, load balancing, RPM/TPM limits, guardrails and observability integrations are all in the free build. Caching is extensive — Redis, disk, in-memory, S3, GCS, plus semantic caching on Redis, Qdrant or Valkey.
Six routing strategies ship in the box: weighted shuffle, latency-based, rate-limit-aware, least-busy, lowest-cost, and custom Python. Their docs carry a warning worth heeding: usage-based routing "is not recommended for production due to performance impacts".
Enterprise adds SSO, SCIM, JWT auth, audit logs, 24/7 support with custom SLAs, secret detection and redaction, key rotation and Prometheus metrics. LiteLLM does not publish an enterprise price — it is a "get in touch". Budget accordingly, and do not trust any number you find in a comparison blog, including the ones that quote one.
| OpenRouter | LiteLLM | |
|---|---|---|
| What it is | Managed reseller | Self-hosted proxy (MIT) |
| Who holds provider keys | They do | You do |
| Models / providers | 400+ models, 50–70+ providers | 100+ providers, you enable what you buy |
| Fee | 0% token markup + 5.5% on card credit purchases ($0.80 min); 5% crypto; BYOK free to 1M req/mo then 5% | $0 software. You pay infrastructure and ops |
| Volume discount | None — "OpenRouter does not currently offer volume discounts" | N/A — you negotiate directly with providers |
| Credits | May expire after 1 year; 24-hour refund window; fees non-refundable | N/A |
| Latency overhead | A network hop you cannot tune | ~2ms median, 8ms P95 (4 instances, mock endpoint, self-reported) |
| Caching | Provider caching + sticky provider routing to keep it warm | Redis, semantic (Redis/Qdrant/Valkey), disk, S3, GCS |
| Keys, budgets, teams | Enterprise tier | Free tier |
| SSO, audit logs, SLA | Enterprise tier | Enterprise tier (price not published) |
| Compliance certs | SOC 2 Type 2, GDPR, ZDR, EU region | None — your deployment, your responsibility |
| Ops burden | Zero | Postgres + Redis + replicas + migrations + on-call |
OpenRouter charges no markup on tokens. That claim is true and it is not the whole picture. The fee sits on the credit purchase: 5.5% on card, with an $0.80 minimum.
The minimum is what makes small top-ups expensive.
| You top up | Fee charged | Effective rate |
|---|---|---|
| $5 | $0.80 (minimum applies) | 16.0% |
| $10 | $0.80 (minimum applies) | 8.0% |
| $20 | $1.10 | 5.5% |
| $100 | $5.50 | 5.5% |
| $1,000 | $55.00 | 5.5% |
So "0% markup" is honest and "free" is not. Top up in larger amounts and the effective rate settles at 5.5%. Top up $5 at a time and you are paying 16%.
If you bring your own provider keys, OpenRouter charges nothing for the first 1 million BYOK requests per month, then 5%. Which means at modest volume with BYOK, OpenRouter's routing, fallbacks and dashboards cost you zero — and self-hosting LiteLLM to save a fee you are not paying makes no sense at all.
The software is free. Everything around it is not.
Three pods, a managed Postgres and a managed Redis lands somewhere around $150–400/month in cloud line items. OpenRouter's own estimate for a LiteLLM production deployment is "a few hundred dollars a month" — and that comes from a competitor, so treat it as a floor rather than a ceiling.
For calibration, TrueFoundry quotes $600–1,000/month to self-host its own gateway, which has the same shape: Postgres, Redis, replicas.
Someone has to upgrade it, patch it, watch it and be paged when it falls over. At a $180,000 fully-loaded engineer, a tenth of an FTE is $1,500 a month — three to ten times the infrastructure bill. This is the number that actually decides the question, and it appears in nobody's comparison table.
The formula is trivial and the inputs are the argument:
Break-even monthly spend = (infrastructure + ops labour) ÷ fee
OpenRouter publishes the first two rows itself, which is worth noting: a vendor telling you the spend level at which you should stop paying them is a good sign about the rest of their documentation.
LiteLLM self-reports roughly 2ms median and 8ms P95 overhead — but read the conditions: that is a four-instance deployment at 4 CPU and 8 GB each, measured against a mock endpoint. On two instances the median rises to around 12ms.
Which is the honest headline: a well-provisioned LiteLLM adds single-digit milliseconds to a call that takes hundreds. An under-provisioned one does not. Competitor benchmarks show LiteLLM degrading badly on small instances, but those benchmarks were run by competitors and should be read as such.
OpenRouter's overhead is an extra network hop you cannot tune. On a call that takes 800ms to several seconds, neither number is the reason to choose.
In early 2026 OpenRouter began enforcing a clause in its terms prohibiting users from "reselling API access to AI Models or otherwise developing a competing service". Accounts started receiving 403 errors, and services built on top of OpenRouter stopped working with little warning.
A user on Hacker News, mid-incident: "All Gemini and Claude models are not accessible anymore. Does anyone have any insights?" And, more sharply: "OpenRouter just practically killed hundreds of services in a day."
OpenRouter's position, from its own Discord: "We're required to comply with the terms of service of our upstream model providers. Our enforcement mechanisms and regional access rules are updated continuously… This is not a ban on using OpenRouter."
Both things can be true. OpenRouter is genuinely constrained by its suppliers, and you are genuinely two layers away from the model. The comment that stuck, from the same thread: "It's not like you ever owned anything when you built something on top of these sorts of services… Anything relatively close to production? Fix a model version and use a provider's API."
That is the real argument for self-hosting, and it is not about 5.5%. When you hold the provider keys, your relationship is with the provider. When you do not, you inherit somebody else's terms of service and somebody else's enforcement calendar.
OpenRouter reserves the right to expire unused credits after a year. Its COO answered the criticism directly on Hacker News: "In practice we don't expire the credits, but have to reserve the right to, or else we have an uncapped liability literally forever. Can't operate that way. It's not a profit center for us."
Reasonable. Also a reason not to prepay a large balance.
The instinct is that self-hosting is the compliant choice. Frequently it is the reverse.
OpenRouter holds SOC 2 Type 2, offers zero data retention and EU in-region routing. LiteLLM, as software, holds no certifications at all — your deployment is your compliance boundary, and you are the one who has to evidence it to an auditor.
If you need a SOC 2 report to close a deal, buying one is faster than becoming one.
The easy part is genuinely easy. Both speak the OpenAI format, so the swap is a base URL and a key:
# OpenRouter
client = OpenAI(base_url="https://openrouter.ai/api/v1", api_key=OR_KEY)
# LiteLLM proxy
client = OpenAI(base_url="http://litellm.internal:4000", api_key=MASTER_KEY)
What does not travel:
:nitro, :floor and :exacto variants do not exist anywhere else. That routing logic has to be rebuilt as LiteLLM strategies.provider object — order, ignore, quantization filters, data-collection rules — has no equivalent. If you were filtering out int4 providers, you must now reproduce that with explicit per-provider deployments.You can run LiteLLM as your proxy and configure OpenRouter as one of its upstream providers. OpenRouter publishes the config for it.
This is the answer for more teams than either vendor would like. You get LiteLLM's virtual keys, budgets, teams and observability — free, on your infrastructure — while OpenRouter handles the long tail of models you have not negotiated direct contracts for. Route your top three models direct with your own keys, and everything else through OpenRouter.
The fee then applies only to the tail, which is exactly where its convenience is worth paying for.
| Your situation | Choice | Why |
|---|---|---|
| Prototyping, or under ~$3k/month model spend | OpenRouter | The fee is smaller than the time you would spend |
| Using BYOK under 1M requests/month | OpenRouter | It is literally free at that volume |
| Need SOC 2 to close a deal | OpenRouter | They have it. LiteLLM, as software, has nothing to have |
| Above ~$50k/month model spend | LiteLLM | 5.5% of that funds an engineer and the infrastructure twice over |
| You have negotiated direct provider rates | LiteLLM | A reseller cannot honour a contract it is not party to |
| Regulated data, VPC-only, air-gapped | LiteLLM | Nothing leaves your network |
| You need per-team budgets and virtual keys today | LiteLLM | Free tier. OpenRouter gates this to enterprise |
| You are building a product that resells model access | LiteLLM | OpenRouter's terms prohibit it, and they now enforce it |
| Most mid-size teams | Both | LiteLLM in front, direct keys for your top models, OpenRouter for the tail |
No. OpenRouter is a managed reseller that sells you tokens through one key. LiteLLM is MIT-licensed software you deploy yourself, which routes to providers using your own keys and your own bills. They operate at different layers.
Yes, and it is often the right answer. Run LiteLLM as your proxy and add OpenRouter as one of its upstream providers — direct keys for your top models, OpenRouter for the long tail. OpenRouter publishes the configuration for this.
There is no markup on tokens, but there is a 5.5% fee on card credit purchases with an $0.80 minimum — which works out at 16% on a $5 top-up and 5.5% on a $1,000 one. BYOK is free for the first 1M requests a month.
By OpenRouter's own published maths: above roughly $3,600/month of model spend at $200/month of infrastructure, or $9,100 at $500. Add a tenth of an engineer's time and break-even moves to around $36,000/month.
The software is free and MIT-licensed. It needs Postgres, Redis 7.0+ and horizontally scaled pods at roughly 1 CPU and 4 GiB each — call it $150–400/month in cloud line items, plus the engineer time nobody budgets for.
It self-reports about 2ms median and 8ms P95 overhead on a four-instance deployment measured against a mock endpoint. On two instances the median rises to around 12ms. Against an LLM call taking hundreds of milliseconds, a well-provisioned proxy is noise.
No. Its FAQ states plainly: "OpenRouter does not currently offer volume discounts." Enterprise customers can buy credits in bulk at discounted fees, but no percentage is published.
They reserve the right to expire unused credits after one year. Their COO has stated publicly that in practice they do not, but that they must reserve the right to avoid unlimited liability. Do not prepay a large balance.
OpenRouter, counterintuitively. It holds SOC 2 Type 2, offers zero data retention and EU in-region routing. LiteLLM is software and holds no certifications — your deployment is your compliance boundary.
In early 2026 it began enforcing a terms clause prohibiting reselling API access or building a competing service, citing obligations to its upstream providers. Users reported services breaking with little warning. If your product resells model access, this is disqualifying.
It passes provider prompt caching through, and separately offers its own caching layer — Redis, disk, in-memory, S3, GCS, plus semantic caching on Redis, Qdrant or Valkey. These are different mechanisms; see our prompt caching guide.
The API call is. What does not travel: OpenRouter's model variants (:nitro, :floor, :exacto), its provider-pinning and quantization filters, its automatic cross-provider fallback, and its sticky routing that keeps your prompt cache warm.
Yes. Virtual keys, per-key budgets, teams, load balancing, rate limits and guardrails are all in the free open-source build. SSO, SCIM, audit logs and SLAs are enterprise, and LiteLLM does not publish that price.
You should learn from it. Two releases were briefly backdoored on PyPI in March 2026. The project disclosed it clearly and quickly. The lesson is to pin versions and verify hashes — your gateway is production infrastructure and deserves to be treated that way.
If you are spending under about ten thousand dollars a month on models, use OpenRouter and stop thinking about it. The fee is smaller than the meeting you would hold to discuss avoiding it, and you get SOC 2, routing and fallbacks for nothing extra.
If you are spending over about fifty thousand a month, run LiteLLM. At that scale 5.5% pays for the infrastructure and the engineer with money left over, you can negotiate directly with providers, and you stop inheriting somebody else's terms of service.
In between — which is most teams — run both. LiteLLM in front for keys, budgets and observability; direct provider keys for the two or three models that carry your volume; OpenRouter behind it for everything else. The fee then applies only where the convenience is genuinely worth it.
And whichever you pick, check the landed price rather than assuming. In our own gateway comparison, prices for the identical model range from 40% below vendor list to 10% above it.
Copyright © 2026 Best AI Gateways
Independent ranking. We may be rewarded for recommending the service we rate best and sending users to it — that reward pays for the research behind this comparison and never buys a ranking position, at no extra cost to you. Information is provided “as is” without warranty. See our Disclaimer & Terms.