OpenRouter vs LiteLLM vs Portkey: LLM gateways for AI agents compared
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
- Vercel AI Gateway charges provider list price with no markup, including with your own keys, and draws from prepaid credits. It covers 400+ models and has budgets per team, project, and API key. A free tier gives monthly credits on a subset of models with lower rate limits. Some add-ons cost extra, such as team-wide zero data retention at $0.10 per 1,000 requests.
- Cloudflare AI Gateway sits in front of providers you already use. Analytics, caching, and rate limiting are free on all Cloudflare plans. If you buy model credits through its Unified Billing, it adds a 5% fee and passes token prices through unchanged.
- Bifrost from Maxim AI is an Apache 2.0 open-source gateway you run with
npx @maximhq/bifrost. It includes virtual keys, budgets, fallbacks, OpenTelemetry, and an MCP gateway, with paid enterprise features. - Requesty is a hosted gateway that charges provider price plus 5%. Its free tier covers free models at 200 requests a day with no credit card, and paid use includes BYOK, spend limits, and EU data residency.
Which one to pick
- You want one account and one bill for every model: OpenRouter, or Requesty.
- You don't want any fee on top of token prices: Vercel AI Gateway (hosted), or LiteLLM or Bifrost (self-hosted).
- Prompts must stay inside your own network: LiteLLM or Bifrost, self-hosted.
- You want gateway logs, traces, and prompt management in one hosted product: Portkey.
- You already run on Cloudflare and want caching and rate limits for free: Cloudflare AI Gateway.
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.