---
title: "OpenRouter vs LiteLLM: Which LLM Gateway to Build On"
author: "Nate Laquis"
author_role: "Founder & CEO"
date: "2026-11-23"
category: "AI & Strategy"
tags:
  - litellm vs openrouter
  - openrouter vs litellm
  - LLM gateway
  - OpenRouter BYOK pricing
  - self-hosted LLM proxy
excerpt: "OpenRouter is the right gateway for most products adding AI features. LiteLLM wins when prompts have to stay inside your own cloud or when you resell model access with a budget per customer."
reading_time: "12 min read"
canonical_url: "https://kanopylabs.com/blog/openrouter-vs-litellm-which-llm-gateway-to-build-on"
---

# OpenRouter vs LiteLLM: Which LLM Gateway to Build On

## The short answer

For most founders adding AI features to a product, build on OpenRouter: one API key, one bill, more than 600 models, and nothing to host. Pick LiteLLM instead when prompts must never leave your own cloud, or when you resell model access and need a hard budget per customer. LiteLLM is the better tool for a platform team, and OpenRouter is the better tool for a product team that wants to ship this month.

The two get compared because both give you one OpenAI-style endpoint in front of many model providers. That is where the overlap ends. OpenRouter is a hosted marketplace. You buy credits, send requests to its servers, and it picks a provider for each one. LiteLLM is open-source software you run yourself: a Python SDK, plus a proxy server you deploy on your own machines, with a paid enterprise license on top.

So the real choice is between renting a gateway and owning one. This post walks through fees, latency, outages, fallbacks, who can read your prompts, budgets and lock-in, then maps common products to a pick. If you are still deciding between a gateway and a cloud provider's own model service, read [OpenRouter vs AWS Bedrock vs Azure AI Studio](/blog/openrouter-vs-aws-bedrock-vs-azure-ai-studio) first. This one assumes you want a gateway and are down to these two.

## How each one works

### OpenRouter

You create an account, add credits, and point any OpenAI-compatible client at OpenRouter's base URL. Model names carry the vendor as a prefix, like **anthropic/** or **openai/**. Behind each model sit one or more providers, and OpenRouter spreads your traffic across them. If one provider errors or rate-limits you, the request goes to another one serving the same model. You never sign up with Anthropic, OpenAI or Google. OpenRouter holds those relationships and bills you from your credit balance.

The pricing page lists more than 600 models from more than 80 providers on the paid plans. New models tend to show up there quickly, which is most of the appeal for teams that test a new model every few weeks.

### LiteLLM

LiteLLM comes in two pieces. The SDK is a Python library: you call one completion function with a model string and it translates the request into each provider's format. The proxy, which LiteLLM now calls its AI Gateway, wraps that library in a server you run in Docker or Kubernetes, backed by Postgres for keys and spend and Redis once you scale out. Your app calls the proxy, and the proxy calls the providers with keys you hold.

The project says it supports more than 140 providers and 1,892 models. The newest stable release on PyPI as of this week is 1.110.2, with 1.111 in release candidates. It ships often, sometimes several builds a day, so plan for upgrades as routine work. The core is MIT licensed and free to self-host. There is also a managed LiteLLM Cloud, still labeled beta on the site, which I would not build a product on yet.

![Fiber optic cables plugged into a network switch in a server rack](https://images.unsplash.com/photo-1594915440248-1e419eba6611?w=800&q=80)

## What you pay

Neither tool marks up tokens. Where the money goes is different.

### OpenRouter fees

- **Standard plan:** a 5.5% fee when you buy credits, with a $0.80 minimum per purchase. Crypto purchases are 5%. Inference itself is billed at the provider's list price.

- **Business plan:** 8% on credit purchases. You get EU and US in-region routing, up to 1,000 workspaces instead of 5, and a signed DPA on request.

- **Enterprise:** fees set by contract, with invoicing, SSO, contractual SLAs and custom BYOK limits.

- **BYOK:** bring your own provider keys and the provider bills you directly. The first $25,000 a month of list-price inference through your own keys carries no OpenRouter fee. Past that, OpenRouter takes 5% of what the same request would have cost on its platform, out of your credits.

Put numbers on it. At $3,000 a month of model spend on credits, the Standard fee is about $165. At $20,000 a month it is about $1,100. That is the point where founders start asking about self-hosting, and BYOK is usually the better answer. Move your main provider onto your own key and the fee drops to zero until you pass $25,000 a month. You keep OpenRouter's routing and dashboard, and you get your own rate limits and your own invoice from the provider.

### LiteLLM costs

The open-source proxy costs nothing to license. You pay for where it runs. A small production setup, meaning two proxy containers, a managed Postgres and a small Redis, runs roughly $100 to $400 a month on AWS or Google Cloud depending on size and region. That is my estimate from typical instance prices, not a quote. LiteLLM's own sizing guide plans for about 100 requests per second per four-worker pod on an AWS c7a.2xlarge.

The bigger cost is a person. Someone has to own upgrades, database migrations, pinned versions and the pager. For a team with one backend engineer, that is a few hours every month taken from product work.

LiteLLM Enterprise adds SSO and SCIM, audit logs, team admins, secret managers, IP allowlists and a support SLA. Pricing is not public. The docs say it is based on usage, quoted by sales, with a free 30-day trial. They aim it at teams with 100 or more users or ten or more AI use cases in production. SSO is free for up to five users, so a small team can stay on the open-source version for a long time.

## Latency and reliability

Every gateway adds a hop. The question is how big, and who fixes it when it breaks.

### OpenRouter

OpenRouter runs on Cloudflare Workers at the edge and caches user and key data close to your servers. It does not publish a fixed overhead number. Its FAQ says latency varies by model, provider and region, and tells you to pin one model and one provider if you need it consistent. One detail most teams learn the hard way: when your credit balance drops into single digits, or a key gets close to its credit limit, OpenRouter checks balances more often and requests slow down. Turn on auto top-up before launch.

OpenRouter has also gone down. On February 17, 2026 it had a 38-minute outage starting at 5:27 UTC, with 80 to 90% of API requests failing at the worst point. Two days later, on February 19, a 35-minute outage followed with near-total downtime for most of it. Its postmortem traced both to a third-party caching dependency and listed the circuit breakers it added. Provider failover is no help when the router itself is down, so a product where AI is the core feature needs a second path to at least one provider.

### LiteLLM

LiteLLM publishes benchmarks. Against a mock endpoint, four instances handled 1,170 requests per second with 8 ms of gateway overhead at p95. The production guide is more useful: past a pod's comfortable load, p99 overhead went from 47 ms at 100 requests per second to 651 ms at 200. An undersized proxy is slower than no proxy.

The security record matters more than the speed. LiteLLM had a rough 2026. On March 24, malicious builds 1.82.7 and 1.82.8 were published to PyPI and live for about 40 minutes. On April 20, a critical pre-auth SQL injection, CVE-2026-42208, was published, and the Cloud Security Alliance reported it exploited about 36 hours after it was indexed. On October 21, the release pipeline itself was hijacked and pushed a malicious 1.107.0 to PyPI for about two hours and to the Docker latest, main-latest and main-stable tags for about two and a half. That build stole credentials. Enterprise customers pulling from the private registry were not affected.

None of that rules LiteLLM out. Releases have since moved to keyless signing, and the October post lists every affected artifact by digest. It does mean that if you self-host, you pin exact versions and image digests, you never deploy the latest tag, and you read the security blog. A gateway holds every provider key you own, which makes it the most valuable box in your stack to an attacker.

## Fallbacks and routing

OpenRouter gives you two kinds of failover with almost no setup. Inside one model, it moves between providers on its own. Across models, you pass a list in the request and it tries them in order, billing you at the price of the model that answered. If a free model sits ahead of a paid one and the free one fails, you pay the paid price. You can also set provider preferences, such as only providers that do not retain data, or a cheaper provider first.

LiteLLM gives you more control and more to configure. You define model groups in a YAML file, each with several deployments, such as the same model on OpenAI and on Azure under your own keys. The router spreads load across them, retries, puts failing deployments on a cooldown and falls back to other groups. It also has fallbacks for context-window errors and content-policy refusals, and routing strategies based on latency, usage or least-busy. Because it is Python, you can write your own rule when none of those fit.

For one product calling two or three models, OpenRouter's request-level fallback list covers what you need. If you are splitting traffic across several of your own provider accounts to stretch rate limits, LiteLLM is built for that job. For a deeper look at how LiteLLM's routing compares with Portkey's config-driven gateway, see our [Helicone vs Portkey vs LiteLLM comparison](/blog/helicone-vs-portkey-vs-litellm-llm-proxy).

![Rows of black server racks in a data center aisle](https://images.unsplash.com/photo-1506399558188-acca6f8cbf41?w=800&q=80)

## Who sees your prompts

This is the section that decides it for regulated products, so be precise about it.

With OpenRouter, your prompt passes through OpenRouter on its way to a provider. By default it logs request metadata such as time, model and token counts, and does not store prompts or completions. You can opt in to prompt logging for a 1% discount. Zero data retention is a routing option on every plan: set it per account or per request, and OpenRouter sends that traffic only to endpoints that do not keep your data. If your own provider contract already includes zero retention, you can declare that on a BYOK key. The Business plan adds eu.openrouter.ai and us.openrouter.ai, which keep inference with providers in that region.

All of that is good. It still adds a company to your data path. If a customer's security questionnaire says prompts may only go to named model providers, or may not leave your cloud account at all, OpenRouter fails that test whatever its retention settings say.

With LiteLLM self-hosted, the proxy runs in your VPC and sends no telemetry to LiteLLM. Prompts go only to the providers you configure, under the agreements you signed with them. LiteLLM Enterprise is SOC 2 Type II audited, and your own deployment inherits whatever controls your cloud already has. The flip side is that you are now the operator of a system that holds every key and every prompt. The 2026 incidents above are why that responsibility is real.

## Budgets per key, per team, per customer

Both tools let you stop a runaway bill. They differ in how far down the budgets go.

OpenRouter lets each API key carry its own credit cap, and groups keys into workspaces with their own limits and activity. A management API creates keys from code, so you can mint one key per customer and cap it. That works for dozens of customers. Past that, the 5-workspace limit on Standard pushes you to Business at 8%.

LiteLLM was built for this. Its open-source proxy has virtual keys with a max budget and a reset period, requests-per-minute and tokens-per-minute limits, and spend tracked per key, per user, per team, per end customer and per tag. When a budget runs out, the proxy refuses the request. If your product charges customers for AI usage, or gives each customer a monthly allowance, LiteLLM already has the data model you would otherwise build yourself.

## Model coverage and lock-in

Coverage is close enough that it rarely decides anything. OpenRouter wins on access without paperwork: one account reaches models from vendors you have never signed up with, plus hosted open-weight models from inference companies. LiteLLM reaches more providers on paper, but you need your own account and key for each one, and some enterprise models are only on Bedrock, Vertex or Azure behind your own cloud contract. LiteLLM talks to those fine. OpenRouter covers some of them through its own provider deals.

Lock-in is low on both. Each speaks the OpenAI request format, so leaving is mostly a base URL change. The sticky parts are smaller. OpenRouter's model names use its own prefixes, prepaid credits sit on its books, and on credits alone you have no direct provider account or rate-limit history. LiteLLM's YAML config and key database belong to you.

They also stack. LiteLLM lists OpenRouter as a provider, so a common path is to start on OpenRouter, then put a LiteLLM proxy in front later when you need per-customer budgets, keeping OpenRouter as one of its routes. Your app code does not change.

## Side by side

- **Product type:** OpenRouter is a hosted router and marketplace. LiteLLM is an open-source SDK and a proxy you run, with a paid enterprise license.

- **Setup time:** OpenRouter takes minutes. LiteLLM takes a day to deploy well, longer with SSO and monitoring.

- **Fees:** OpenRouter charges 5.5% on credits (8% on Business), and BYOK is free up to $25,000 a month of list-price inference. LiteLLM is free software plus hosting, and Enterprise is priced by quote.

- **Billing:** OpenRouter gives you one bill. LiteLLM leaves you with a bill from every provider you use.

- **Data path:** OpenRouter sits between you and the provider, with zero-retention routing and EU or US regions on Business. LiteLLM stays inside your VPC.

- **Routing:** OpenRouter does provider failover automatically and takes a model list per request. LiteLLM uses model groups, cooldowns, several strategies and custom Python.

- **Budgets:** OpenRouter caps credits per key and per workspace. LiteLLM sets budgets and rate limits per key, user, team, customer and tag.

- **Operations:** OpenRouter runs itself, and its outages are yours too. With LiteLLM, you run it, patch it and pin it.

- **Best for:** OpenRouter suits product teams adding AI features. LiteLLM suits platform teams, regulated data and usage-based AI products.

## Which one for your product

Here is how I would call it for the products founders bring us most.

- **SaaS drafting.** A SaaS adding summaries or drafting, under $5,000 a month in model spend: OpenRouter on Standard. Switch your main provider to BYOK once the fee starts to sting.

- **Consumer chat.** A chat or companion app that tries a new model every month: OpenRouter. The model catalog is the product advantage, and you will not out-build it.

- **Regulated records.** A health or legal app handling records a customer contract restricts: LiteLLM in your own VPC, calling providers you hold agreements with. Pin the version and read every release note.

- **Usage billing.** An AI platform that bills customers for usage: LiteLLM. Per-customer budgets, keys and spend tracking are already built, and that is weeks of work you skip.

- **EU buyers.** A B2B tool selling to EU companies that ask where inference runs: OpenRouter Business with the EU endpoint, unless their questionnaire says your cloud only. Then LiteLLM.

- **Heavy spend.** Anything past $25,000 a month on one provider: LiteLLM, or direct calls with your own retry logic. At that spend you want your own provider relationship and pricing terms.

- **One feature.** One AI feature on one provider: neither yet. Call the provider's SDK directly and add a gateway when you add a second model.

![Developer typing code on a laptop beside a plant and a mug](https://images.unsplash.com/photo-1618477388954-7852f32655ec?w=800&q=80)

That last case is more common than people think. [Politik](/work/politik) shipped to the App Store in under three months, hit 4,000 users on launch day and reached #2 on the App Store. Its AI chat assistant explains bills and votes in plain English from official data, and the tech stack lists one model provider: OpenAI. A gateway earns its place when you add a second model or a second team. Before that, it is one more thing to run.

The gateway is also a small line in the total cost of an AI feature. Prompt work, evaluation, retrieval and the UI around the model cost more. Before you pick infrastructure, read [how much it costs to add AI features to an existing app](/blog/how-much-does-it-cost-to-add-ai-features-to-existing-app), so you know what the whole thing runs.

Kanopy helps founders pick a stack and build the product on it. If you want a second opinion on your AI architecture before you commit, [book a free strategy call](/get-started).

---

*Originally published on [Kanopy Labs](https://kanopylabs.com/blog/openrouter-vs-litellm-which-llm-gateway-to-build-on)*
