Best LLM gateways in 2026, compared and ranked

The best LLM gateways in 2026, ranked: Bifrost, LiteLLM, Kong, Agent Router, Cloudflare, Vercel, and OpenRouter on failover, budgets, MCP, and licensing.

Published
Reading time
14 min read
Level
Intermediate
By
AI for Devs
TL;DR
  • Bifrost is the best LLM gateway for most teams as of November 16, 2026. Its Apache 2.0 core includes provider failover, virtual-key budgets, semantic caching, an MCP gateway, and A2A agent routing, and the Bifrost team reports its overhead in microseconds.
  • LiteLLM connects to 100+ providers and adds free guardrails, but run it pinned: PyPI releases 1.82.7 and 1.82.8 carried a credential stealer on March 24, 2026.
  • Cloudflare AI Gateway, Vercel AI Gateway, and OpenRouter need no servers, but every prompt passes through the vendor's network. Vercel adds no fee on tokens; OpenRouter charges 5.5% on credit purchases.
  • Envoy AI Gateway is now called Agent Router, and it is the pick for teams that already run Envoy Gateway on Kubernetes.
  • Every published overhead figure is vendor-run on a mocked provider. The Bifrost team reports 11 µs for Bifrost at 5,000 requests per second and LiteLLM reports 3.32 ms on average, so measure on your own traffic.

An LLM gateway is a proxy between your code and the model providers it calls: one API in front, with routing, failover, budgets, caching, and logs behind it. This ranking covers seven LLM gateways that are current as of November 16, 2026, four you run yourself and three managed services, compared on the nine criteria that decide a production choice. Every capability was read from each project's own docs that day. No gateway was installed or load-tested for this article, and each benchmark names who ran it.

#What an LLM gateway does

An LLM gateway gives every application one endpoint and one credential, then runs the same checks on each model call before a provider sees it. A request passes authentication, a budget check, a cache lookup, guardrails, and routing, and the gateway records tokens and cost on the way out. The AI gateway glossary entry defines the term.

One request through an LLM gateway: auth, budget, cache, guardrail, and routing checks, a cache hit that returns without a provider call, and a fallback from a rate-limited provider to a second oneAppSDK callLLM gatewayAuthvirtual keyBudgetrate limitCachehit or missGuardrailPII checkRoutepick keyHit: cached response, no provider callProvider A429: try nextProvider Bfallback: 200Logs, metrics, and token cost per requestcheck on every requestfailed tryserved
Fig. 1Every request passes the same checks before a provider sees it. A cache hit returns without a provider call, and a 429 from one provider becomes a try on the next, with no change to your code.

The names LLM proxy and LLM gateway overlap, and vendors use both. An LLM proxy forwards OpenAI-format requests to several providers. A gateway adds the policy layer: per-team keys, spend limits, fallbacks, and audit records. LiteLLM's README calls its server a proxy and a gateway in the same line, so judge each product by what it enforces.

You need a gateway once a second provider, a second team, or an agent with tool access arrives. With one provider and one app, the provider's SDK retries and console are often enough, and a gateway adds a network hop and a service to keep running.

#How to choose an LLM gateway: nine criteria

Nine criteria separate LLM gateways once traffic is real. They cover what the gateway costs per request, what it can reach, how it fails, what it enforces, and where it runs under which license. The table gives the check for each.

CriterionWhat to checkWhy it matters
Latency overheadTime added per request at your peak rate, with your features turned onOverhead stacks on every call, and an agent loop makes many calls per task
Provider coverageYour providers, plus the endpoints you use: chat, Responses, embeddings, batch, audioA gateway that covers chat but not batch sends part of your traffic around it
Failover and load balancingWhich errors trigger a retry, a key rotation, or a switch of providerA 429 and a 401 need different handling, and retrying a dead key burns the time budget
CachingExact-match, semantic, or only provider prompt cachingA response cache skips the provider call; prompt caching only discounts it
Budgets and keysLimits per key, team, and user, and whether they are hard capsA soft cap lets a looping agent overshoot before requests stop
GuardrailsPII and secrets checks on requests and responses, and which tier includes themGuardrails at the gateway cover every app at once
ObservabilityPer-request logs, Prometheus metrics, OpenTelemetry exportCost per team and failure reasons come from these records
MCP and agent trafficMCP server connections, tool filtering per key, A2A agent routingTool calls carry the same data risk as model calls
Self-hosting and licensingWhere it runs, what the license allows, which features need a paid tierPrompts stay in your network only if the gateway does

Check the last row first, because it removes options fastest. A workload that cannot send prompts to a third party rules out the three managed gateways before any feature comparison. The MCP server guide shows which controls a gateway takes over from each MCP server.

#The best LLM gateways compared

Bifrost ranks first on the combination it offers: a free core that covers failover, budgets, semantic caching, MCP, and A2A, published overhead in microseconds rather than milliseconds, and one deployment path from a single binary to an air-gapped Enterprise cluster. LiteLLM matches most of that free feature list and adds free guardrails, but runs as a Python service that needs Postgres for virtual keys.

The table records where each feature sits as of November 16, 2026. "AI License" marks Kong plugins that need its AI Gateway Enterprise offering.

GatewayRuns whereLicenseFailoverResponse cacheBudgetsMCP and agents
1. BifrostYour infrastructure: binary, Docker, Kubernetes, air-gappedApache 2.0 core, paid Enterprise tierRetries, key rotation, provider fallbackExact and semanticPer key, team, and customerMCP gateway with Code Mode, A2A
2. LiteLLMYour infrastructure: Python proxy or DockerMIT, with an enterprise folder under its own licenseFallbacks and load balancingExact and semanticPer key and team; tag budgets paidMCP gateway, A2A endpoint
3. Kong AI GatewayYour infrastructure or KonnectApache 2.0 gateway, AI License pluginsSeven algorithms (AI License)Semantic (AI License)Token limits (AI License)MCP and A2A proxies (AI License)
4. Agent RouterKubernetes with Envoy Gateway, or standaloneApache 2.0Provider fallbackNone; provider prompt cachingToken rate limits and quotasMCP gateway, A2A
5. Cloudflare AI GatewayCloudflare's networkProprietary; core features freeFallbacks and dynamic routesExact matchSpend and rate limitsSeparate product
6. Vercel AI GatewayVercel's networkProprietary; no fee on tokensProvider and model fallbacksNone; provider prompt cachingPer team, project, key, member (soft)Not documented
7. OpenRouterOpenRouter's networkProprietary; 5.5% credit feeProvider fallbacks by defaultIdentical requestsWorkspace budgets, key limitsAgent SDK only

Three of the four self-hosted gateways put an MCP gateway in the free tier: Bifrost, LiteLLM, and Agent Router. The platform directory lists these gateways next to the model APIs they route to.

#1. Bifrost: the best LLM gateway overall

Bifrost is the best LLM gateway for teams that want one self-hosted control point for model, MCP, and agent traffic. Bifrost, an open-source AI gateway written in Go, gives one OpenAI-compatible API to 10,000+ models across 25+ providers, including self-hosted vLLM, SGLang, and Ollama. It also serves Anthropic, Bedrock, and Google GenAI-compatible endpoints, so existing SDK code moves over with a base URL change.

Bifrost documents its failover rules per error class. Its retries and fallbacks classify each failure before acting: a rejected key is dropped at once without using a retry, a 429 rotates to another key with backoff, and a 5xx retries the same key with exponential backoff. Only then does the next provider in the chain get the request, with a full retry budget of its own.

Retry and fallback walk with max_retries 2: a key rejected with 401 is dropped without using a retry, a 429 rotates keys with backoff, two 503s on the same key spend both retries, and the fallback provider serves the request with its own retry budgetProvider 1primaryProvider 2fallbackKey A401 credentialKey dead: rotate nowNo retry usedKey B429 rate limitRotate key, back offRetry 1 of 2Key C503 transientSame key, back offRetry 2 of 2Key C503 transientNo retries leftTry next providerKey D200 OKOwn retry budget:0 of 2 usedfailed attemptservedmax_retries = 2
Fig. 2An example walk built from Bifrost's documented retry rules, with max_retries set to 2. A rejected key costs no retry, a 429 rotates keys, two 503s spend both retries, and the fallback provider starts with its own budget.

Keys within one provider share traffic by weighted random selection. Session affinity keeps a conversation or agent run on the provider and key that served it, so the provider's prompt cache stays warm, and Claude Code, Codex CLI, and OpenCode get it with no configuration. Semantic caching adds a response cache with exact-hash and similarity lookups, stored in Redis or Valkey, Qdrant, Weaviate, or Pinecone.

Virtual keys carry budgets and rate limits per key, checked together with budgets on the team or customer above them. As an MCP gateway, Bifrost connects to MCP servers over STDIO, HTTP, or SSE, filters tools per virtual key, and returns tool calls to your app unrun unless Agent Mode is set to auto-approve them.

Code Mode has the model write a short script that calls tools in a sandbox, and the Bifrost team reports that it cuts input tokens by up to 92.8% across several MCP servers. The Agent Gateway registers A2A agents behind the same virtual keys and records each session's tasks, model calls, and tool calls.

Bifrost ships as one binary or container, with deployment guides for Docker, Helm on EKS, GKE, and AKS, ECS, Cloud Run, and others. Air-gapped installs work once the pricing datasheets are loaded from local files. Teams on LiteLLM can copy models, keys, teams, and virtual keys across with a migration CLI.

The open-source tier keeps its shared state on one node. Budgets and usage live in memory, the docs do not support several open-source nodes on one Postgres backend, and they put a single instance at about 3,000 to 5,000 requests per second. Guardrails, the leaderless cluster mode, adaptive routing, SSO with SCIM, RBAC, and audit logs are Enterprise features, so a team that needs free PII redaction gets it from LiteLLM, not Bifrost.

Governance also has to reach AI tools that never call your gateway. Bifrost Edge extends the gateway's policies to employee machines: it routes traffic from apps such as Claude Desktop, Claude Code, Codex CLI, and Cursor through the same gateway, so the virtual keys, budgets, and guardrails set there apply on each laptop. Edge requires Bifrost Enterprise, and its supported applications page lists what it covers.

Best for: platform teams that need one self-hosted control point for model, MCP, and agent traffic, with a path to clustering, identity-based governance, and endpoint coverage without changing gateways.

#2. LiteLLM: 100+ providers for Python teams

LiteLLM is the gateway to choose when provider coverage and a Python codebase matter most. LiteLLM by BerriAI is a Python SDK and proxy server that calls 100+ providers in the OpenAI format, and at about 63,000 GitHub stars on November 16, 2026, it is the most-starred project in this list.

The open-source proxy includes virtual keys, basic budgets, spend tracking, an admin UI, load balancing, custom guardrails with Presidio PII masking, an MCP gateway, and an /a2a endpoint for agents. Its cache runs in memory, Redis, Valkey, S3, GCS, or on disk, with semantic caching through Redis, Valkey, or Qdrant. Its own caching docs warn that semantic caching fits single-shot prompts and goes wrong on agent traffic. Virtual keys need a Postgres database.

An enterprise license adds SSO past five users, RBAC, audit logs, secret managers, guardrails per key or team, and tag-based budgets. LiteLLM's own benchmark, on four instances behind a mocked OpenAI endpoint, reports 3.32 ms of average gateway overhead at about 1,170 requests per second.

Run it pinned and patched. On March 24, 2026, PyPI releases 1.82.7 and 1.82.8 shipped a credential stealer, which LiteLLM says did not reach its official Docker image. On April 20, 2026, LiteLLM published a critical advisory, CVE-2026-42208, for SQL injection in the proxy's key verification, fixed in 1.83.7.

Best for: Python teams that need a long provider list and free guardrails, and can run Postgres and patch on a schedule.

#3. Kong AI Gateway: for teams already on Kong

Kong AI Gateway is the right choice when Kong already fronts your APIs and you hold an AI license. Kong AI Gateway adds AI policies to Kong Gateway for LLM, MCP, and A2A traffic. Version 2.x declares providers, models, MCP servers, and agents as resources in the Konnect control plane instead of plugin settings.

The free part is narrow. The base AI Proxy plugin (Kong Gateway 3.6 and later) and AI Prompt Guard carry no license label in Kong's plugin hub. AI Proxy Advanced, AI Semantic Cache, AI Rate Limiting Advanced, AI Semantic Prompt Guard, AI MCP Proxy, and AI A2A Proxy are each marked AI License Required.

With the license, AI Proxy Advanced balances across models with seven algorithms: round-robin, consistent hashing, least connections, lowest latency, lowest usage, semantic, and priority, plus a circuit breaker from version 3.13. Guardrail plugins call AWS Bedrock Guardrails, Azure Content Safety, and Google Model Armor. Kong runs self-managed, in Konnect, or on Kong-hosted dedicated cloud gateways.

Best for: organizations that already run Kong in production and want AI traffic under the same control plane as their REST APIs.

#4. Agent Router (formerly Envoy AI Gateway): Kubernetes-native

Agent Router is the open-source choice for platform teams that already run Envoy Gateway on Kubernetes. Agent Router is the new name for Envoy AI Gateway, which joined the Agentic AI Foundation on September 10, 2026, under the same Apache 2.0 license. Its CRDs, aigw CLI, Helm charts, and images kept their names, so existing manifests still apply.

It runs on Kubernetes through Envoy Gateway, or on a laptop as a standalone router with aigw run. Version 1.0, in June 2026, declared its control-plane API stable with 16 providers and an MCP gateway, and 1.2.1 is the current release. It enforces token-based rate limits and token quotas over time windows, falls back between providers, and routes to self-hosted model servers through InferencePool, using live signals such as KV-cache use and queue depth. Prometheus metrics and OpenTelemetry GenAI tracing are built in.

The gaps are caching and content checks. Agent Router passes provider prompt caching through but has no response cache, and its docs describe request and response redaction rather than guardrails.

Best for: Kubernetes platform teams that serve self-hosted models next to hosted APIs and want gateway configuration as CRDs.

#5. Cloudflare AI Gateway: managed on Cloudflare's network

Cloudflare AI Gateway is the quickest managed option for teams already on Cloudflare. Cloudflare AI Gateway proxies requests through Cloudflare's network, and its analytics, caching, and rate limiting are free on all plans.

Caching is exact-match only: any change to the request body creates a new entry, with a TTL from 60 seconds to one month. Dynamic routes add conditions, percentage splits, and budget limits, and model aliases try models in a set order. Spend limits cap cost by model, provider, or custom metadata such as a user ID. Guardrails bill as Workers AI inference, DLP scanning is free, logs export through Logpush, and traces export over OpenTelemetry.

Unified Billing, which bills provider usage through Cloudflare, adds a 5% fee to credit purchases. MCP traffic sits outside AI Gateway, in Cloudflare One's MCP server portals, and neither product runs outside Cloudflare.

Best for: teams on Cloudflare that want caching, analytics, and spend limits for model calls without running a service.

#6. Vercel AI Gateway: managed, with no fee on tokens

Vercel AI Gateway is the managed option with the plainest pricing: the provider's list price, with no markup and no platform fee on tokens. Vercel AI Gateway is a hosted API at ai-gateway.vercel.sh that apps on any cloud can call. Its public model list returned 509 models, 324 of them language models, on November 16, 2026.

It accepts OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages requests, with ordered provider and model fallbacks. Budgets apply per team, project, API key, or member, but they are soft caps and exclude spend on your own provider keys. Bringing your own keys requires purchased credits, and a failed request on your key falls back to Vercel's keys, billed to those credits.

Caching here means provider prompt caching through caching: 'auto', and full responses are left to your app. Per-request zero data retention costs nothing extra, while the team-wide setting costs $0.10 per 1,000 requests.

Best for: TypeScript teams on the AI SDK that want one bill and provider fallbacks without running anything.

#7. OpenRouter: one key for 468 models

OpenRouter is a model marketplace first and a gateway second, and it is the quickest way to try many models on one key. OpenRouter listed 468 models in its models API on November 16, 2026. It passes provider prices through without markup and charges 5.5%, with a $0.80 minimum, when you buy credits.

Default routing weighs effective price, throughput, time to first token, and reliability, and falls back to the next provider on errors. Setting sort orders providers by price, throughput, or latency instead. Setting zdr: true limits a request to zero-data-retention endpoints, and OpenRouter does not log prompts or completions by default. Response caching covers identical requests, and workspace budgets and guardrail policies set spend limits, model access, and moderation.

Your own provider keys are free up to $25,000 of list-price usage a month, then cost 5%. OpenRouter cannot run inside your network, so every request passes through its servers.

Best for: prototypes and small teams that want frontier and open models on one key and accept a third party in the data path.

#LLM gateway latency overhead: published numbers and your own test

Every overhead figure published for these gateways was measured by the vendor that sells it, against a mocked provider, so treat each as the gateway's best case. The setups differ enough that the numbers do not compare across vendors.

FigureRun bySetupResult
Bifrost overhead, t3.xlargeBifrost team5,000 RPS, mocked OpenAI, responses near 10 KB11 µs per request, 100% success
Bifrost overhead, t3.mediumBifrost team5,000 RPS, mocked OpenAI, responses near 1.4 KB59 µs per request, 100% success
Bifrost and LiteLLM head-to-headBifrost teamt3.medium, 500 RPS, 500 virtual users, 60 seconds424 vs 44.84 requests per second; P99 1.68 s vs 90.72 s; overhead 0.99 ms vs 40 ms on a 60 ms mock
LiteLLM overheadBerriAIFour 4-vCPU instances, mocked OpenAI, about 1,170 RPS3.32 ms average, 8 ms p95

The Bifrost rows come from its benchmark docs and the Bifrost team's benchmark page, read November 16, 2026. The 11 µs total excludes JSON marshaling and the HTTP call, which those docs say any implementation needs. On the same run, JSON marshaling took 26.80 µs and response parsing 2.11 ms, both outside the total. Neither vendor's page states a run date, and the Bifrost team's head-to-head does not name the LiteLLM version it tested.

Time per request on a log scale from the Bifrost team's t3.xlarge run at 5,000 requests per second: gateway steps from 10 nanoseconds to 7.17 microseconds, a reported overhead of 11 microseconds, JSON work of 26.80 microseconds and 2.11 milliseconds, and 1.50 seconds for the mocked provider callTime per request, log scaleKey selection10 nsError handling162 nsParams preparation417 nsQueue wait1.67 µsMessage formatting2.11 µsRequest body2.36 µsRequest setup7.17 µsReported overhead11 µsJSON marshaling26.80 µsResponse parsing2.11 msHTTP call to mock1.50 sEnd-to-end average1.61 s1 ns1 µs1 ms1 sgateway stepreported totaloutside totalprovider
Fig. 3The Bifrost team's t3.xlarge run at 5,000 RPS against a mocked OpenAI endpoint, on a log scale. The mocked provider call takes 1.50 s, about 136,000 times the 11 µs reported overhead, and JSON handling outside that total takes longer than any step inside it.

Run your own test before you commit, with the same steps for every gateway on your shortlist:

  1. Stand up a mock provider that answers after a fixed delay, such as 60 ms, so provider variance drops out.
  2. Send the same load straight to the mock and through the gateway at your real peak rate, then subtract the latencies at p50 and p99.
  3. Turn on the features you will run: logging, budgets, guardrails, and caching each add work on the request path.
  4. Compare your result with the gateway's own figure. Bifrost's logs split each request into upstream time and overhead, and LiteLLM returns its overhead in a response header.
  5. Stop one provider mid-run and record how long failover takes and how many requests fail.

Coding agents make these numbers matter most, because one task sends many requests in a row. The coding model comparison shows two models behind one gateway, and the LLM pricing dataset gives the list prices to set budgets from.

#Questions

What is an LLM gateway?

An LLM gateway is a proxy between your applications and model providers that exposes one API, usually OpenAI-compatible, for many models. It applies the same authentication, budgets, rate limits, caching, guardrails, and failover to every request, and logs tokens and cost per call. Bifrost, LiteLLM, Kong AI Gateway, and Agent Router run in your infrastructure; Cloudflare, Vercel, and OpenRouter run it for you.

What is the difference between an LLM gateway and an LLM proxy?

An LLM proxy forwards requests in one format to several providers. An LLM gateway is a proxy plus policy: per-team keys, spend limits, retries and fallbacks, guardrails, and audit logs. The names overlap in practice, and LiteLLM calls its server both. Judge a product by whether it enforces budgets and failover, not by which word it uses.

What is the best open source AI gateway?

Bifrost is the best open source AI gateway for most self-hosted deployments as of November 16, 2026. Its Apache 2.0 core includes failover, virtual-key budgets, semantic caching, an MCP gateway, and A2A agent routing in one Go binary. LiteLLM suits Python teams that need free guardrails and 100+ providers, and Agent Router suits Kubernetes teams that run Envoy.

Does an LLM gateway add latency?

Yes. Every gateway adds some time per request, and the amount depends on the implementation and the features you turn on. The Bifrost team reports 11 µs for Bifrost at 5,000 requests per second on a mocked provider, and LiteLLM reports 3.32 ms on average on its own setup. Both are vendor-run, so measure p50 and p99 against a mock provider at your own peak rate.

Is OpenRouter an LLM gateway?

OpenRouter works as a hosted LLM gateway for routing and billing: one key, 468 models in its API on November 16, 2026, provider fallbacks, and workspace budgets. It also resells inference, so requests pass through its servers and credit purchases carry a 5.5% fee. It cannot run in your network, which rules it out for workloads that must keep prompts in-house.

Do I need an LLM gateway if I use one provider?

Usually not at first. With one provider and one application, the provider's SDK handles retries and its console shows spend. A gateway pays off when a second provider, a second team, or an agent with tool access arrives, because budgets, failover, and logs then need one place. Adding one later costs a base URL change and a service to run.