What is the best AI gateway in 2026?
A good AI gateway saves you more than it costs: in fees, in outages and in surprise bills.
An AI gateway (or LLM gateway) sits between your app and the model providers. Your code calls one endpoint; the gateway routes to OpenAI, Anthropic, Google or Mistral, falls back when one is down, caps each team's budget and logs every call.
Short answer. LiteLLM is the best gateway if you can host it: open source, $0, hard budgets per key. OpenRouter is the fastest hosted start, with 600+ models and a 5.5% fee on credits. Vercel AI Gateway charges zero markup, even with your own keys. Portkey wins on logs and guardrails, Cloudflare AI Gateway gives caching and rate limits for free, TrueFoundry runs in your VPC, Bifrost is the fast open source newcomer, and Kong AI Gateway suits teams already on Kong.
What vendor pages skip: where the fee actually sits (on credits, on logs, per model, per user), what changed in 2026 (a compromised LiteLLM release, Portkey bought by Palo Alto Networks), and when you need no gateway at all. We compared the eight on all of it.
The ranking is editorial: a sponsored spot is always labeled on its card, and no affiliate link changes a score.
The best AI gateway for your case
Hard budgets per key, team and model
Best hosted model marketplace600+ models, one balance, zero ops
Best zero-markup hosted gatewayZero markup, even with your own keys
Best for governance and observabilityGuardrails, prompt versioning, full traces
Best free gatewayFree caching and rate limits at the edge
Best for VPC and on-premRuns in your VPC, on-prem or air-gapped
Low-overhead open source pick11 µs overhead at 5,000 requests per second
Best if you already run KongAI plugins on an existing API gateway
8 AI gateways compared
This ranking is for developers, platform engineers and CTOs who call more than one model provider, or who need budgets, fallbacks and logs across several apps. Price shown is what the gateway itself charges; tokens are extra everywhere.
| Best for | What sets it apart | Free plan | Team size | Visit | ||||
|---|---|---|---|---|---|---|---|---|
| 1 | LiteLLM | Best open source gateway | Hard budgets per key, team and model | 4.5/5 | Free (open source) | ✓ | Platform teams that self-host | Visit → |
| 2 | OpenRouter | Best hosted model marketplace | 600+ models, one balance, zero ops | 4.4/5 | List price + 5.5% on credits | ✓ | Startups and indie developers | Visit → |
| 3 | Vercel AI Gateway | Best zero-markup hosted gateway | Zero markup, even with your own keys | 4.3/5 | $5 free/mo, then list price | ✓ | Teams shipping on Vercel or the AI SDK | Visit → |
| 4 | Portkey | Best for governance and observability | Guardrails, prompt versioning, full traces | 4.2/5 | Free, then $49/mo | ✓ | Teams that need audit trails | Visit → |
| 5 | Cloudflare AI Gateway | Best free gateway | Free caching and rate limits at the edge | 4.1/5 | Free core features | ✓ | Any team on Cloudflare | Visit → |
| 6 | TrueFoundry | Best for VPC and on-prem | Runs in your VPC, on-prem or air-gapped | 4.0/5 | Free (3 users), then $25/user/mo | ✓ | Enterprises with data residency rules | Visit → |
| 7 | Bifrost | Low-overhead open source pick | 11 µs overhead at 5,000 requests per second | 3.9/5 | Free (open source) | ✓ | High-throughput teams | Visit → |
| 8 | Kong AI Gateway | Best if you already run Kong | AI plugins on an existing API gateway | 3.7/5 | From $25/mo + $100/model/mo | — | Enterprises already on Kong | Visit → |
Prices in US dollars, read in 2026 on each vendor's official pricing page, before tax. Model tokens are billed on top by the provider or the gateway.
Is your tool missing from this page? Email us: hello@hackceleration.com
How we compared and scored
This page ranks gateways, not models. To choose the model behind the gateway, start with our best LLM API comparison; for the hosting layer, see our AI infrastructure ranking.
For each gateway we read its pricing page, its docs and, for the open source ones, its repository. Then we read developer threads on Reddit and Hacker News about what breaks after the first month: fees nobody noticed, logs that stop, proxies that slow down under load, security incidents.
Models and routing is 25% of the score (provider coverage, fallbacks, load balancing). Cost and pricing clarity is 25%: fees on credits, per log, per model or per user, and how easy they are to predict. Governance and observability is 20% (virtual keys, budgets, logs, guardrails). Deployment and data control is 15%: self-hosted, VPC, or hosted only. Setup and reliability is 15%: time to first request, maintenance, track record.
- Models and routingProviders, fallbacks, load balancing.25%
- Cost and pricing clarityWhere the fee sits, and how predictable it is.25%
- Governance and observabilityKeys, budgets, logs, guardrails.20%
- Deployment and data controlSelf-hosted, VPC, or hosted only.15%
- Setup and reliabilityTime to start, upkeep, incidents.15%
Gateway pricing changes fast. Get the ranking when it moves
LiteLLM
LiteLLM is the default open source answer to "how do I put every model behind one key?". The LiteLLM AI Gateway is a self-hosted server: your apps call one OpenAI-compatible endpoint, and it forwards each request to Anthropic, OpenAI, Bedrock, Vertex, Mistral or any of the 140+ providers it integrates.
The value is in the keys. Each team or project gets a virtual key, and each key has its own models, budgets and rate limits. Budgets are hard: when a team hits its cap, requests stop. The gateway records the cost of every request, so finance gets spend per key, team, user and tag without a spreadsheet. Load balancing, fallbacks and retries move traffic when a provider fails.
The open source version costs $0. The Enterprise tier adds JWT auth, SSO, audit logs and support with custom SLAs.
The catch is that you run it. You own the servers, the database, the upgrades and the on-call pager. A team that compared five gateways on Reddit in 2026 found it great for getting started, but said per-user rate limits are painful to configure and RBAC feels bolted on at enterprise scale. And in 2026 two PyPI releases (1.82.7 and 1.82.8) were compromised for about 40 minutes; the official Docker image was not affected.
Tip: deploy the official Docker image and pin the version tag. Never run an unpinned pip install litellm in a build pipeline.
- Virtual keys with their own models and budgets
- Spend per key, team, user and tag
- Load balancing, fallbacks and retries
- ✓Free and open source
- ✓Your keys and logs stay on your infra
- ✓140+ provider integrations
- ✗You run and patch it
- ✗RBAC and per-user limits take work
- ✗Pin versions after the 2026 PyPI incident
The best gateway if you have someone to run it. Pin the Docker image, set a budget on every key, and you get most of what paid gateways sell, for $0 in licenses.
OpenRouter
OpenRouter is a hosted marketplace: one API key, one credit balance, 600+ models from 80+ providers. Swap a model by changing a string. When a provider is down, its routing retries another one automatically.
Pricing is simple once you read it right. Inference is billed at the provider's list price on every plan. OpenRouter's fee is charged when you buy credits: 5.5% on Standard and 8% on Business, never on individual requests. So $1,000 of credits costs $1,055 on Standard. Bring your own provider keys (BYOK) and the first $25,000 of list-price inference each month carries no fee, then 5%.
Free models exist, capped at 20 requests a minute and 50 a day, rising to 1,000 a day once your account has bought at least $10 of credits. In a 2026 Reddit thread, one developer balks at the 5.5% fee and looks at LiteLLM instead, while another team says reliability and fallbacks matter more to them than the fee. A detail in OpenRouter's favor: an attempt that errors is not charged for its model tokens, so with fallback you pay only for the run that answers.
The limit: your prompts go through a third party. SSO and managed policy enforcement are Enterprise-only.
Tip: if your spend is mostly on two providers you already pay, use BYOK. Under $25,000 a month, you keep OpenRouter's routing and fallbacks without the fee.
- 600+ models, 80+ providers
- Fee on credit purchases, not on requests
- Free BYOK allowance each month
- ✓Nothing to host
- ✓Automatic provider fallbacks
- ✓Free models to prototype
- ✗5.5% or 8% on every credit top-up
- ✗Prompts transit a third party
- ✗SSO only on Enterprise
A fast way to reach 600+ models. Worth the 5.5% for small teams; switch to BYOK as spend grows.
Vercel AI Gateway
Vercel AI Gateway gives you 400+ models behind one key with automatic fallbacks during provider outages. It plugs straight into Vercel's AI SDK, and the docs cover use from any infrastructure.
The pricing is the draw. On the paid tier, the gateway provides tokens with zero markup, including when you bring your own key. Every Vercel team also gets $5 of credit a month on the free tier, limited to a subset of models with lower rate limits. You buy credits as you go, with no commitment.
Zero markup does not mean zero cost. Some controls are paid add-ons: team-wide zero data retention and a team-wide provider allowlist each cost $0.10 per 1,000 requests, and AI Gateway traces are billed per 1,000. Check the add-on list before you turn everything on.
The limit: it is hosted only, so your traffic goes through Vercel. BYOK is not available on the free tier, and on the paid tier a request that fails with your key is retried with Vercel's credentials and charged to your credits; AI Gateway budgets also exclude BYOK spend, so set spend limits at the provider too.
Tip: claim your $5 of free credit to prototype, then buy credits only when you move to production. Credits carry no commitment.
- 400+ models, automatic fallbacks
- Zero markup, BYOK included
- $5 free credit every month
- ✓No fee on tokens
- ✓Native to the AI SDK
- ✓Pay as you go, no commitment
- ✗Hosted only
- ✗BYOK needs the paid tier
- ✗ZDR and allowlist are paid add-ons
List prices and no fee on tokens, on paper and in the docs. Best if you already build on Vercel.
Portkey
Portkey started as an open source gateway (MIT licensed, a small footprint) and grew into a control plane: routing to 1,600+ LLMs, fallbacks, automatic retries, load balancing, guardrails, prompt management and full request traces.
Pricing is by recorded logs, not tokens. The Developer plan is free with 10k recorded logs a month and 3-day log retention, and Portkey itself says it is not suitable for production workloads. Going over the limit does not block requests; only the extra logs are not recorded. Production is $49 a month with 100k logs, then $9 per extra 100k. Enterprise is custom.
The big change: in 2026 Palo Alto Networks completed its acquisition of Portkey and made it the gateway of its Prisma AIRS security platform. Good news for security teams that buy Palo Alto; a question mark for small teams on the cheap plans.
The limit: a team that compared gateways on Reddit in 2026 could not get the VPC deployment to work as smoothly as advertised. Self-hosting the open source gateway is free, but logs live in Portkey's console, where the free plan keeps them 3 days and Production 30 days.
Tip: start with the open source gateway in front of your app, then send logs to the hosted console only for the routes you need to audit.
- Routing to 1,600+ LLMs
- Guardrails and prompt versioning
- Logs and traces per request
- ✓Strong observability
- ✓Open source gateway core
- ✓Free plan to evaluate
- ✗Free plan not for production
- ✗Billed per recorded log
- ✗Roadmap now tied to Palo Alto Networks
The best pick when the question is "who sent what to which model?". $49 a month covers most small production apps.
Cloudflare AI Gateway
Cloudflare AI Gateway sits on Cloudflare's network in front of your provider calls. It takes one line of code: change the base URL. You get analytics, logging, caching, rate limiting, request retries and model fallback.
The core features are free on every plan. On accounts with the older log system, the Workers Free plan keeps 100,000 logs in total across all gateways, and Workers Paid keeps 10 million per gateway; accounts that created their first gateway later in 2026 store logs in Workers Logs, under its own pricing and retention. If you want one bill instead of your own provider keys, Unified Billing passes token prices through with no markup but adds a 5% fee on credits: $100 of credit costs $105.
The caching is the money saver. Identical prompts (an FAQ bot, a classification job) are served from Cloudflare's cache instead of the provider.
The limit: governance stays basic. For budgets per team and audit trails, pair it with Portkey or LiteLLM. A 2026 Hacker News thread on Cloudflare's AI platform also notes that zero data retention is not on by default and not supported by every provider.
Tip: turn caching on per route, not globally. Cache a support FAQ; never cache a prompt that carries user data.
- Free analytics, caching and rate limiting
- Retries and model fallback
- One line of code to start
- ✓Free core features
- ✓Runs on Cloudflare's edge
- ✓Keep your own provider keys
- ✗Basic governance
- ✗5% fee if you use Unified Billing
- ✗Log limits depend on your plan
The no-brainer first layer: free caching and logs in front of your existing keys. Add a governance tool once several teams share the budget.
TrueFoundry
TrueFoundry sells an AI gateway that you deploy in your own VPC, on-prem or air-gapped. It routes to 2,500+ models, adds rate limits, budgets, RBAC, guardrails and logs, and also manages MCP servers and agents.
The pricing page is clear. Developer is $0 for up to 3 users, with 10K requests and tool calls per user a month and 7-day log retention. Pro is $25 per user a month with 20K requests per user, pooled across the team, then $20 per extra 100K. Model-provider costs are pass-through: TrueFoundry does not mark up tokens. TrueFoundry's own estimator puts 7 users and 1 million requests at $355 a month.
A team that compared five gateways on Reddit in 2026 picked it for VPC deployment and fallback chains that work (the post reads partly like a pitch, so weigh it lightly).
The limit: it is a platform, not a library. For a solo developer, LiteLLM or OpenRouter is faster to start.
Tip: count requests and tool calls together, since each MCP tool call counts as one request. Agent loops burn the per-user quota faster than chat, and active users are counted at the month's peak, so remove departed users before the month starts.
- VPC, on-prem and air-gapped deployment
- Budgets, RBAC and guardrails
- MCP and agent gateway in the same product
- ✓Data stays in your cloud
- ✓Tokens passed through at cost
- ✓Clear per-user pricing
- ✗Per-user pricing adds up
- ✗Heavier than a library
- ✗Tool calls count against the quota
The pick when compliance decides. For a 7-person team, budget about $355 a month at 1 million requests.
Bifrost
Bifrost, from Maxim AI, is an open source gateway under the Apache 2.0 license. You start it with one npx command and get an OpenAI-compatible API, failover, load balancing, semantic caching, virtual keys with budgets, and an MCP gateway.
Its pitch is speed. In the vendor's own benchmark, Bifrost adds 11 microseconds of overhead per request at 5,000 requests per second on a t3.xlarge machine. That is a vendor number, not an independent one. It is still why teams look at Bifrost when a Python proxy starts to lag under load.
It costs nothing to self-host. Enterprise features come with a 14-day trial, then a conversation with sales.
The limit: it is younger than LiteLLM, with a smaller community, and the benchmarks that put it ahead of LiteLLM ("50x faster" at P99 latency) are published by Maxim AI itself.
Tip: Bifrost ships a LiteLLM compatibility mode, so you can move an existing LiteLLM setup without rewriting your client calls.
- 11 µs overhead in the vendor benchmark
- Semantic caching and failover
- LiteLLM compatibility
- ✓Free and open source
- ✓Low overhead under load
- ✓Quick start with npx
- ✗Smaller community
- ✗Speed claims come from the vendor
- ✗Enterprise features behind sales
A serious LiteLLM alternative if latency matters. Run your own load test before you trust any benchmark.
Kong AI Gateway
Kong AI Gateway is a set of AI plugins on top of Kong's API gateway: AI Proxy to reach several providers through one interface, AI Rate Limiting Advanced, AI Semantic Cache, AI Semantic Prompt Guard and AI Sanitizer. The control plane runs in Kong Konnect, serverless or hybrid.
Pricing is the weak spot for small teams. Konnect Plus starts at $25 a month plus usage, billed monthly, with a 30-day free trial. A serverless AI gateway control plane is $25 a month, and every unique LLM proxied by the AI plugins costs $100 a month. Five models means $500 a month in model fees, or $525 with the control plane, before traffic.
It shines where Kong already runs: the same team, same policies, same dashboards for APIs and LLMs. The same 2026 Reddit comparison found the learning curve steep and said it felt like AI features retrofitted onto an API gateway.
Tip: count your models before you sign. Route rarely used models through one generic proxy route rather than one per model.
- AI Proxy, Semantic Cache and Prompt Guard plugins
- AI Rate Limiting Advanced
- Same platform as your APIs
- ✓Mature API gateway underneath
- ✓Strong policy and security controls
- ✓Serverless or hybrid control plane
- ✗$100 a month per proxied model
- ✗Steep learning curve
- ✗Built for API teams more than AI teams
Logical for Kong shops; expensive and heavy for anyone else.
Where each gateway charges you
Almost every gateway says "no markup on tokens". The fee is still there; it just moves. Here is where to look, with the numbers from each pricing page.
A fee on credits
OpenRouter takes 5.5% when you buy credits on Standard and 8% on Business. Cloudflare's Unified Billing takes 5%. On $2,000 of monthly inference, that is $110 a month at OpenRouter's Standard rate. Bring your own keys and both disappear: Cloudflare keeps the core features free, and OpenRouter waives its fee up to $25,000 of list-price inference a month.
A fee on logs or seats
Portkey bills recorded logs: 100k for $49 a month, then $9 per 100k. TrueFoundry bills users: $25 each a month, so 7 users cost $175 before overage. An app with 1 million logged calls a month on Portkey Production pays $49 plus 9 × $9, or $130.
A fee per model
Kong charges $100 a month for every unique model the AI plugins proxy, on top of the $25 control plane. Five models: $525 a month before traffic. Count models, not requests, when you price Kong.
The cost of running it yourself
LiteLLM and Bifrost are $0 in licenses. You pay in servers, a database, upgrades and on-call time. For a team without a platform engineer, that work is the real bill.
- Where is the fee: credits, logs, seats or models?
- Can you bring your own provider keys, and is BYOK free?
- Do budgets block requests, or only alert?
- What happens to logs when you hit the free limit?
- Can it run in your VPC if legal asks?
- Who maintains it, and how fast are security fixes?
More AI gateways worth knowing
These come up in searches and threads. They are not ranked because they serve a narrower case or a ranked gateway already covers it better.
More gateways
Azure API Management: the AI gateway for Azure shops
EnterpriseMicrosoft's AI gateway is not a separate product: it extends Azure API Management on all tiers with a token limit policy, semantic caching with Redis, load balancing across endpoints and a circuit breaker. It fits teams whose models already sit in Microsoft Foundry or Azure OpenAI. Outside Azure, a dedicated gateway is simpler.
- Best for
- Azure and Foundry customers
- Watch out
- Features vary by tier
Helicone: observability first
ObservabilityHelicone is best known for LLM logging and cost tracking, with a free Hobby plan of 10,000 requests and Pro at $79 a month. Its routing is thinner than a dedicated gateway's, as a team comparing gateways on Reddit put it in 2026. Its site also says Helicone is no longer part of Mintlify, so watch for changes.
- Price
- Free, Pro $79/mo, Team $799/mo
- Best for
- Logs and cost tracking
Envoy AI Gateway: the Kubernetes route
Open sourceEnvoy AI Gateway is an open source project built on Envoy Gateway, with automatic failover, upstream authorization and token-based usage limits. It suits platform teams that already run Envoy on Kubernetes; it is not a quick start.
- Price
- Free (open source)
- Best for
- Kubernetes platform teams
The mistakes that cost you
What goes wrong once a gateway is in production, from the threads we read.
Pitfalls
Installing the gateway unpinned
In 2026, two LiteLLM releases on PyPI carried malware for about 40 minutes. Teams that ran an unpinned pip install litellm in that window had to rotate every credential on the machine. Pin versions, prefer the official Docker image, and treat your gateway like the vault it is: it holds every provider key you own.
Budgets that only alert
An agent loop can burn a month of tokens overnight. Use budgets that stop requests (LiteLLM's hard budgets, Vercel's or OpenRouter's credit balance), not only email alerts.
Trusting a free plan's logs in production
Portkey's free plan keeps logs for 3 days and stops recording past 10k a month; requests still go through, but your audit trail has holes. Cloudflare's Workers Free plan keeps 100,000 logs across all gateways on older accounts. Check the limit before an incident, not after.
Caching prompts with user data
Caching saves money on repeated prompts, but a cached answer can leak one user's data to another. Cache static prompts (FAQ, classification), and skip caching on anything personalized.
Building on several LLMs? Get our next automation guides
Where to go from here
Once the gateway is chosen, these pages cover the rest of the stack.
Price per million tokens and data terms.
You're connecting agents to toolsMCP serversWhich servers to install, and their cost in context.
You're building agents that act aloneAI agent platformsThe platforms to build and run them.
You're moving your hosting off VercelVercel alternativesWhere to host instead.
Get more out of your gateway
Settings that most setup guides skip.
Tips
Stack a free layer on a governance layer
Nothing stops you from putting Cloudflare AI Gateway's free caching in front of LiteLLM or Portkey. You get edge caching for free and keep budgets and keys in the governance tool.
Route your coding agents through it
Claude Code, Cursor and the other AI coding tools can point at a gateway, so their spend shows up per developer next to your app's. See our Claude review for the model side.
Put your automations behind the same key
Workflow tools call LLMs too. Point their OpenAI-compatible nodes at your gateway and their cost lands in the same dashboard; our n8n review and automation platforms ranking cover the tools.
AI gateway FAQ
What is an AI gateway?
An AI gateway is a proxy between your app and the model providers (OpenAI, Anthropic, Google, Mistral). Your code calls one endpoint; the gateway picks the provider, retries or falls back when one fails, enforces budgets and rate limits per key, and logs every prompt, token and dollar. It is the layer teams add once more than one app or more than one provider is in play.
What is the difference between an AI gateway and an API gateway?
An API gateway counts and secures HTTP requests. An AI gateway understands model traffic: it counts tokens, prices each call, reads prompts for guardrails, caches answers and switches providers. Some products do both: Microsoft adds AI gateway features to Azure API Management on all its tiers (each capability's availability varies by tier), and Kong sells AI plugins for its API gateway.
Is OpenRouter an AI gateway?
Yes, a hosted one. OpenRouter gives you one key and one balance for 600+ models and retries other providers automatically. It differs from LiteLLM or Portkey in who holds the bill: you buy OpenRouter credits and it pays the providers. Two details its pricing FAQ gives: failed attempts are not charged for their model tokens, and failed attempts do count toward the daily cap on free models.
Is there a free AI gateway?
Yes. LiteLLM and Bifrost are free open source gateways you host yourself. Cloudflare AI Gateway's core features (analytics, caching, rate limiting) are free on every plan. Vercel gives each team $5 of credit a month, and Portkey and TrueFoundry have free plans for evaluation.
Should I self-host my AI gateway?
Self-host if prompts must stay in your cloud or if your volume makes a percentage fee expensive: LiteLLM, Bifrost or TrueFoundry in your VPC. Use a hosted gateway (OpenRouter, Vercel, Cloudflare) if nobody on the team wants to run Postgres, Redis and upgrades. The 2026 LiteLLM PyPI incident is a reminder that self-hosting also means owning supply-chain hygiene: pin versions.
Does an AI gateway add latency?
Yes, a little. A well-built gateway adds milliseconds or less, which is small next to model response times measured in seconds. Bifrost's vendor benchmark is 11 microseconds at 5,000 requests per second; run your own load test before you trust any figure. Caching can make a gateway faster than calling the provider directly for repeated prompts.
Do AI gateways mark up token prices?
Mostly no, but many charge elsewhere. OpenRouter bills tokens at list price and takes 5.5% when you buy credits. Cloudflare's Unified Billing adds 5% on credits. Vercel and TrueFoundry say they pass tokens through with no markup. Portkey bills per recorded log, Kong per proxied model.
What is BYOK in an AI gateway?
BYOK (bring your own key) means the gateway uses your own OpenAI or Anthropic account: the provider bills you directly, and you keep your negotiated discounts and data terms. The catch is that BYOK spend can escape the gateway's budgets: Vercel's AI Gateway budgets exclude BYOK spend, and a BYOK request that fails is retried on Vercel's own credentials and charged to your credits. Set a spend limit at each provider as well.
