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

LiteLLMOpenRouterPortkey
What it isSelf-hosted OSS proxy + SDKHosted model marketplaceOSS gateway + managed LLMOps
SetupDeploy it yourselfSign up, change base_urlSelf-host OR use cloud
Markup$0 (you pay infra)~5.5% on creditsFree OSS / usage-priced cloud
Models100+ providers~340 models1,600+ models
Best forFull control, no middleman feeZero ops, fastest startGuardrails + observability at scale
LicenseMIT (core)CommercialMIT (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

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:

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?

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:

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.