Kevin Meneses
← Back to articles

8 Best AI Gateways

AILLMDevOpsOpen Source
8 Best AI Gateways

Most teams don't choose an AI gateway. They end up with one.

It starts with one OpenAI key in an environment variable. Then someone adds Anthropic for long contexts, a Groq model for cheap classification, and a fallback "just in case". Six months later you have:

  • provider keys spread across services,
  • retry logic copied into every repo,
  • and no idea which team spent $4,000 on tokens last week.

That's the point where an AI gateway stops being optional.

It sits between your application and every LLM provider. Your code talks to one OpenAI-compatible endpoint, and the gateway handles routing, failover, caching, budgets, guardrails and logs. The best one for you depends on where it has to run, how much traffic it carries, and whether your agents need MCP tools.

My top pick is Bifrost, the open-source gateway from Maxim AI (GitHub). It's written in Go, runs inside your own infrastructure, and adds microseconds of overhead rather than milliseconds. The other seven cover managed, edge, API-management and Kubernetes-native setups.

What is an AI gateway?

It's a proxy layer for LLM traffic. It exposes one API (usually OpenAI-compatible) and forwards each request to the right provider and model.

A regular API gateway counts requests. This kind of proxy also counts tokens and dollars, because a single request can cost $0.0001 or $2 depending on the model and the prompt.

The core jobs:

  • Routing and failover: retry, fall back to another provider, load-balance across keys.
  • Cost control: budgets and rate limits per team, app or customer.
  • Caching: return a stored answer for repeated (or semantically similar) prompts.
  • Governance and guardrails: who can call which model, and what's allowed in prompts and responses.
  • Observability: tokens, latency, cost and errors per request, exported to your monitoring stack.

Agent workloads added two more jobs: managing MCP tool access, so an agent sees only the tools it's allowed to call, and governing agent-to-agent (A2A) traffic.

How I picked these 8 gateways

I checked each gateway's documentation and pricing page on 30 November 2026 against seven criteria:

CriterionWhat I checked
Provider coverageNumber of providers, OpenAI/Anthropic API compatibility
Routing and failoverRetries, fallbacks, load balancing
CachingExact-match vs semantic caching
GovernanceVirtual keys, budgets, rate limits, SSO/RBAC
GuardrailsBuilt-in checks or integrations (PII, content safety)
ObservabilityLogs, metrics, OpenTelemetry/Prometheus export
DeploymentSelf-hosted, managed, edge, license

Where a vendor's docs don't mention a feature, I say "not documented" instead of guessing.

The 8 best AI gateways at a glance

GatewayTypeDeploymentCachingBudgets / rate limitsMCP / A2ALicense
BifrostOpen-source gatewaySelf-hosted, in-VPC, on-prem, air-gappedSemantic + exactYes (virtual keys)MCP gateway + Code Mode, A2A (Agent Gateway)Apache-2.0
LiteLLMOpen-source proxySelf-hostedExact + semanticYes (needs Postgres)MCPMIT (enterprise dir excluded)
KongAPI managementKonnect hybrid or dedicated cloudSemantic (enterprise plugin)YesMCP, A2AProprietary plugins
CloudflareManaged, edgeCloudflare networkExact matchYesNot documentedProprietary
VercelManagedVercelProvider prompt caching onlyYes (budgets)Not documentedProprietary
OpenRouterManaged marketplaceHostedExact matchCredit limits per keyNot documentedProprietary
Agent Router (formerly Envoy)Open-source, Kubernetes-nativeKubernetes / standaloneNot documentedToken quotasMCPApache-2.0
Azure API ManagementAPI managementAzureSemantic (external Redis)Yes (token limits)MCP, A2AProprietary

Open-source AI gateways

1. Bifrost: the fastest open-source gateway

Bifrost is an open-source gateway built by Maxim AI. It gives you one OpenAI-compatible API in front of 35+ providers (OpenAI, Anthropic, AWS Bedrock, Google Vertex, Azure, Groq, Mistral, Ollama and more), and runs as a single Go binary in your own infrastructure. The code is on GitHub under Apache-2.0, with around 10k stars.

Bifrost homepage

Speed is why it's #1. Bifrost adds about 11 µs of overhead per request at a sustained 5,000 RPS on a t3.xlarge instance (benchmarks). At that level the proxy is invisible next to model latency, which is measured in hundreds of milliseconds.

The feature set covers the whole list from the previous section:

  • Routing and failover: automatic retries and fallbacks across providers, plus weighted load balancing across keys.
  • Semantic caching: exact-match hashing plus embedding similarity, so "What's your refund policy?" and "How do refunds work?" can hit the same cached answer.
  • Governance: virtual keys per team, app or customer, each with its own budgets and rate limits. Your real provider keys never leave Bifrost.
  • MCP gateway: Bifrost connects to MCP servers and controls which tools each client sees. Code Mode lets the model write code against the tools instead of loading every tool definition into the context, which cuts tokens on agents with large toolsets.
  • Agent Gateway: Bifrost sits between your applications and your agents over the A2A protocol. It decides who can call each agent, routes the requests and logs every agent session.
  • Observability: request logs in the built-in UI, plus OpenTelemetry and Prometheus export.
  • Enterprise: guardrails, clustering, SSO and secret management.

It's also a drop-in replacement for the OpenAI, Anthropic and Google GenAI SDKs: you change the base URL and nothing else. It even works as the backend for coding agents like Claude Code and Codex CLI.

Pros

  • Lowest overhead of any gateway on this list (11 µs at 5k RPS).
  • LLM, MCP and agent traffic in one platform, with semantic caching and virtual-key budgets in the open-source version.
  • Runs fully inside your VPC, on-prem or air-gapped: prompts never touch a third party.

Cons

  • You operate it yourself (or buy Enterprise for clustering and support).
  • SSO, guardrails and clustering are Enterprise features.

Best for: enterprises running mission-critical AI workloads that need one place to route, govern and secure LLM, MCP and agent traffic, with low latency and full control over data and access. It fits regulated industries that require air-gapped, VPC-isolated or on-prem deployments.

Pricing: open source and free. Enterprise is custom-priced with a 14-day free trial.

Getting started with Bifrost in 2 minutes

The gateway quickstart is one command:

npx -y @maximhq/bifrost
docker run -p 8080:8080 maximhq/bifrost

Open http://localhost:8080, add your provider keys in the UI, and point the OpenAI SDK at it. Models use the provider/model format, and a fallbacks list tells Bifrost where to go if the primary fails:

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8080/v1",
    api_key="sk-bf-your-virtual-key",  # a Bifrost virtual key, not a provider key
)

response = client.chat.completions.create(
    model="openai/gpt-4o-mini",
    messages=[{"role": "user", "content": "Summarize this support ticket in one line."}],
    extra_body={
        "fallbacks": ["anthropic/claude-3-5-haiku-20241022", "groq/llama-3.3-70b-versatile"]
    },
)

print(response.choices[0].message.content)

If OpenAI returns an error or times out, Bifrost retries the request on Anthropic, then Groq. Your application code doesn't change.

From here you can add:

  • a virtual key per customer with a monthly budget,
  • semantic caching for repeated support questions,
  • an MCP server so your agent gets tools through the same endpoint.

2. LiteLLM: the most widely adopted Python proxy

LiteLLM is an open-source Python SDK and proxy server that exposes one OpenAI-compatible endpoint for 100+ providers. It's the default choice for many Python teams because it started as a library and grew into a full proxy.

LiteLLM homepage

The proxy handles retries, fallbacks (including context-window fallbacks), several routing strategies, exact and semantic caching on Redis or Qdrant, and virtual keys with spend tracking. See the proxy quickstart and virtual keys docs.

Pros

  • Huge provider coverage and a large community (64k GitHub stars).
  • Works as a Python SDK and as a standalone proxy.
  • Integrations with Langfuse, Datadog, OpenTelemetry and Prometheus.

Cons

Best for: Python teams that want a familiar SDK and moderate traffic.

Pricing: open source (MIT, except the enterprise/ directory). Enterprise is custom-priced with a 30-day trial.

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

Agent Router is the new name of the Envoy project, now part of the Agentic AI Foundation. It's built on Envoy Proxy and Envoy Gateway, and version 1.3.0 shipped on 18 November 2026. The docs cover both a standalone aigw run mode and the full Kubernetes setup.

Agent Router homepage

It routes to 22 providers through OpenAI- and Anthropic-compatible endpoints, with provider fallback, token-based quotas per team or model, MCP tool routing and OpenTelemetry GenAI traces.

Pros

  • Apache-2.0, vendor-neutral, built on Envoy.
  • Token quotas per team, app or model, now with weekly/monthly/yearly windows.
  • MCP tool catalog filtered per caller.

Cons

  • Full features assume Kubernetes and Envoy Gateway.
  • No response caching or built-in guardrails documented in the open-source project.

Best for: platform teams already running Envoy on Kubernetes.

Pricing: open source. A hosted version exists through Tetrate; pricing isn't published.

AI gateways in API management platforms

4. Kong AI Gateway: AI on top of an API gateway you may already run

Kong AI Gateway adds AI plugins to Kong's API gateway, managed through Konnect. If your company already routes its APIs through Kong, this is the shortest path to governing LLM traffic too. Kong's docs cover routing, load balancing, semantic caching, token rate limits, PII sanitization, prompt guards and an MCP server entity.

Kong product page

Pros

  • Mature API-management platform with AI plugins on top.
  • Strong guardrail set: prompt guards, PII sanitizer, AWS/Azure/GCP content-safety integrations.
  • MCP and A2A traffic governance.

Cons

  • Semantic cache and advanced AI rate limiting are enterprise plugins.
  • The Plus plan caps you at 5 models and 10M requests a month; fully self-hosted means custom-priced Gateway Enterprise.

Best for: enterprises standardized on Kong.

Pricing: AI Management Plus from $25/month plus usage (1M requests included, $200 per extra 1M, $100/month per model above 5). See Kong pricing.

5. Azure API Management: the option for Azure shops

Azure API Management includes a set of LLM-specific capabilities on top of APIM. It manages OpenAI, Anthropic Messages (v2 tiers), Vertex AI and Bedrock backends, with round-robin, weighted and priority load balancing, a circuit breaker, token quotas (llm-token-limit), semantic caching on Azure Managed Redis, and Azure AI Content Safety.

Azure API Management documentation

Pros

  • Native fit with Azure identity, monitoring and networking.
  • Token-per-minute limits and token metrics per consumer.
  • Can expose REST APIs as MCP servers.

Cons

  • Features vary by tier, and the unified OpenAI-compatible API is still in preview.
  • Semantic caching needs a Redis cache you provision and pay for separately.

Best for: companies whose AI stack already runs on Azure.

Pricing: per APIM tier and unit; the dedicated tier for this use case shows "coming soon" on the pricing page.

Managed AI gateways

6. Cloudflare AI Gateway: free analytics at the edge

Cloudflare's gateway proxies LLM calls through Cloudflare's network. Analytics, caching and rate limiting are free on every plan, and you can add retries, model fallbacks and dynamic routes with percentage splits.

Cloudflare product page

Pros

  • Core features free; inference passes through with no markup.
  • Easy to add if you're already on Cloudflare.
  • DLP scanning and spend limits.

Cons

  • Caching only matches identical requests.
  • MCP isn't documented; Unified Billing adds a 5% fee on purchased credits.

Best for: teams already on Cloudflare that want logs and caching with zero ops.

Pricing: free core features; log limits depend on your Workers plan. See Cloudflare's pricing docs.

7. Vercel AI Gateway: built for the AI SDK

Vercel's gateway gives you 400+ models behind one key, with no markup on tokens. It plugs into the Vercel AI SDK, the OpenAI SDK and the Anthropic Messages API. The docs cover ordered fallbacks, budgets per team, project or key, and request logs with per-request cost.

Vercel homepage

Pros

  • No token markup and no platform fee.
  • Zero setup if you deploy on Vercel.
  • Budgets at team, project, key and member level.

Cons

  • Hosted only: traffic goes through Vercel.
  • No response cache, guardrails or MCP documented; budgets exclude BYOK spend.

Best for: Next.js and AI SDK apps hosted on Vercel.

Pricing: pay-as-you-go credits at provider list price, plus a monthly free credit. See Vercel's pricing.

8. OpenRouter: the model marketplace

OpenRouter is a hosted marketplace with 600+ models from many providers behind one API key. It routes by price, throughput and latency, falls back across providers, and adds an exact-match response cache. See the quickstart.

OpenRouter homepage

Pros

  • The widest model catalog, including free models.
  • One credit balance for every provider.
  • Good for prototyping and model comparison.

Cons

  • 5.5% fee on credit purchases (8% on Business).
  • Hosted only; SSO is Enterprise-only; no MCP documented.

Best for: prototyping and apps that want many models without managing provider accounts.

Pricing: provider list prices plus the credit-purchase fee. See OpenRouter pricing.

AI gateway pricing compared

Prices from each vendor's pricing page, checked 30 November 2026.

GatewayFree optionPaid entry pointFee on tokensBilled by
BifrostOpen source, freeEnterprise: custom, 14-day trialNone (your own keys)Your infra
LiteLLMOpen source, freeEnterprise: custom, 30-day trialNone (your own keys)Your infra
Agent RouterOpen source, freeTetrate hosted: not publishedNone (your own keys)Your infra
KongNoPlus from $25/month + usageNoneControl planes, requests, models
Azure API ManagementDeveloper tier (non-production)Per tier and unitNoneTier units, requests
CloudflareCore features freeWorkers Paid for more logs5% only on Unified Billing creditsLogs
VercelMonthly free creditPay-as-you-go credits0% markupTokens at list price
OpenRouterFree models (rate-limited)Pay-as-you-go credits5.5% on credit purchasesTokens + fee

The open-source options cost nothing in fees, but you pay for the servers and the time to run them. At 5,000 requests per second, that's where per-request overhead matters: the less CPU the proxy needs per request, the smaller the instance you pay for.

How to choose the right AI gateway

Four questions settle most decisions:

  1. Can prompts leave your network? If not, you need a self-hosted option: Bifrost, LiteLLM or Agent Router.
  2. How much traffic? At thousands of RPS, overhead and memory become real costs. Bifrost's Go runtime is built for that range.
  3. Do your agents use MCP tools or talk to other agents? Bifrost, LiteLLM, Kong, Agent Router and Azure APIM document MCP support; Bifrost, Kong and Azure APIM also cover A2A. Cloudflare, Vercel and OpenRouter document neither.
  4. What's already in your stack? Kong shops should look at Kong, Azure shops at APIM, Vercel apps at Vercel's gateway.

If you're starting fresh and want one platform that covers routing, caching, budgets, MCP and agents without a vendor in the request path, start with Bifrost.

FAQs

What is the best AI gateway for enterprises?

For self-hosted production workloads, Bifrost: it's open source, adds about 11 µs of overhead at 5,000 RPS, and includes semantic caching, virtual-key budgets, an MCP gateway and an Agent Gateway. Managed options like Vercel and Cloudflare are simpler if you're fine with a hosted proxy.

Is there an open-source AI gateway?

Yes. Bifrost (Apache-2.0), LiteLLM (MIT, except its enterprise directory) and Agent Router (Apache-2.0) are all open source and self-hostable.

What is the difference between an AI gateway and an API gateway?

An API gateway manages requests: auth, routing and rate limits per call. The AI version adds LLM-specific controls: token and cost budgets, provider fallbacks, semantic caching, prompt guardrails and MCP tool governance.

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

In practice, they're the same thing. "AI" is the broader label and increasingly covers agent traffic (MCP tools, agent-to-agent calls) as well as LLM requests.

How much does an AI gateway cost?

Open-source options like Bifrost and LiteLLM are free; you pay for your own infrastructure. Managed services either pass tokens through at list price (Vercel, Cloudflare) or charge a fee on credits (OpenRouter: 5.5%). API-management platforms like Kong charge per control plane, request volume and model.


This layer used to be a convenience. With agents calling tools and models thousands of times a minute, it's now where cost, reliability and security get decided.

Pick the one that runs where your data has to stay. For most teams building in-house, that's Bifrost.