AIGenLab
EN

ANALYSISopenrouter + litellm

OpenRouter vs LiteLLM: self-host for logs, managed for no ops

Quick verdict

Decision first, evidence below

LiteLLM vs OpenRouter is settled by where logs and budgets must live: self-host LiteLLM when contract text cannot leave your network and someone can carry the gateway, and use OpenRouter's managed endpoint when nobody is on call and you would rather buy credits than run a proxy.

At a glance

Suppose you lead a small AI team inside a company of a few dozen people: support Q&A, contract summaries and marketing copy each call two or three model vendors, the vendor keys sit in three repositories, and at month end nobody can say which feature spent what. Contract text also has to stay inside the company network. This article walks that one case through the OpenRouter vs LiteLLM choice, from who carries the gateway to where the ledger lives. The company is an editorial example, not a measured customer.

On this page
  1. At a glance
  2. Background
  3. Operations come first
  4. The documented fee
  5. BYOK
  6. Data boundary and deploym…
  7. Using both
  8. The split
  9. Conclusion
  10. Questions
  11. Sources & method

ContextBackground: three AI features, five vendor keys, one bill nobody can split

Suppose you lead a small AI team inside a company of a few dozen people. Support Q&A, contract summaries and marketing copy each call two or three model vendors, and the vendor keys sit in environment variables across three repositories. At month end nobody can say which feature spent what, and when a rate limit hits on a campaign day, nobody knows which layer to touch first.

Three constraints shape the decision. Contract text may not leave the company network. Marketing wants budgets enforced per person. The team has no dedicated platform engineer, so a failure at night means waking someone up. Those constraints pull in opposite directions: one toward a managed entry point, the other toward a gateway you run yourself.

The rest of this article follows that single case: who carries the gateway, where the platform fee is charged, how budgets and keys are assigned, where the logs live, and how the two options combine. Where a statement is our judgement rather than a vendor's documented behaviour, we label it.

Operations come first: without an on-call owner, take the managed endpoint

If you have no dedicated platform engineer, a managed endpoint saves you something more useful than money: the two-in-the-morning page when a provider starts rate-limiting your busiest feature, and the weeks spent learning how a proxy behaves under load.

In the example, support Q&A gets rate-limited on a campaign day and someone has to switch models, change configuration and confirm the feature recovered. Self-hosting LiteLLM puts that proxy inside your own cluster, so upgrades, capacity and network design all need an owner.

LiteLLM's deployment documentation points to Helm on Kubernetes and Terraform on AWS and GCP, and states that those guides cover capacity, network design and production operations. The control you gain is exactly those three jobs.

The exception is a company that already runs a stable Kubernetes platform team. There the proxy is one more stateless service, the marginal cost of self-hosting is close to zero, and a managed endpoint adds an external dependency instead of removing work.

  1. Write one line of on-call reality: who gets paged when the gateway fails, and how fast it must recover. If no name appears, put the single entry point on the managed side.
  2. If you run Kubernetes, install LiteLLM into a test cluster with the official Helm guide, push a week of real traffic through it, and log the hours spent on upgrades and scaling.
  3. Without a cluster, put gateway maintenance on the rota by name; if the rota has no slot, keep routing and logs off a self-hosted critical path.

The documented fee: OpenRouter charges it when you buy credits

OpenRouter bills inference at the provider's list price on every plan, and its own fee lands at one moment only: when you buy credits, at 5.5% on Standard and 8% on Business. It is never charged per request, and that single sentence decides the arithmetic below.

Back to the example: one month of marketing-copy inference tells you whether the fee is worth paying. Multiply last quarter's inference spend by 5.5% or by 8% and you have the extra paid at top-up time. Self-hosting avoids that line, then adds machines and a person's hours.

With your own vendor keys, Standard and Business include $25,000 of list-price inference per month with no OpenRouter fee, and 5% above that allowance; Enterprise allowances are custom. Heavy BYOK use therefore does not simply accumulate 5.5% forever.

The reverse holds too: if your volume is small and you mostly try a few models, 5.5% may cost less than one engineer-day on a self-hosted proxy. At that size, who maintains the gateway matters more than the rate.

  1. Multiply last quarter's inference spend by 5.5% (Standard) and by 8% (Business), place both numbers next to the machines and people a self-hosted proxy needs, and only then decide where the budget goes.
  2. If contract summaries run on your own vendor keys, work out whether monthly list-price usage stays under $25,000 before assuming the 5% charge applies.
  3. Drop the per-request fee claim from the procurement discussion: the documented model charges the platform fee when credits are bought, and assuming a per-request markup points the arithmetic the wrong way.

BYOK, budgets, virtual keys and fallback: who holds the controls

Both sides can split budgets per person, but the attribution rule differs: the managed side charges the key's creator, the self-hosted side records spend per key, user and team. That difference decides whether your per-person report is true.

In the example, marketing wants budgets enforced per person. OpenRouter checks a workspace budget first, then every applicable guardrail, and the first limit reached blocks the request. Budgets follow the key's creator rather than the caller, so a shared key created by an admin spends the admin's allowance.

LiteLLM issues a virtual key per app or per person, each carrying a budget and a rate limit; the gateway records every request and its cost, and your provider keys stay in the gateway. Spend lands in your own Postgres tables for keys, users and teams.

One default belongs in the configuration review: BYOK keys are split into priority and fallback sections, and when both are rate-limited or failing, requests fall back to OpenRouter's shared endpoints by default, so the bill moves back to OpenRouter credits.

  1. Turn BYOK, budgets, virtual keys and fallback into one responsibility sheet: who configures vendor keys, who raises a budget cap, who watches the fallback switch, each with a name beside it.
  2. On the managed side, create one key per feature and record who created it; a shared admin key charges the admin's allowance, which breaks any per-person split.
  3. On the self-hosted side, issue virtual keys per person with budget and rate limit attached, then reconcile month-end totals against the three Postgres tables.

Data boundary and deployment: content can stay out, metadata still gets stored

A managed gateway can promise no routine retention of content, yet it still records metadata about every request; a self-hosted gateway puts that record in your own database, where your own retention rules apply.

Contract summaries are the sensitive part of the example. OpenRouter's zero data retention means no routine storage of prompts or responses after processing, with a CSAM exception stated on the page. It also stores metadata such as prompt and completion token counts and latency for reporting and logs.

Self-hosting keeps spend records in your Postgres, split across key, user and team tables. The price is maintenance: v1.111.1 fixed failed requests being recorded as zero-cost rows in spend logs and daily usage, which is the kind of change your ledger has to follow.

If contract summaries are internal drafts and leaving the network is not a compliance issue, the retention question shrinks to whether the reporting fields are enough, and you do not need to move the whole gateway in-house for it.

  1. Keep a separate data sheet for contract-type content: whether the text leaves the network, how long it is retained, and who can open the reports, each stated in a form you can check.
  2. On the managed side, read which models and providers zero data retention covers, then which fields appear in metadata reports and who can export them.
  3. On the self-hosted side, put the Postgres spend tables under backup and access control, and subscribe to LiteLLM release notes so a change in how cost is recorded surfaces early.

Using both: LiteLLM in front, OpenRouter as one provider

This is not a binary choice. Put LiteLLM in front as the single entry point and configure OpenRouter as one of its providers: routing and the ledger stay with you, and long-tail models come from the managed side.

In the example the team can close the loop this way. The three features call one LiteLLM address, each with its own virtual key, and a model that exists only on OpenRouter is reached through the openrouter/ prefix while the provider keys stay in the gateway.

LiteLLM's OpenRouter provider page states that it supports all OpenRouter models and that sending model=openrouter/ plus the model name forwards the request. The application's call format does not change; the edit lives in one gateway configuration.

The combination assumes you will maintain one gateway. If nobody owns that gateway, keeping routing in-house only moves the failure point to a machine you now have to patch, and it does not reduce the work.

  1. Add an OpenRouter provider to the LiteLLM configuration and point only long-tail models at it at first; keep primary models direct, watch one week of spend, then decide whether to widen it.
  2. Create a separate virtual key for the requests routed to OpenRouter, with its own budget and rate limit, so that this traffic shows up as its own line in the gateway ledger. Whether OpenRouter's actual charge matches that line is not documented, so check the two ledgers separately for now.
  3. Record the owner of each route on the gateway: which model goes direct and which goes through the openrouter/ prefix, so a handover does not require reading code.

The split: log ownership, on-call capacity and the fee model

The short version: self-host LiteLLM when logs and budgets must stay in your own network and someone can carry operations; use OpenRouter's managed endpoint when nobody is on call and you would rather buy credits than run a proxy.

In the example, contract text that cannot leave the network settles the self-hosted side, while marketing copy can go managed. Running both, closed with the combination above, usually means less operational juggling than forcing one answer onto every feature.

The official documents put the difference in concrete places: the managed side takes over fallbacks and picks the most cost-effective model per request, while the self-hosted side keeps virtual keys, budgets and per-request cost inside your gateway.

The figure below sets the two side by side on deployment, the fee, bring-your-own-key, budgets and fallback, and log ownership; every cell is a documented fact rather than a preference. It only helps once you are willing to run a gateway: if you cannot name an on-call owner, skip the comparison and take the managed endpoint.

PointOpenRouter (managed)LiteLLM (self-hosted)
Deployment and operationsA vendor-run single endpoint, ready on sign-up, with routing and fallbacks handled for youYou deploy it with Helm on Kubernetes or Terraform on AWS and GCP, and own capacity and production operations
How you are billedInference at provider list price; the platform fee is charged when you buy credits, 5.5% Standard and 8% BusinessAn open-source gateway that records per-request cost in your own Postgres; the cost is machines and people
Bringing your own keysKeys split into priority and fallback; $25,000 of list-price inference per month carries no fee, 5% above itProvider keys stay in the gateway, and each app or person gets a virtual key with a budget and a rate limit
Budgets and fallbackWorkspace budget plus guardrails, attributed to the key's creator; a model array in the request switches automaticallyVirtual keys carry budgets and rate limits, with spend recorded per key, user and team
Logs and dataNo routine retention of content under ZDR, with a stated CSAM exception, while per-request metadata is still recordedSpend and request records land in your own Postgres tables, and the ledger has to follow version upgrades
Diagram: where the managed and self-hosted options put the work across deployment, billing, bring-your-own-key, budgets and fallback, and logs, drawn from both vendors' documentation
Where each option puts the workWhere each option puts the workOpenRouter (managed)LiteLLM (self-hosted)Deployment andoperationsA vendor-run single endpoint,ready on sign-up, with routingand fallbacks handled for youYou deploy it with Helm onKubernetes or Terraform on AWSand GCP, and own capacity andproduction operationsHow you are billedInference at provider list price;the platform fee is charged whenyou buy credits, 5.5% Standardand 8% BusinessAn open-source gateway thatrecords per-request cost in yourown Postgres; the cost ismachines and peopleBringing your ownkeysKeys split into priority andfallback; $25,000 of list-priceinference per month carries nofee, 5% above itProvider keys stay in thegateway, and each app or persongets a virtual key with a budgetand a rate limitBudgets and fallbackWorkspace budget plus guardrails,attributed to the key's creator;a model array in the requestswitches automaticallyVirtual keys carry budgets andrate limits, with spend recordedper key, user and teamLogs and dataNo routine retention of contentunder ZDR, with a stated CSAMexception, while per-requestmetadata is still recordedSpend and request records land inyour own Postgres tables, and theledger has to follow versionupgrades
AIGenLab original
  1. Reduce the decision to one line: can the text leave the network, is there an on-call owner, and which costs more, the platform fee or the people. When all three point one way, stop evaluating and choose.
  2. When they point in different directions, let the hard constraint on contract text set the main path, then send low-sensitivity traffic such as marketing copy down the other one.
  3. Write the choice into the team document as one sentence: what would move you to the other side, and who is responsible for raising it when that condition appears.

ConclusionConclusion: who owns the logs decides, and who is on call confirms

Back to the title: keep logs and budgets in your own network and staff the gateway, and LiteLLM is the choice; have nobody on call and prefer buying credits, and the managed endpoint is. The difference is not the model count but who deploys and who holds the ledger.

Our view, not independently tested: spend a week multiplying last quarter's inference spend by 5.5% and by 8%, then put both numbers next to machines and people for the self-hosted path. Comparing rates alone hides the operations cost.

If your team already runs other services on Kubernetes, self-hosting gets cheaper at the margin; unless contract text must stay inside the network, a managed endpoint with a thin wrapper carries you through the early stage. When inference volume grows to the point where teams must share costs, revisit moving the gateway in-house.

AIGenLab views

Not independently tested

A team that must keep logs and budgets inside its own network, and already has someone to carry operations, gets more from self-hosted LiteLLM; the judgement assumes that on-call capacity exists.

AIGenLab's view, formed by comparing both vendors' documented deployment, billing, budget and log behaviour; no load or failure testing was run.

Using the fee rate alone misprices the decision: the managed 5.5% and 8% apply when credits are bought and not inside the BYOK allowance, while the self-hosted cost is machines and people.

AIGenLab's view derived from the charging point stated on OpenRouter's pricing page and the operations surface listed in LiteLLM's deployment guide; no real bill was reconciled.

Per-person budgets on the managed side go wrong easily: attribution follows the key's creator, so a shared admin key spends the admin's allowance.

AIGenLab's view: OpenRouter's spend-control documentation states the attribution rule, and this is the configuration advice we draw from it, not a reproduced workspace test.

Questions

Can OpenRouter and LiteLLM be used together?
Yes. LiteLLM treats OpenRouter as one provider and forwards requests with the openrouter/ prefix, so routing and the ledger stay on your gateway while long-tail models come from the managed side.
Does OpenRouter add its fee to every request?
No. Inference is billed at the provider's list price and the platform fee is charged when you buy credits, 5.5% on Standard and 8% on Business; with your own keys, $25,000 of list-price inference per month carries no fee.
Where does spend data live after self-hosting LiteLLM?
In your own Postgres tables, recorded per key, user and team. The trade-off is that the ledger's rules have to follow LiteLLM version upgrades.
Does OpenRouter's zero data retention mean nothing is recorded?
No. Zero data retention means no routine storage after processing, with a CSAM exception stated on the page, but metadata such as token counts and latency is still recorded for reporting and logs.

Official sources and scope

  • OpenRouter pricing Inference billed at provider list price, the platform fee charged when credits are bought (5.5% Standard, 8% Business), the $25,000 monthly BYOK allowance and 5% above it, and no token charge for failed attempts
  • OpenRouter documentation The managed entry point's positioning: one endpoint for hundreds of models, automatic fallbacks, and the most cost-effective model picked per request
  • OpenRouter BYOK guide Keys split into priority and fallback sections, and the default fallback to shared endpoints when both fail or are rate-limited
  • OpenRouter spend controls The two-layer workspace budget and guardrail enforcement, and budget attribution to the key's creator rather than the caller
  • OpenRouter zero data retention What zero data retention means: no routine storage after processing, with the CSAM exception stated on the page
  • OpenRouter data collection Per-request metadata such as token counts and latency is stored for reporting and logs
  • OpenRouter model fallbacks A model array in the request tries models in priority order and moves on when the previous one is unavailable
  • LiteLLM documentation LiteLLM's positioning: an open-source AI gateway with one endpoint for all models, virtual keys carrying budgets and rate limits, per-request cost recording, and provider keys kept in the gateway
  • LiteLLM virtual keys and spend tables Spend tracked per key, user and team in your own Postgres tables
  • LiteLLM OpenRouter provider Support for all OpenRouter models, forwarding with openrouter/ plus the model name (the combined setup)
  • LiteLLM deployment guide The self-hosted deployment paths (Helm, Terraform) and the capacity, network design and production operations work they imply
  • LiteLLM v1.111.1 release The fix for failed requests recorded as zero-cost rows in spend logs and daily usage, showing that the ledger's rules change with versions

Dates beside sources indicate when we consulted them, not when the vendor released the update. Procedures are editorial guidance, not independently tested.