Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

OpenRouter vs LiteLLM: hosted model API or self-run gateway?

OpenRouter is the one for solo builders and small teams who want a hosted key for lots of models with no servers to run. LiteLLM is the one for teams with a platform group who want to self-host, keep traffic and keys inside their own stack, and stretch the gateway to tools and agents. They solve the same problem from opposite sides.

Two ways to put one API in front of hundreds of models

If you're building with AI, you'll hit the same wall sooner or later: every model provider has its own key, its own format and its own outages. Both of these put one OpenAI-compatible API in front of many models, so your code talks to one thing. Where they part company is who runs that one thing. That's the decision, and it's worth making before you look at catalogue sizes.

A service you sign up to, or software you operate

The first is a hosted service. You sign up, load credits onto your account, get an API key and start sending requests. There's nothing to install and nothing to keep running. It says it covers 600+ models across 80+ providers, with automatic fallbacks to another provider when one goes down.

The second is open-source software you run yourself. The quick start installs it with a curl script, and the docs describe a proxy with an admin UI. Your team owns the servers, the keys and the traffic. It's a gateway and a Python SDK in one, and it claims one OpenAI-compatible API to 140+ providers and 1,800+ models.

So they're not like-for-like, even though they get compared all the time. One is a web service you sign up to. The other is a piece of infrastructure your engineers look after. Neither site's own pages spell out the commercial side in full, so check each vendor's live terms before you commit.

How the two line up

QuestionOpenRouterLiteLLM
Where it runsHosted: sign up, add credits, get a key, send requestsOpen source and self-hosted, installed with a curl script, with a proxy and admin UI
Who it's pitched atIndividual developers and teams, with an org set up laterPlatform teams, with SSO, per-team scoping and usage caps
Beyond modelsRouters, presets, guardrails and a batch API in its docsLLMs, MCP servers and A2A agents behind one gateway, plus an agent SDK
RoutingAutomatic provider fallbacks and an Auto RouterRetry and fallback across deployments via its Router, plus an Auto Router in the docs
Data and accessData policies so prompts only reach providers you trust; SSO, SCIM and in-region routing in the docsVirtual keys, usage tracking, admin UI and SSO scoped by team, project or app
Catalogue claim600+ models, 80+ providers, 250k+ apps140+ providers, 1,800+ models, day-zero support for new models

Routing, guardrails and who holds the keys

Both handle fallbacks. The hosted service switches providers automatically when one fails, and a recent post on its blog describes an Auto Router that picks a route using live provider health and benchmarks. The self-run gateway has built-in retry and fallback across multiple deployments through its Router, and its docs list an Auto Router too.

On control, the hosted service lets you set data policies so prompts only go to the models and providers you trust, and its docs list SSO, SCIM and in-region routing. The self-run gateway gives you virtual keys, usage tracking, an admin UI and SSO scoped by team, project or app. If your security team wants every request to stay inside your own network, only one of these can do that by design.

One small overlap: both sets of docs list the same Jev decision-model integration, so if that's part of your stack, it won't separate them.

Where the self-run gateway reaches further

It doesn't stop at language models. It puts LLMs, MCP servers and A2A agents behind the same gateway, and it ships an agent SDK alongside the Python SDK. If you're planning a wider agent setup and want one control point for all of it, that's a real reason to pick it. The hosted service keeps its focus on models and providers, with routers, presets, guardrails and a batch API listed in its docs. For a lot of builders that's all they'll ever need.

Our verdict: pick on who runs it, then on scope

If you want a hosted key for lots of models with no servers to run, OpenRouter is the simpler path, and solo builders will usually lean that way. If you've got a platform group that wants to self-host, keep traffic and keys inside your own stack and extend the gateway to tools and agents, LiteLLM fits that brief better. Neither is the better product in general; they're built for different people.

Other gateways, including two that have changed hands

Two names you'll see in older comparisons have moved on, so read their current home pages carefully. For the wider field, see the full list of LLM gateways, or the page of hosted model APIs people use instead.

Portkey

Best for: Gateway, observability, guardrails, governance and prompt management in one platform; its home page says Portkey is now PRISMA AIRS AI Gateway.

Work with me

Want AI doing the heavy lifting in your marketing?

I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.

Helicone

Best for: Routing, debugging and analysing LLM applications through an AI gateway with observability; its banner says it's no longer part of Mintlify.

Vercel AI Gateway

Best for: Teams already building with the AI SDK who want a gateway through a base URL swap, with models and leaderboards pages alongside.

Cloudflare AI Gateway

Best for: A unified OpenAI-compatible API with caching, rate limiting, usage limits and routing, plus a long list of native providers.

Do you make an LLM gateway or model routing tool? Tool makers can ask to be considered for a featured place on this page.

Want your tool on this list? Featured spots and reviews here are paid partnerships. Here's how to partner with me.

Frequently asked questions

Is LiteLLM open source?

Yes. It's open-source software you host yourself, installed with a curl script, and it comes with a proxy and an admin UI.

Do I need my own servers for OpenRouter?

No. It's a hosted service: you sign up, add credits, get an API key and send requests.

Which has more models?

The self-run gateway claims 1,800+ models across 140+ providers; the hosted service claims 600+ models across 80+ providers. Both are each vendor's own numbers.

Can either one route MCP servers and agents?

The self-run gateway puts MCP servers and A2A agents behind the same gateway as your models. The hosted service centres on models and providers.

What happens when a model provider goes down?

Both fall back. The hosted service switches providers automatically, and the self-run gateway retries and falls back across deployments through its Router.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.