LiteLLM vs OpenRouter: which one fits LLM gateway cost?
SOMA AI, the Barcelona company behind the SAEF AI emission factors and a free AI cost and carbon calculator, wrote this page. LiteLLM describes an MIT-licensed gateway you run yourself, with spend in your own database. OpenRouter describes a hosted service billing inference at provider list price plus a platform fee on credit purchases.
How do LiteLLM and OpenRouter compare?
| LiteLLM | OpenRouter | |
|---|---|---|
| What it is | "an open-source AI gateway (LLM proxy)" with one OpenAI-compatible API (litellm.ai) | "a large language model aggregator", a hosted service run by OpenRouter, Inc. (terms) |
| Licence | MIT, except the litellm/enterprise directory, which has its own licence (LICENSE) | Hosted service under its terms, source licence not stated on the pages we read (terms) |
| Self-hosting | Yes, via Docker, Terraform modules or Helm charts (repository) | Not stated on the pages we read as of 30 November 2026 (FAQ, terms) |
| Fees | Gateway "MIT-licensed and free to self-host" (litellm.ai). Enterprise price not published, 30-day trial key offered (enterprise page) | Free N/A, Standard 5.5% ("$0.80 minimum"), Business 8% platform fee on credit purchases, Enterprise fee discounts. Inference at provider list price (pricing, FAQ) |
| Your own provider keys | "Your keys, your infra, your audit trail." The gateway runs in your infrastructure and calls providers with your keys (litellm.ai) | BYOK on Standard and Business: $25,000 of list-price inference a month with no fee, then 5% of what the request would cost on OpenRouter. Not on Free (pricing, BYOK) |
| Free tier | The open-source gateway (litellm.ai) | 25+ free models from 4 free providers. Free models capped at 20 requests a minute and 50 a day, "rising to 1,000 per day once your account has bought at least $10 of credits" (pricing, limits) |
| Models and providers stated | "140+" "LLM providers" and "1,892" "Unique models" on the homepage, "100+ LLMs" in the repository (litellm.ai, repository) | "600+ models" and "80+ providers" (pricing) |
| Cost per request | Header x-litellm-response-cost and a LiteLLM_SpendLogs table (cost tracking) | A usage object with cost in every response, and a /generation endpoint (usage accounting) |
| Spend views | By key, end user and team, with /spend endpoints. Tag-based spend tracking marked "ENTERPRISE" (cost tracking) | Activity rolls spend up "by model, provider, API key, app, or user"; organisation accounts can filter by member. Explore results export as CSV or PDF, with an analytics API (activity) |
| Budgets and limits | USD max_budget with budget_duration for keys, teams and users. Needs a database to enforce (budgets) | Per-key USD limit with daily, weekly or monthly reset at midnight UTC, set with a management key, which the pricing table lists from Standard up (API keys, pricing) |
| Prompt logging by default | Spend logs written unless disable_spend_logs is set. Prompt storage not mentioned on the database page we read (database) | "Prompt and completion are not logged by default" (FAQ) |
| Carbon shown | Not stated in their documentation as of 30 November 2026 (cost tracking) | Not stated in their documentation as of 30 November 2026 (usage accounting) |
Model and provider counts are each vendor's own statement and are counted differently, so do not compare them number to number. The rows are ordered by topic and not by quality, and the sources for every cell sit inside the cell.
What does each of them cost?
OpenRouter lists a platform fee on credit purchases, 5.5% on Standard and 8% on Business, and says inference is billed at the provider's list price on every plan (pricing). LiteLLM's gateway is MIT-licensed and free to self-host, with Enterprise pricing on request (enterprise page). You still pay for the servers.
Which one tracks spend per team or key?
Both attribute spend to keys. LiteLLM logs spend by key, end user and team in a database table, with tag-based tracking marked Enterprise (cost tracking). OpenRouter's Activity page rolls spend up by model, provider, key, app and user, lets organisation accounts filter by member, and exports to CSV or PDF (activity).
Can you self-host LiteLLM or OpenRouter?
LiteLLM can be self-hosted, and its repository names Docker, Terraform modules and Helm charts. Virtual keys and budgets need a Postgres database, and its documentation says no budget caps anything without one (budgets). Self-hosting OpenRouter is not stated in the documentation we read as of 30 November 2026, where it is described as a hosted service.
How do budgets work, and what happens when one runs out?
LiteLLM sets max_budget in USD with a reset period, and a key over budget fails with ExceededTokenBudget once the proxy runs with a database (budgets). OpenRouter sets a USD limit per key with a daily, weekly or monthly reset at midnight UTC, created with a management key (API keys). LiteLLM's soft-budget email alerts need Enterprise.
Can you use LiteLLM and OpenRouter together?
Yes, according to LiteLLM's provider documentation, which lists OpenRouter among the gateways it can call (repository, providers). A LiteLLM proxy can then hold your budgets and keys while OpenRouter supplies the models. Two layers means two places where spend is counted, so reconcile them.
What do they say about data and logging?
OpenRouter's FAQ says prompts and completions are not logged by default, and its terms describe opt-in logging with rights for OpenRouter over the stored content (FAQ, terms). LiteLLM's homepage says a self-hosted gateway sends no telemetry to LiteLLM and prompts go only to the providers you configure (litellm.ai).
Does either of them show carbon?
Neither shows carbon on the pages we read: their cost documentation describes dollars and tokens only, and a carbon figure is not stated as of 30 November 2026. SOMA AI's free calculator estimates CO2e, electricity and water next to list-price cost, but it is not a gateway and does not read your traffic.
Where does SOMA AI's calculator fit?
SOMA AI's free AI footprint calculator estimates a company's monthly AI cost at list price together with CO2e, electricity and water, with no sign-up. It does not sit in your request path, read traffic or enforce budgets, so it is not a replacement for either tool. See also the LLM API cost calculator.
What does this page not claim?
- That either tool is better or cheaper. This is a dated comparison of what two vendors say on their own pages. We ran no cost, latency or reliability test, and fees and features change, so open the linked pages before you decide.
- That a feature marked not stated does not exist. It means the pages we read did not say.
- That the free tiers or fees are equivalent. A platform fee and a self-hosting bill are different kinds of cost.
- That SOMA AI's figure matches an invoice. It is a list-price estimate and does not enforce a spend limit.
Short answers
- Is LiteLLM or OpenRouter cheaper?
- This page does not rank them. Their costs are of different kinds. OpenRouter lists a platform fee on credit purchases and bills inference at provider list price. LiteLLM's gateway is MIT-licensed with no usage fee stated, but you pay the servers and database that run it. Which totals less depends on your volume and who operates it.
- Does LiteLLM charge per request?
- Not on the pages we read. LiteLLM's homepage says the gateway is MIT-licensed and free to self-host, and its enterprise page publishes no price and offers a 30-day trial key. You pay your model providers directly, plus the infrastructure you run. Enterprise pricing is available by contacting LiteLLM.
- Does OpenRouter store my prompts?
- OpenRouter's FAQ says prompts and completions are not logged by default unless you opt in, and that it logs basic metadata such as timestamps and token counts. Its terms say opting in to prompt logging gives it rights to store the content. Read both pages before enabling logging, and check a provider's own policy separately.
- Do either of them show the carbon footprint of LLM calls?
- Neither vendor page we read showed carbon. SOMA AI's free calculator estimates a company's monthly AI cost at list price next to CO2e, electricity and water. It does not read your traffic, so many teams use it beside a gateway or router.
