Skip to main content

Guide · AI engineering

Best AI Gateways and LLM Routers

Last reviewed

Once an app calls more than one model provider, you end up rewriting the same things: API keys per provider, retries when one is down, spend limits per team and a log of what each call cost. An AI gateway sits between your code and the providers and does that work in one place. The real choices are hosted or self-hosted, whether you bring your own provider keys and whether you need governance features like budgets and guardrails or just one API for many models.

Quick pick

One key for hundreds of models, nothing to run
OpenRouter
Self-hosted gateway with virtual keys and budgets
LiteLLM
Your app already uses the AI SDK
Vercel AI Gateway
Caching and rate limits at the edge
Cloudflare AI Gateway
Guardrails and governance for a team
Portkey
Gateway with built-in observability
Helicone

The options, and when to use each

OpenRouter

hostedOpenAI-compatiblefallbacks

Use it for: You want one API key and one bill for text, image and audio models from many providers and to switch models by changing a name.

Tradeoff: Every request goes through a third party, which matters if your data rules require direct provider contracts.

LiteLLM

open sourceself-hostedPython SDKbudgets

Use it for: You want a gateway you run yourself that speaks the OpenAI format for 100+ providers, with virtual keys and per-team budgets.

Tradeoff: You own the proxy: uptime, upgrades and the database behind it are your job.

Vercel AI Gateway

hostedAI SDKBYOKbudgets

Use it for: You want provider failover, request logs and budgets from a hosted endpoint, called from the AI SDK or any OpenAI or Anthropic client.

Tradeoff: Needs a Vercel account for keys and billing, even if your app runs elsewhere.

Cloudflare AI Gateway

edgecachingrate limits

Use it for: You want caching of repeat requests, rate limits, retries and model fallback with analytics on tokens and errors.

Tradeoff: Fits best when the rest of your stack already lives on Cloudflare.

Portkey

guardrailsgovernanceprompts

Use it for: A team needs one API for many models plus guardrails, governance, caching and prompt management.

Tradeoff: More platform than you need if all you want is a single endpoint for two providers.

Helicone

open sourceobservability

Use it for: You want routing plus request, session and user tracking, rate limits and alerts in one open source tool.

Tradeoff: Leans toward observability; check that its routing features cover your fallback rules.

Skills that use these tools