API routers

OpenRouter vs LiteLLM: which router for your stack?

OpenRouter vs LiteLLM: which router for your stack?

OpenRouter and LiteLLM solve the same problem, one provider-agnostic endpoint in front of every model, and they charge for it in opposite ways. OpenRouter passes model prices through without markup and earns on the payment layer instead: 5.5 percent plus a 0.80 dollar minimum on each card top-up, or 5 percent of list price on bring-your-own-key usage above a 25,000 dollar monthly allowance, both read from its own documentation on 14 August 2026. LiteLLM charges nothing for the software and everything for the operation: a server, a mandatory Postgres database, Redis once you scale past one instance, and somebody’s time every month. The comparator above puts your volume against both and makes the two crossing points explicit, because there are two, not one.

Managed gateway or self-hosted proxy: what each one costs you

Enter what you spend on model tokens in a month, at provider list price. OpenRouter fee figures read from its own documentation on 14 August 2026. Infrastructure defaults are a 2 vCPU / 4 GB droplet at 24 dollars plus a managed Postgres at 15 dollars, both list prices read the same day, both editable.

The credits path assumes one card top-up a month, billed at 5.5 percent with an 80 cent minimum. The BYOK path bills 5 percent of list price on the portion of usage above the 25,000 dollar monthly allowance included on the pay-as-you-go plan. Self-hosting bills nothing for the software and everything for running it. Model token cost is identical on all three rows, which is exactly the point.

What each one actually is

OpenRouter, a managed gateway with no markup on tokens

OpenRouter is a hosted endpoint. You point an OpenAI-compatible client at it, you name a model, and it forwards the call to whichever provider serves that model, falling back to another one if the first fails. The part most comparisons get wrong is the money: OpenRouter’s documentation states plainly that it passes through the pricing of the underlying providers without any markup, so the per-token rate you pay is the rate the provider publishes. If you want to sanity-check that claim against the source, our breakdown of LLM API pricing per million tokens lists the same published rates, dated the day they were read.

The revenue has to come from somewhere, and it does, just not from the token line. It comes from the payment rail and from the BYOK arrangement, which are the two figures almost nobody puts in a comparison table.

LiteLLM, the same routing layer as software you run yourself

LiteLLM ships the routing layer as an open-source proxy you deploy. The official images live at ghcr.io/berriai, and the database-enabled variant, litellm-database, is the one you want beyond a laptop test. PostgreSQL is not optional: authentication and spend tracking both depend on it, and the deployment docs treat DATABASE_URL as a core configuration variable. Redis joins the list as soon as you run more than one instance, because rate limiting, router state and shared caching need somewhere to live.

There is a paid tier. LiteLLM’s own pricing page, read on 14 August 2026, lists the open-source edition at zero, free forever and self-hosted, and an Enterprise tier priced annually and, in its own words, sized to your annual gateway request capacity, deployment architecture and support needs, never per token. No dollar figure is published, so we cannot put one in the comparator and we have not invented one.

Where the money actually goes

The fees OpenRouter charges, read on 14 August 2026

Everything in this table comes from OpenRouter’s own fee documentation, read on 14 August 2026. Rates change, so treat the date as part of the number.

What is billedRateApplies to
Model tokensProvider list price, no markupEvery request
Credit top-up by card5.5 percent, $0.80 minimumEach purchase of credits
Credit top-up by crypto5 percentEach purchase of credits
Bring your own keys5 percent of what the same call would cost on OpenRouterUsage above the monthly allowance
BYOK allowance, pay as you go$25,000 per month of list-price inferenceNothing billed under it
BYOK allowance, Enterprise$200,000 per month of list-price inferenceNothing billed under it

Read that BYOK row twice. If you already hold provider keys and your list-price inference stays under $25,000 a month, OpenRouter routes your traffic for nothing. Not cheaply. Nothing. That single line kills most of the cost arguments people make for self-hosting a proxy at small and medium scale.

What a self-hosted LiteLLM costs before anyone touches it

The software is free, the deployment is not. A realistic floor, priced against DigitalOcean’s published list on 14 August 2026, is a 2 vCPU and 4 GB Basic droplet at $24.00 a month plus its cheapest single-node managed PostgreSQL cluster at $15.15 a month, so roughly $39 before a single request goes through. Any comparable host lands in the same bracket. That is a floor, not a recommendation: it assumes one instance, no Redis, no high availability, and a database that will need a bigger tier as your spend logs grow.

The line nobody publishes is maintenance, and it decides the comparison. Version pins to bump, provider SDK changes to absorb, a Postgres that fills up, a router config that grows to a few hundred lines, an on-call rotation the day a model alias breaks in production. The comparator defaults to two hours a month at a loaded rate of $90. That is an estimate, not a published figure, and we label estimates as estimates: see how we test. Change it to what your team actually costs and the crossing points move immediately.

The two break-even points, and why there are two

Three cost lines, two crossing points: where self-hosting starts to payOpenRouter billed through card top-ups rises steadily at 5.5 percent of spend. OpenRouter with your own provider keys stays at zero up to 25,000 dollars of monthly spend, then rises at 5 percent. A self-hosted LiteLLM stays flat at 219 dollars a month. The flat line is crossed at about 3,970 dollars of monthly spend by the card top-up route and at about 29,380 dollars by the BYOK route.Three cost lines, two crossing points:where self-hosting starts to pay0500100015002000250030003500010k20k30k40k50k60kBYOK allowance endsMonthly token spend at list price, US dollarsCost on top of tokens, per month, US dollarsbreak-even vs card top-up,about 3,970 dollars a monthbreak-even vs BYOK, about 29,380 dollars a monthOpenRouter, card top-up, 5.5 percentOpenRouter, BYOK, 5 percent above the allowanceLiteLLM self-hosted, 219 dollars a month
Three routes billed against the same token spend. Self-hosting is a flat line, so it crosses the card top-up route near 3,970 dollars a month and the BYOK route near 29,380. Fee rates read on 14 August 2026.

Because OpenRouter has two billing paths, self-hosting has two break-even points against it, and they are far apart. On the default assumptions, a $39 infrastructure floor and two hours of maintenance at $90, LiteLLM costs $219 a month to operate. Against the card top-up path, which bills 5.5 percent, that is matched at roughly $3,970 of monthly token spend. Against the BYOK path, which bills nothing until $25,000 and 5 percent after, the same $219 is only matched at about $29,380.

The gap between $3,970 and $29,380 is the whole decision. Teams comparing against the credits path conclude that self-hosting pays off almost immediately. Teams holding their own provider keys discover the gateway is free for a very long time, and that the saving from running a proxy is smaller than the salary of the person maintaining it.

What the managed side gives you that you would otherwise build

Failover when a provider degrades

Both products fall back to a second provider when the first fails. The difference is who is awake for it. OpenRouter maintains the provider list, the health signals and the routing rules as its product, and its documentation is candid that a failed initial completion adds latency to that request. On a self-hosted LiteLLM the same behavior is a config file you wrote and thresholds you tuned, and it degrades quietly when a provider renames a model and nobody notices for a week.

Key provisioning and per-key budgets

If you resell model access or run multi-tenant workloads, this matters more than price. OpenRouter’s management API creates unique keys per customer instance, attaches an optional credit limit to each, reports the remaining balance, and tracks spend on daily, weekly and monthly windows for both standard and BYOK usage. LiteLLM does virtual keys and budgets too, which is exactly why it needs Postgres, but you own the schema, the migrations and the backups.

The extra hop, and what it costs in latency

A managed gateway adds a network hop you do not control. OpenRouter says it is designed to add minimal latency through edge routing, and documents two effects worth knowing: caches take one to two minutes to warm in a region you have not used recently, and a low credit balance makes it expire caches more aggressively. It recommends keeping at least $10 to $20 on the account for that reason. A self-hosted proxy removes the hop, but only if you run it near your application.

What self-hosting gives you that OpenRouter cannot

Your own keys and your own negotiated rates

Once you hold a committed-spend contract or a provider discount, a gateway that resells at list price stops making sense on the token line. LiteLLM calls the provider with your key at your rate. OpenRouter’s BYOK lets you use your own key too, but it takes 5 percent of the equivalent list price above the allowance, so your negotiated discount partly funds the gateway fee.

Where your prompts travel

With a managed gateway your prompts pass through a third party before reaching the provider. For most teams that is an acceptable trade. For regulated workloads, for a data processing agreement that enumerates subprocessors, or for a customer who reads your architecture diagram before signing, it is a conversation. A proxy in your own network removes one name from that list.

No third party between you and the provider

Self-hosting means your gateway’s availability is your availability, and that cuts both ways. A small team running a single LiteLLM instance with no failover will probably have worse uptime than a managed gateway, not better. Self-hosting wins on independence when you invest in it and loses on reliability when you do not.

Which one fits your stack?

Three thresholds decide it, and they are all volume thresholds. If neither product fits after reading them, the field is wider than these two names suggest: our roundup of routers worth switching to covers the managed and self-hosted options on either side.

Under the allowance, OpenRouter wins on cost too

If your list-price inference is under $25,000 a month and you can bring your own provider keys, OpenRouter charges nothing to route. Self-hosting at that scale is a choice about data path, contracts or independence, and it should be argued on those terms. Arguing it on cost means paying an engineer to save a fee that does not exist.

Past thirty thousand a month, LiteLLM pays for itself

Above roughly $30,000 of monthly spend the 5 percent BYOK fee outruns the cost of running a proxy, and the gap widens fast. At $60,000 a month the fee is $1,750 against $219 of infrastructure and maintenance on the default assumptions. The argument reverses cleanly: an eight-times premium for something you could operate on a budget you already have.

The hybrid most teams end up running

The configuration that survives contact with production is usually both. LiteLLM in front for steady, high-volume, contracted traffic where you hold the keys and the rates. OpenRouter behind it for the long tail: the model you want to evaluate this week, the provider you have no contract with, the fallback when your primary is down. LiteLLM can call OpenRouter as just another provider, so this is a config entry rather than an architecture project.

Frequently asked questions

Does OpenRouter mark up token prices?

No. Its documentation states that it passes through the pricing of the underlying providers without any markup, so you pay the same per-token rate as you would directly. Revenue comes from the credit purchase fee and the BYOK fee instead, which is why comparing per-token prices alone tells you nothing useful.

Is LiteLLM really free?

The open-source proxy is listed at zero, free forever and self-hosted, with no per-token component. What is not free is the server, the mandatory PostgreSQL instance, Redis once you run more than one node, and the time somebody spends keeping it current. An Enterprise tier exists, priced annually and sized to request capacity rather than tokens, with no public figure.

Can LiteLLM route through OpenRouter?

Yes, OpenRouter is one of the providers LiteLLM can target, which is what makes the hybrid practical. You keep direct keys for negotiated traffic and send everything experimental or low-volume through the gateway, without a second integration in your application code.

Which one adds more latency?

A managed gateway adds a hop you do not control, and OpenRouter documents two cases where it shows: a cold regional cache in the first minute or two, and more aggressive cache expiry when your credit balance runs low. A self-hosted proxy removes that hop, but only if it runs close to your application, and it adds your own queueing under load.

Who sees my prompts and my spend data?

On the managed route OpenRouter sits between your application and the provider, so it is a subprocessor you have to declare. Self-hosted, prompts go straight from your network to the provider and spend data lives in your own PostgreSQL database, which also makes retention, backups and access control yours to write.