← Guides

OpenRouter vs LiteLLM vs Portkey: LLM gateways for AI agents compared

By Jacob Holm · November 9, 2026

An agent that calls more than one model, or needs to keep working when a provider goes down, usually sits behind an LLM gateway: one API in front of many providers, with fallbacks, spend limits, and logs in one place. OpenRouter, LiteLLM, and Portkey are three of the most common choices, and they work in different ways. OpenRouter is a hosted service that resells model access, LiteLLM is open-source software you run yourself, and Portkey is a hosted gateway with an open-source core. Figures below are from each vendor's own site as of November 2026.

OpenRouter: one account for 600+ models

OpenRouter gives you one OpenAI-compatible API for 600+ models from 80+ providers. It bills tokens at the provider's list price and charges its fee when you buy credits: 5.5% on the Standard plan and 8% on Business, with no minimum spend. The free plan covers 25+ free models at 50 requests a day, which rises to 1,000 a day once you have bought at least $10 of credits. Standard adds budgets and spend controls, auto-routing, and prompt caching. Bring-your-own-key (BYOK) traffic is free up to $25,000 of list-price inference a month, then costs 5%. Requests that error are not billed, so with fallback routing you pay only for the attempt that answers.

LiteLLM: open source and self-hosted

LiteLLM is an MIT-licensed gateway you run in your own cloud, including fully air-gapped setups, and it says it sends no telemetry. It exposes one OpenAI-compatible API for 140+ providers. The free version includes virtual keys, hard budgets per key, team, and model (requests stop at the cap), RPM and TPM rate limits, load balancing, guardrails, and logging to Langfuse, Arize Phoenix, LangSmith, or OpenTelemetry. There is no per-token fee because you call providers with your own keys. You pay for the servers, Postgres, and Redis it runs on. An Enterprise tier adds SSO, RBAC, audit logs, SCIM, and dedicated support on the same core.

Portkey: hosted gateway with observability built in

Portkey's gateway handles fallbacks, load balancing, retries, timeouts, and caching, and its hosted plans add logs, traces, prompt management, and guardrails. The free Developer plan records 10,000 logs a month with 3-day log retention, and Portkey says it is not meant for production. Production costs $49 a month for 100,000 recorded logs, plus $9 for each extra 100,000 requests up to 3 million, with 30-day log retention, semantic caching, and role-based access. Going over a log limit doesn't block requests; only the extra logs go unrecorded. The open-source gateway can be self-hosted for free with basic routing, fallbacks, and guardrails.

Other gateways to consider

Which one to pick

Whichever you choose, give each agent its own key with its own budget so one runaway loop can't drain the account. See How to track and cap what your AI agent spends. To see what the agent did on each call, see how to debug AI agents. Prices change often, so check each vendor's pricing page before you commit. See every option in Model gateways for AI agents.

Options at a glance

ToolWhat it doesPricingLicense
OpenRouterOne OpenAI-compatible API for 600+ models from 80+ providers, with fallback routing, budgets and BYOKFree tier (free models, 50 req/day); pay as you go at provider list price plus 5.5% fee on credit purchasesProprietary
LiteLLMOpen-source AI gateway: one OpenAI-compatible API for 100+ providers, with virtual keys, spend tracking, budgets, rate limits and fallbacksFree (MIT; self-hosted); Enterprise annual licensePartly open source
PortkeyAI gateway with fallbacks, load balancing, caching, guardrails, virtual keys and observabilityFree tier (10k logs/mo); Production $49/mo; open-source gateway free to self-hostOpen source
Vercel AI GatewayOne API key for 400+ models with provider failover, budgets, ZDR routing and spend reportingProvider list price, no markup (BYOK too); free monthly credits on a subset of modelsProprietary
Cloudflare AI GatewayProxy in front of LLM providers with analytics, caching, rate limiting, logging and DLPCore features free; 5% fee on credits bought through Unified BillingProprietary
BifrostOpen-source Go LLM gateway from Maxim AI with fallbacks, virtual keys, budgets and an MCP gatewayFree (Apache 2.0; self-hosted); Enterprise customOpen source
RequestyLLM gateway for 600+ models with routing policies, caching, fallbacks, spend limits and EU data residencyFree tier (free models, 200 req/day); pay as you go at provider price plus 5%Proprietary

We list what each vendor's own site says. Pricing changes often, so check it on the vendor's site before you commit.

Liked this guide? Get one new agent-infra guide a week.

One short email with a new guide and the tools worth knowing about. Free, and you can unsubscribe anytime.