LiteLLM vs OpenRouter cover: a glass and chrome two-route fork splitting toward a self-hosted server stack and a hosted gateway node with one amber key, MODELLIX top left

“LiteLLM vs OpenRouter” is not really a product question. It is a form question: do you run the routing layer yourself, or do you point at a hosted endpoint? LiteLLM is an open-source AI gateway you deploy—a process you operate, holding your provider keys, doing your logging. OpenRouter is a managed gateway—a base URL you call, with credentials and billing handled behind it. Most of the content ranking for this query is written by gateway vendors pitching themselves; this article instead breaks the decision into three axes—operations, credentials, and billing—and verifies every claim against each party’s official pages, fetched on September 2, 2026.

One boundary before we start: this is not another list of OpenRouter alternatives. If your question is “which hosted gateway should I pick once I’ve decided not to self-host,” the OpenRouter alternative guide compares the hosted options head to head. This article answers the question that comes first: should the gateway be your process at all? It is published by Modellix, which sells a hosted text-model gateway, so treat our entry as a data point with a disclosed interest—we flag where we lose, and we do not crown a winner.

The decision is about form, not features

Both tools solve the same problem: your application speaks one API dialect and reaches many model providers through it. The difference is who runs the thing that translates between your app and the providers.

A self-hosted proxy like LiteLLM is software you deploy. Its GitHub README calls it “Open Source AI Gateway for 100+ LLMs. Self-hosted. Enterprise-ready,” usable as a Python SDK or deployed as a proxy server. A hosted gateway like OpenRouter is the same layer run by someone else: you call https://openrouter.ai/api/v1, and routing, failover, and per-provider credentials are handled for you. OpenRouter’s own comparison post states the frame plainly: “the decision comes down to where the routing layer should run.”

For agent users, the decision has a concrete shape. If your agent harness exposes a custom provider configuration, the question is what its baseURL points at: a process on your own machine or network (LiteLLM’s default is http://0.0.0.0:4000), or a hosted endpoint. Everything else—model IDs, key, bill—follows from that one line of configuration. The DeepSeek Harness hub explains where that provider configuration lives, and the custom model guide shows the exact settings block. We frame the comparison through that lens because that is where you will feel the difference, but the analysis applies to any OpenAI-compatible client.

Gateway form fork: one agent node splits at a baseURL decision toward a self-hosted proxy panel with provider keys, or a hosted gateway panel with one key

The fork in one diagram: both forms speak the same API to your agent; the baseURL decides who operates the routing layer, whose keys it holds, and where the money flows.

LiteLLM vs OpenRouter at a glance

LiteLLM OpenRouter Modellix LLM
Form Self-hosted proxy + SDK (open source) Hosted gateway (managed SaaS) Hosted gateway (managed)
Who operates it You (process, database, upgrades) OpenRouter Modellix
Credentials You collect and store each provider’s key; virtual keys for internal access control One OpenRouter key; optional BYOK above a free allowance One Modellix API key for all protocols
Billing structure Free core (MIT); you pay providers directly at list price, plus your infrastructure Provider pricing passed through with no markup; 5.5% fee on credit purchases ($0.80 minimum); crypto 5% Pay-as-you-go; most models below the listed official price, some with no discount
Published SLA / uptime promise N/A—you operate it Enterprise contracts only Not published in docs

As of September 2, 2026, from official pages. None of the three publishes a public uptime percentage or an automatic-failover guarantee; where an SLA exists it is contractual. Verify current pricing before committing—all three change terms without notice.

Axis 1 — Operations: who runs the gateway

Self-hosting is a feature with a running cost, and that cost is a person or a team.

LiteLLM’s proxy quick start shows how small the happy path is: install with uv tool install 'litellm[proxy]', run litellm --model <model>, and the proxy listens on http://0.0.0.0:4000 with an OpenAI-style /chat/completions endpoint. Teams that need the routing layer to survive production add more: the README documents a Helm chart, signed Docker images on ghcr.io/berriai/litellm, and one-click deploys on Render and Railway, and Terraform modules for AWS and GCP, while OpenRouter’s comparison post summarizes the standard production topology as “PostgreSQL stores spend data and keys; Redis handles caching and rate limits in production.” That is the real form difference: a proxy is a service your team owns—deployments, secrets, upgrades, backups, capacity, and pager duty for a layer every AI feature in your product sits behind.

Hosted gateways remove that category of work. There is no process to patch and no database to back up, because there is no infrastructure on your side—you hold a key and call an endpoint (OpenRouter on Cloudflare’s edge, Modellix at https://llm.modellix.ai). The trade is architectural: with a self-hosted proxy, request data stays inside your network until it reaches the provider; with a hosted gateway, requests pass through a managed layer first. If data-residency rules are your binding constraint, that single fact can decide the question before any other axis matters.

Axis 2 — Credentials: one key you create, or keys you collect

The second axis is about who holds provider credentials, and it quietly decides how much governance work lands on you.

With a self-hosted proxy, you are the aggregator. The LiteLLM proxy does not sell you model access; it holds the keys you bring. Someone on your team collects an OpenAI key, an Anthropic key, a Bedrock setup—whatever you want behind the gateway—and stores them where the proxy can read them. LiteLLM’s virtual keys documentation then gives you the internal control plane: generate keys for users or teams, restrict each to specific models, attach budgets and rate limits, and read spend back per key, per user, or per team. Useful—it is the pattern every platform team eventually wants—but it assumes you are operating a secrets store, a key lifecycle, and a spend-reporting surface. The enterprise tier exists precisely because those controls (SSO, audit logs, secret-manager integration) are work; LiteLLM’s enterprise docs describe the tier as for “teams running LiteLLM at scale” needing those controls “on top of OSS,” priced through sales.

A hosted gateway inverts this: you create one key on their side and stop collecting vendor keys entirely. OpenRouter runs on credits with a single API key; its FAQ describes Bring Your Own Key as an optional path with a free allowance measured in list-price inference ($25,000 per month on pay-as-you-go) and a 5% fee above it. Modellix takes the same one-key shape: a single key from the Modellix console authenticates the whole gateway.

Hosted gateways also answer a question self-hosters eventually hit: who was the end user? With LiteLLM, per-user attribution is something you build from its key and user tables. A hosted gateway can ship it: Modellix documents an optional X-Mdlx-User-Id header on every request, and a GET /v1/logs endpoint that filters history by that id, with each entry carrying per-request cost, prompt_tokens, completion_tokens, and cached_tokens—the data you need to bill back a customer or department without building a reporting pipeline. Relatedly, GET /v1/models runs on a separate query rate limit from inference, so a monitoring loop listing models does not eat your inference quota. Neither alone justifies hosted over self-hosted; both are examples of what you get when the gateway is someone else’s product.

Axis 3 — Billing: where the money flows

Pricing is where the marketing gets loudest and official wording matters most, because the two sides are not charging for the same thing.

LiteLLM is free software, not a free gateway. The core is MIT-licensed (the repository LICENSE covers everything outside its enterprise/ directory under MIT). You pay each provider its list price through the keys you brought, pay the infrastructure bill for the proxy, its database, and its cache, and pay your engineers’ time to run it. The enterprise tier is a commercial license priced through sales with a 30-day trial. The honest answer to “does LiteLLM cost money”: the software is free; the gateway isn’t.

OpenRouter is a pass-through with a fee on the way in. Its FAQ is explicit: “We pass through the pricing of the underlying model providers without any markup, so you pay the same rate as you would directly with the provider.” The cost shows up when you fund your account: “OpenRouter charges a 5.5% ($0.80 minimum) fee when you purchase credits,” and crypto payments run 5%; the pricing page also lists 5% BYOK fees above the free allowance. So the “openrouter markup” question has a precise answer: no per-token markup, and a payment-channel fee. That is why OpenRouter’s own comparison post frames self-hosting as arithmetic: at roughly $200/month of infrastructure, a proxy gets cheaper than the fee once inference spend passes about $3,600/month. Run that math on your numbers, not theirs.

Modellix prices in the opposite direction, and we should say exactly how. The Modellix LLM pricing page shows each model with the official list price struck through next to the Modellix rate; on most models the Modellix rate is below that listed price—the Anthropic rows read, verbatim, 3% OFF, and other families carry larger discounts. Top-ups go through Stripe with no published purchase fee, and successful responses are billed from token usage. Honest caveats, because this is a young product: not every model is discounted, prices drift and are worth checking on the day you commit, and there is no automatic signup credit—the $1 registration credit was retired in August 2026, with trial credit available by request. Nor is this a claim that Modellix is the cheapest gateway; fee structure and volume matter more than the per-token list price, and we do not price-rank ourselves.

The three forms differ structurally in who you pay and what the price includes: with a self-hosted proxy you pay providers at list price plus your own infrastructure; with OpenRouter you pay list price through a credit channel with a purchase fee; with Modellix you pay a hosted rate that sits below the listed price on most models. That is not “who is cheapest”—it is the billing axis of a form decision.

When to self-host an LLM proxy

Choose the self-hosted form when the constraints are yours to own. The strongest cases, in order:

  • Data residency or network policy. If requests must not cross your network before reaching a provider, a hosted gateway is disqualified by architecture, and LiteLLM is the natural answer—the only form where the routing layer lives on your side.
  • Deep control of routing and governance. LiteLLM documents fallbacks, load balancing, budgets, and request logging in the open-source core; the enterprise tier adds SSO, audit logs, and secret-manager integration. If you want policy encoded in your own gateway and will operate it, the proxy wins on capability, not just price.
  • Spend is large enough that the fee math flips. At tens of thousands of dollars of inference per month, a 5.5% purchase fee or a below-list hosted rate is a real line item, and a proxy you already operate starts to look cheaper at the margin.

When a hosted gateway wins

Choose the hosted form when the gateway is not your product:

  • You are a small team or an individual developer. Running a tier-0 service—database, cache, upgrades, pager duty—so you can call models is a bad trade until you have a platform team or a real bill. A hosted gateway is the difference between an afternoon and a project.
  • You want one key and one bill across many providers. That is the entire product of a hosted gateway: no vendor-key collection, no secrets store, no spend tables to aggregate.
  • You want observability without building it. If per-request cost and token detail, end-user attribution, or a model list that does not consume inference quota matter to you, compare what hosted gateways document before assuming you will self-build those on top of a proxy.

A final note for harness users: the two forms compose. A self-hosted LiteLLM proxy can use OpenRouter as an upstream provider, so the choice is not always either/or—one proxy config can point at direct provider keys for some models and a hosted gateway for others. What you cannot do is skip the form decision, because your harness’s baseURL still has to point somewhere.

What a hosted gateway should prove before you trust it

If you land on the hosted form, evaluate gateways against the things a proxy would have forced you to build:

  • Protocol surface. Which API shapes does it speak? Modellix documents Chat Completions, Responses, and Anthropic Messages on the same host—POST /v1/chat/completions, POST /v1/responses, and POST /v1/messages at https://llm.modellix.ai—with a warning that the three endpoints use different body shapes, per its API guide. If your clients are Anthropic-native (Claude Code, the Anthropic SDK), whether a gateway documents a Messages-compatible endpoint is a first-round filter.
  • Logs and cost visibility. Per-request cost and token counts through an API, or only a dashboard? Modellix’s GET /v1/logs returns both per request within a start_time/end_time window.
  • Attribution. Can you tag requests by end user? The X-Mdlx-User-Id header plus log filtering is how Modellix documents per-end-user attribution—the B2B case of reselling agent capability.
  • Model catalog mechanics. Does the gateway keep a stable alias per model family? Modellix documents ~provider/series-latest IDs (for example ~openai/gpt-latest) that re-target when a new model ships, so agent config does not break on every release.
  • Billing transparency and published limits. Is the pricing structure stated in words you can verify, and are rate limits documented rather than guessed? None of these gateways publishes an uptime percentage, so treat availability claims as unverified until a vendor posts numbers.

That checklist doubles as our self-disclosure: Modellix is a hosted text gateway, and the LLM overview states the boundaries plainly—it returns text, image and video generation stay on the media API, there is no published SLA or automatic-failover description in the docs, and some models carry no discount. The unified AI API guide explains the aggregation model behind a single key if you want the broader context.

The bottom line

LiteLLM and OpenRouter are not competitors in the usual sense; they are the two forms of the same layer. Decide the form first; feature lists only make sense after that.

If your main reason is Start with
Requests must not leave your network Self-host a LiteLLM proxy
Deep control of routing, governance, and audit Self-host a LiteLLM proxy (enterprise tier for SSO and audit logs)
Inference spend large enough to flip the fee math Self-host—after running the arithmetic on your own numbers
No infrastructure budget or platform team A hosted gateway (OpenRouter, Modellix, or the sibling gateway guide’s field)
Per-end-user cost attribution without building it A hosted gateway with documented per-request logs (Modellix GET /v1/logs + X-Mdlx-User-Id)
Anthropic-native clients without running a proxy A hosted gateway that documents a Messages-compatible endpoint

Whichever form you lean toward, verify the three axes on the vendors’ live pages before committing—operating model, credential model, and billing structure are all subject to change without notice. This article was published by Modellix, which sells a hosted text-model gateway; our interest is disclosed, we are not claiming to be the cheapest or most complete option, and the sibling OpenRouter alternative guide on this blog covers the hosted field if you want more entries to compare.

Compare Gateway Options on Modellix

Log in to create a Modellix API key and check live per-model pricing before you commit to a gateway form.

Login

Frequently Asked Questions

Is LiteLLM like OpenRouter?
They solve the same problem from opposite forms. LiteLLM is an open-source proxy and SDK you deploy and operate—you bring the provider keys, and it gives you a unified OpenAI-style API plus virtual keys, budgets, and spend tracking. OpenRouter is a hosted gateway: one key, no infrastructure, routing handled for you. Which one is right is a question about who should run your routing layer, not about features.

Is LiteLLM free?
The core project is free under the MIT license; code under the repository’s enterprise/ directory carries a separate commercial license. “Free” covers the software—you still pay providers at list price, pay for the infrastructure the proxy runs on, and pay for the engineering time to operate it. The enterprise tier is a paid license via LiteLLM’s sales team.

Does OpenRouter add a markup or a fee?
Per its official FAQ, OpenRouter passes through provider pricing with no markup on inference. The fees sit on funding and BYOK: 5.5% ($0.80 minimum) when you purchase credits, 5% for crypto payments, and 5% on BYOK usage above the plan’s free allowance. That is the precise answer behind the “openrouter markup” question.

Can LiteLLM and OpenRouter work together?
Yes. LiteLLM supports OpenRouter as an upstream provider, so a self-hosted proxy can route some models to OpenRouter and others to direct provider keys. The two forms compose; your harness’s baseURL can point at both through one proxy.

When should I self-host an LLM proxy?
When owning the routing layer is worth its operating cost: strict data-residency requirements, deep control over routing and governance, or an inference bill large enough that platform fees exceed what your team pays to run the proxy. If none of those applies, a hosted gateway is usually the cheaper form.

Is OpenRouter an alternative to LiteLLM?
For the “don’t operate anything” use case, yes—both expose OpenAI-compatible APIs over many providers, and switching is mostly a base URL and key change. If you are weighing hosted gateways against each other, the OpenRouter alternative guide on this blog covers the broader field; this article covers the form decision itself.


Provider details, pricing, and fees reflect each vendor’s official pages as of September 2, 2026, and change frequently—validate against live pricing before committing. This article was published by Modellix, a commercial party that sells a hosted text-model gateway at llm.modellix.ai; it is not a claim that Modellix is the cheapest or most complete gateway. Access language models from Anthropic, DeepSeek, Google, OpenAI, Qwen, xAI, and more through one API key at modellix.ai.