Head to head

LiteLLM vs OpenRouter: self-hosted proxy or hosted router?

LiteLLM runs on your servers. OpenRouter is a hosted API in front of 400+ models. We compare cost, privacy, setup and control, with a worked fee example.

LiteLLM and OpenRouter both give your code one OpenAI-style API for many models. The difference is where that API lives. LiteLLM is open-source software you run on your own servers. OpenRouter is a hosted service: you send requests to openrouter.ai and it forwards them to the provider. Pick LiteLLM for control and data residency, OpenRouter for zero setup.

Facts checked between 27 November and 2 December 2026.

At a glance

LiteLLMOpenRouter
What it isOpen-source Python SDK and proxyHosted API in front of 400+ models
Where it runsYour serversOpenRouter's infrastructure
What you payYour infrastructure; Enterprise licence for SSO beyond 5 users, audit logs and moreProvider prices plus a 5.5% fee on credit purchases
Your own provider keysYes, alwaysYes, free up to $25,000 a month of usage, then 5%
Your own GPUsYes, as any other providerNot its purpose: it routes to hosted providers
Prompt loggingOff by default, opt-inOff by default, opt-in
Keys, budgets, rate limits per userYes (virtual keys)Credit limits per API key, inside one account
Who owns itBerriAIStripe, since 10 November 2026

Where the router lives

This is the decision that matters, and everything else follows from it.

With LiteLLM, the request path is your app → LiteLLM proxy on your servers → provider. Your provider keys stay in your environment, and if you run models on your own GPUs, traffic to them never leaves your network. The price is operations: the proxy needs Postgres, and Redis once you run several instances (LiteLLM docs). LiteLLM recommends four workers on a 4 vCPU host.

With OpenRouter, the path is your app → openrouter.ai → provider. There is nothing to install, patch or scale. You get one key and access to more than 400 models (OpenRouter). Every request leaves your network and passes through a third party, even when you bring your own provider keys.

Cost: what each one actually charges

LiteLLM's open-source gateway is free. You pay for the servers, the database and the engineer time to run them. Enterprise features are licensed, and the price is quote-only (LiteLLM Enterprise). See LiteLLM Enterprise pricing for what the licence adds.

OpenRouter passes provider prices through without markup and charges a 5.5% fee when you buy credits, with a $0.80 minimum (OpenRouter FAQ). Here is what that means in practice:

Monthly model spendOpenRouter fee (credits)LiteLLM fee
$500$27.50$0, plus hosting
$5,000$275$0, plus hosting
$50,000$2,750$0, plus hosting

If you bring your own provider keys to OpenRouter instead of buying credits, the first $25,000 of monthly usage carries no fee and usage above that costs 5% of what it would cost on OpenRouter. So at $50,000 a month on your own keys, the fee is about $1,250. Full breakdown in OpenRouter pricing explained.

At low volume, OpenRouter's fee is usually cheaper than an engineer's time running a proxy. At high volume, the fee becomes a line item worth questioning.

Privacy and data handling

Neither stores your prompts by default. LiteLLM only writes request and response content to its spend logs if you turn on store_prompts_in_spend_logs. OpenRouter doesn't log prompts unless you opt in, which earns a 1% discount, and lets you restrict routing to zero-data-retention endpoints (OpenRouter FAQ).

The real difference is the hop. With LiteLLM, only the model provider sees your prompts. With OpenRouter, OpenRouter's infrastructure processes them too. That may be fine for your use. For regulated data it often isn't. We look at this in more detail in Is OpenRouter safe?

Control over people and spend

LiteLLM's open-source gateway includes virtual keys, budgets, rate limits and spend tracking per key, user and team. SSO for the admin UI is free for up to 5 users; after that it needs an Enterprise licence.

OpenRouter is built around an account with API keys. You can give each key a credit limit, reset daily if you like (OpenRouter docs), but it isn't designed to manage hundreds of internal users with their own budgets and model lists.

Security track record

LiteLLM had two supply-chain incidents in 2026, where malicious releases were published to PyPI (versions 1.82.7 and 1.82.8 in March, 1.107.0 in October). Both were fixed within hours. If you run LiteLLM, pin exact versions and verify images. Details in the LiteLLM supply chain attack, explained.

OpenRouter has no software for you to install, so that particular risk doesn't apply. The trade-off is that you depend on a third party's uptime and policies.

Which one should you pick?

  • Pick OpenRouter if you're a small team, want access to many models today, and are comfortable with requests passing through a hosted service.
  • Pick LiteLLM if data must stay in your environment, you need per-user budgets, or your volume makes a percentage fee expensive.
  • Use both if you want LiteLLM's control with OpenRouter's catalogue: LiteLLM can call OpenRouter as one of its providers.

A third option if you run your own GPUs

If part of your traffic should go to your own vLLM or Ollama servers, AI Gateway by LayerX is built for that case. It runs on your servers (or we host it for you), sends requests to your GPUs first and moves to vendors like OpenAI, Groq or OpenRouter when needed. Each person gets their own keys, daily and monthly token budgets and a list of allowed models, and prompts are never stored.

It is narrower than LiteLLM: it supports OpenAI-compatible providers only (Anthropic and Gemini go through OpenRouter), and has no caching or guardrails. Compare all three in AI Gateway vs LiteLLM and AI Gateway vs OpenRouter. For Vercel's hosted gateway, see LiteLLM vs Vercel AI Gateway.

Questions

Is LiteLLM cheaper than OpenRouter?

LiteLLM has no usage fee, but you pay for hosting and operations. OpenRouter charges 5.5% on credit purchases, or 5% on bring-your-own-key usage above $25,000 a month. At small volumes OpenRouter is usually cheaper overall; at large volumes LiteLLM usually is.

Can I self-host OpenRouter?

No. OpenRouter is only available as a hosted service. If you want the same one-API pattern on your own servers, look at LiteLLM, Bifrost or AI Gateway. See self-hosted OpenRouter alternatives.

Can LiteLLM use OpenRouter as a provider?

Yes. LiteLLM supports OpenRouter as a provider, so you can keep keys, budgets and logging in LiteLLM and still reach OpenRouter's model catalogue.

Does OpenRouter store my prompts?

Not by default. Logging is opt-in, and you can restrict routing to providers with zero data retention in your privacy settings.

More posts

Keep reading.

See how AI Gateway fits your setup.

Tell us what you run today and how many people need access. We'll get back to you to learn more about your setup.

See how AI Gateway fits your setup.

What do you run today?