An LLM gateway serves as the core infrastructure for teams to invoke large language models. A poor selection can lead to high hidden costs in development, operation and compliance. As the most popular managed LLM gateway, OpenRouter dominates the market, while Portkey and LiteLLM have distinct competitive advantages in specific scenarios. This article focuses on two core comparison dimensions — OpenRouter vs Portkey and OpenRouter vs LiteLLM — and provides a scenario-based decision-making framework for team selection.
Many teams directly integrate with the OpenAI API in the early stage of development with smooth iteration. However, as business scales up, prominent pain points emerge: scattered model access, chaotic key management, high model switching costs, and lack of unified usage monitoring and statistics. An LLM gateway fundamentally solves these problems with three core values:
OpenRouter is a fully managed routing layer deployed on Cloudflare edge nodes, integrating more than 70 LLM model vendors. With a unified API interface, developers can seamlessly switch between mainstream models including Anthropic, Google, DeepSeek, and various open-source LLMs.
Acquired by Palo Alto Networks in 2025, Portkey is positioned as an AI gateway built for enterprise security and compliance. Its core capability lies in enterprise governance and full-dimensional observability.
Portkey adopts a log-volume-based billing model, completely different from OpenRouter's token-based commission. It can be directly connected to major model vendors or overlaid on top of OpenRouter to build a secondary governance layer.
LiteLLM is a fully open-source gateway supporting local self-deployment based on Docker, PostgreSQL, and Redis. Its core strength is unifying all heterogeneous LLM APIs into the OpenAI standard format.
When monthly model expenditure exceeds $3,600, self-hosted LiteLLM becomes cost-competitive against OpenRouter's 5.5% platform fee.
| Dimension | OpenRouter | Portkey |
|---|---|---|
| Deployment | Fully managed SaaS | Managed SaaS + optional private |
| Models | 70+ vendors | Compatible with OpenRouter |
| Billing | 5.5% token commission | Log storage volume |
| Governance | Basic routing, rate limit | Virtual keys, budget, audit, ACL |
| Dimension | OpenRouter | LiteLLM |
|---|---|---|
| Deployment | Cloud managed SaaS | Self-hosted Docker |
| Fee | 5.5% commission | Free + infra costs |
| Data Control | Third-party cloud | Full local autonomy |
| O&M | Zero | PostgreSQL + Redis |
| Break-even | None | ≥$3,600/month |
The three solutions are not mutually exclusive: start with OpenRouter, overlay Portkey for governance, migrate to LiteLLM as volume grows.
from openai import OpenAI
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key="sk-or-v1-xxxx"
)
response = client.chat.completions.create(
model="anthropic/claude-3-5-sonnet-20241022",
messages=[{"role": "user", "content": "Explain an LLM gateway"}]
)
print(response.choices[0].message.content)
The core principle: match your team's O&M capability. Small teams should prioritize product iteration over "technically perfect" self-hosted solutions.