LiteLLM vs OpenRouter vs Portkey (2026): Which AI Gateway Should You Use?
Last updated 2026-07-07 · Part of Awesome AI Gateway — the only AI-gateway list with a reproducible cost benchmark. ⭐ Star it.
📊 Key numbers · Writing a 100K-token report costs $0.03 on DeepSeek V4-Flash vs $3.01 on GPT-5.5 — a ~106× spread (reproducible benchmark, computed 2026-06). OpenRouter adds ~5.5% on credits; self-hosted LiteLLM (⭐ 54.9k) and BYOK gateways add 0% per-token markup. The model you route to moves the bill far more than the gateway fee. Real gateway traffic backs this up: in OpenRouter's own 100-trillion-token study, a 10% price cut moved usage only ~0.5–0.7% — quality, not price, drives model switching (arXiv 2601.10088).
The three names everyone compares when they pick an AI gateway are LiteLLM, OpenRouter, and Portkey. They solve the same surface problem — one endpoint for many LLMs — but they sit at completely different points on the self-host ↔ managed axis. Here's the honest, data-backed breakdown.
TL;DR
| LiteLLM | OpenRouter | Portkey | |
|---|---|---|---|
| What it is | Self-hosted OSS proxy + SDK | Hosted model marketplace | OSS gateway + managed LLMOps |
| Setup | Deploy it yourself | Sign up, change base_url | Self-host OR use cloud |
| Markup | $0 (you pay infra) | ~5.5% on credits | Free OSS / usage-priced cloud |
| Models | 100+ providers | ~340 models | 1,600+ models |
| Best for | Full control, no middleman fee | Zero ops, fastest start | Guardrails + observability at scale |
| License | MIT (core) | Commercial | MIT (gateway) |
| Stars | ⭐ 54.9k | — (closed) | ⭐ 12.6k |
Note (2026): Portkey was acquired by Palo Alto Networks (closed May 2026) and is being folded into its Prisma AIRS security platform — a signal that gateways are becoming security infrastructure.
Pick by your actual constraint
- "I want zero ops and the fastest possible start" → OpenRouter. Change two lines, get ~340 models, pay ~5.5%. You're calling models in five minutes.
- "My keys, my infra, no per-token middleman fee" → LiteLLM. The default self-hosted choice: virtual keys, budgets, load balancing, 100+ providers. You run it; you pay only infra.
- "Enterprise guardrails, RBAC, audit, and deep observability" → Portkey. 50+ guardrails, virtual-key management, SSO, and a 99.99% SLA on the cloud tier. Self-host the OSS gateway or use the managed platform.
The cost angle nobody quantifies
The gateway's own fee is only half the story — the model behind it dominates your bill. Writing one 100K-token report:
- $0.03 on DeepSeek V4-Flash
- $3.01 on GPT-5.5 — a 106× spread for the same task
That's why the gateway matters: LiteLLM/Portkey let you route cheap-by-default and escalate to a flagship only when needed; OpenRouter's auto router does this for you. Full computed cost tables (4 scenarios × 11 models, generated by a unit-tested script) are in the evaluation set.
What about security?
- LiteLLM had two serious 2026 CVEs (a pre-auth SQLi and an unauth RCE on CISA's exploited list) — both patched in v1.83.7; pin to current stable and don't expose the admin panel.
- OpenRouter offers free zero-data-retention and EU region-locking, but publishes no hard uptime SLA outside enterprise.
- Portkey carries SOC 2 Type II + ISO 27001 + HIPAA and the richest guardrail marketplace of the three.
Full compliance/security/stability scores for 23 gateways are in the gateway scorecard.
The honest verdict
There's no single winner — there's a winner for your constraint:
- Indie / cost-sensitive → start on OpenRouter, move to self-hosted LiteLLM when volume justifies the ops.
- Platform team that wants control → LiteLLM, with a cheap model as default and a flagship as fallback.
- Enterprise with compliance + observability needs → Portkey (or a first-party cloud like Azure/Bedrock behind it for failover).
See all 50+ gateways
Just weighing LiteLLM against OpenRouter? The condensed LiteLLM vs OpenRouter guide covers those two head-to-head, including how to run them together.
This is three of them. The full list — organized by what you need (cost, compliance, self-hosting, China models, MCP/agents), with a decision tree, comparison tables, and the reproducible cost + scorecard data — is here:
👉 Awesome AI Gateway · interactive site · 简体中文
Found this useful? A ⭐ helps the next engineer choosing a gateway find it.