OpenRouter vs LiteLLM: managed gateway or self-hosted proxy?

The short version

  • These are not competing products. OpenRouter sells you tokens; LiteLLM is software you run in front of tokens you already buy. You can run both together, and OpenRouter publishes the config for doing exactly that.
  • The whole decision is one number: OpenRouter charges 0% markup on tokens but 5.5% on card credit purchases. LiteLLM's software is free and its infrastructure is not.
  • OpenRouter publishes its own break-even, which is unusually honest of them: at $200/month of infrastructure, self-hosting wins above roughly $3,600/month of model spend. At $500/month of infra, above $9,100.
  • Add an engineer's time and the line moves hard. At $500 infra plus a tenth of an FTE, break-even lands near $36,000/month of model spend.
  • The risk nobody prices: in early 2026 OpenRouter began enforcing an upstream reselling clause and users reported 403 errors killing production services overnight. Self-hosting is partly insurance against someone else's terms of service.

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.

They are not the same category

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?

The difference is who holds the keys OpenRouter — you are a customer Your app OpenRouterholds provider keys Providers You buy credits. They buy tokens.5.5% on every top-up LiteLLM — you are an operator Your app LiteLLM (yours)your keys, your Postgres Providers You buy tokens direct.$0 fee — you pay infra + on-call A reseller cannot honour a provider contract it is not party to. That is why negotiated rates push you to the second row.
One sells you tokens. The other is software in front of tokens you already buy. That is the whole distinction.

What OpenRouter actually is

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.

Routing is its real product

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.

Compliance is real

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.

What LiteLLM actually is

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.

What you get for nothing

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".

What costs money

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.

Head to head

OpenRouter vs LiteLLM — verified from each vendor's own documentation, July 2026
OpenRouterLiteLLM
What it isManaged resellerSelf-hosted proxy (MIT)
Who holds provider keysThey doYou do
Models / providers400+ models, 50–70+ providers100+ providers, you enable what you buy
Fee0% 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 discountNone — "OpenRouter does not currently offer volume discounts"N/A — you negotiate directly with providers
CreditsMay expire after 1 year; 24-hour refund window; fees non-refundableN/A
Latency overheadA network hop you cannot tune~2ms median, 8ms P95 (4 instances, mock endpoint, self-reported)
CachingProvider caching + sticky provider routing to keep it warmRedis, semantic (Redis/Qdrant/Valkey), disk, S3, GCS
Keys, budgets, teamsEnterprise tierFree tier
SSO, audit logs, SLAEnterprise tierEnterprise tier (price not published)
Compliance certsSOC 2 Type 2, GDPR, ZDR, EU regionNone — your deployment, your responsibility
Ops burdenZeroPostgres + Redis + replicas + migrations + on-call

The fee, precisely — because everyone gets it wrong

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.

What OpenRouter's 5.5% credit fee actually costs at different top-up sizes
You top upFee chargedEffective rate
$5$0.80 (minimum applies)16.0%
$10$0.80 (minimum applies)8.0%
$20$1.105.5%
$100$5.505.5%
$1,000$55.005.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%.

“0% markup” — and the fee you actually pay The 5.5% credit fee carries an $0.80 minimum. On small top-ups, the minimum is the fee. 16.0%$5 8.0%$10 5.5%$20 5.5%$50 5.5%$100 5.5%$500 5.5%$1000 Top-up size, and the effective rate you pay on it. Source: OpenRouter FAQ, July 2026.
Same headline fee, wildly different effective rate. Top up in large amounts or the minimum eats you.

BYOK changes the maths more than people realise

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.

What self-hosting LiteLLM really costs

The software is free. Everything around it is not.

What the docs say you need

  • PostgreSQL — stores spend data and virtual keys, with Prisma migrations to run on deploy.
  • Redis 7.0+ — required for caching and cross-replica rate limits.
  • Replicas — LiteLLM recommends one worker per pod at 1 CPU and 4 GiB, scaled horizontally with autoscaling at 60% CPU.
  • A salt key that encrypts provider keys in the database — and which, per the docs, you can never rotate once you have added a model.

The number

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.

The line item everyone forgets

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 break-even, with the maths shown

The formula is trivial and the inputs are the argument:

Break-even monthly spend = (infrastructure + ops labour) ÷ fee

At what model spend does self-hosting beat a 5.5% fee? Below the line, you are paying an engineer to save less than the fee. $200/mo infra $3,600/mo model spend $500/mo infra $9,100 $1,000/mo infra $18,200 $500 infra + 0.1 FTE $36,400 The first two figures are OpenRouter’s own published numbers. The last two are the same formula with honest inputs. Under roughly $10k/month of model spend, self-hosting almost never pays. Over $50k/month, it almost always does.
Break-even = (infrastructure + ops labour) ÷ 5.5%. The labour term is the one that moves the answer.

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.

Four caveats that change the answer

  • The fee is on credit purchase, not usage. You cannot optimise it away with better prompts.
  • BYOK is 5%, not 5.5% — and free below 1M requests a month. Self-hosting saves you less than the headline.
  • LiteLLM does not remove the provider bill. It removes the fee. The tokens still cost what they cost.
  • Your proxy going down has a price. Part of that 5.5% was buying someone else's on-call rota.

Latency

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.

The risk nobody prices

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.

Credit expiry, and an unusually candid answer

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.

Compliance cuts the opposite way to intuition

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.

What actually breaks when you switch

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:

  1. Model slugs. OpenRouter's :nitro, :floor and :exacto variants do not exist anywhere else. That routing logic has to be rebuilt as LiteLLM strategies.
  2. Provider pinning. The 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.
  3. Cache locality. OpenRouter keeps you sticky to a provider so its prompt cache stays warm. Lose that and your hit rate can collapse — see our prompt caching guide for why that costs more than the fee ever did.
  4. Fallbacks. OpenRouter falls back across providers automatically. In LiteLLM you author the chains yourself.
  5. Key management. You now hold N provider keys, encrypted under a salt key you can never rotate.

The hybrid nobody talks about

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.

How to choose, in one table

Which one, by situation
Your situationChoiceWhy
Prototyping, or under ~$3k/month model spendOpenRouterThe fee is smaller than the time you would spend
Using BYOK under 1M requests/monthOpenRouterIt is literally free at that volume
Need SOC 2 to close a dealOpenRouterThey have it. LiteLLM, as software, has nothing to have
Above ~$50k/month model spendLiteLLM5.5% of that funds an engineer and the infrastructure twice over
You have negotiated direct provider ratesLiteLLMA reseller cannot honour a contract it is not party to
Regulated data, VPC-only, air-gappedLiteLLMNothing leaves your network
You need per-team budgets and virtual keys todayLiteLLMFree tier. OpenRouter gates this to enterprise
You are building a product that resells model accessLiteLLMOpenRouter's terms prohibit it, and they now enforce it
Most mid-size teamsBothLiteLLM in front, direct keys for your top models, OpenRouter for the tail

Common mistakes

  • Comparing them as rivals. One sells tokens, one is software. The hybrid is a legitimate answer.
  • Reading "0% markup" as "free". The 5.5% credit fee is 16% on a $5 top-up.
  • Self-hosting to save 5.5% of $2,000/month. That is $110. You will spend more than that reading the deployment docs.
  • Forgetting the labour term. Infrastructure is $200–500. The engineer watching it is $1,500.
  • Assuming self-hosting is the compliant choice. OpenRouter has SOC 2 Type 2. Your Kubernetes cluster does not.
  • Losing cache locality on migration. Round-robin across providers destroys your prompt cache and costs more than the fee saved.
  • Building a reselling product on OpenRouter. Their terms forbid it and, since early 2026, they enforce it.

FAQ

Is LiteLLM like OpenRouter?

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.

Can I use LiteLLM and OpenRouter together?

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.

Is OpenRouter free?

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.

At what spend does self-hosting LiteLLM pay off?

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.

How much does LiteLLM cost to run?

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.

Does LiteLLM add latency?

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.

Does OpenRouter offer volume discounts?

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.

Do OpenRouter credits expire?

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.

Which has better compliance?

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.

Why did OpenRouter start returning 403 errors?

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.

Does LiteLLM support prompt caching?

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.

Is migration between them really just a base URL change?

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.

Does LiteLLM give you virtual keys and budgets for free?

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.

Should I worry about the LiteLLM supply-chain incident?

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.

The bottom line

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.

Sources

  • OpenRouter — FAQ. Retrieved 14 July 2026. Fees, BYOK, credit expiry, refunds, volume discounts, model variants, rate limits.
  • OpenRouter — Provider routing documentation. Retrieved 14 July 2026. Provider object, inverse-square price weighting, quantization filters.
  • OpenRouter — Privacy, logging and ZDR documentation. Retrieved 14 July 2026.
  • OpenRouter — Enterprise page and "OpenRouter vs LiteLLM" blog post, 19 June 2026. Model and provider counts, SOC 2 Type 2, the published break-even figures and the hybrid configuration.
  • LiteLLM — litellm.ai and enterprise page. Retrieved 14 July 2026. Open-source feature set, Docker pulls, enterprise additions.
  • LiteLLM — production deployment documentation. Retrieved 14 July 2026. Postgres, Redis 7.0+, pod sizing, salt key, migration guidance.
  • LiteLLM — caching and enterprise proxy documentation. Retrieved 14 July 2026.
  • LiteLLM — security update on the March 2026 PyPI supply-chain compromise.
  • Hacker News — "OpenRouter Going Rogue?", 2026. The 403 enforcement wave, verbatim user reports and OpenRouter's Discord statement.
  • Hacker News — OpenRouter COO on credit expiry, 2025.
  • TrueFoundry — published self-hosting cost range for an equivalent gateway, 2026.
  • Best AI Gateways — our own gateway landed-price comparison, July 2026.

About this article. Written by the Best AI Gateways research team. Fees, features and limits come from each vendor's own documentation, retrieved 14 July 2026. The break-even figures at $200 and $500 of infrastructure are OpenRouter's own published numbers; the rest is the same formula with the labour term added. Where a benchmark was run by a competitor, we say so.

Published 14 July 2026. Last updated 14 July 2026. 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. Model names and trademarks belong to their respective owners. Pricing is set by each provider and can change — always verify before you build.

Best AI Gateways

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.