# Cloudflare AI Gateway alternatives: when to stay, when to add

URL: https://infro.io/blog/cloudflare-ai-gateway-alternatives-2026
Author: INFRO Editorial (https://infro.io/blog/editorial)
Publisher: INFRO
Published: 2026-10-20
Last modified: 2026-10-20
Last reviewed: 2026-10-20 (next review due 2026-11-19)
Topic: Architecture and migration
Format: Comparison

> Cloudflare AI Gateway's core features — analytics, logging, caching, rate limiting and retries with model fallback — are free on a Cloudflare account, and its spend limits cover BYOK traffic for priced models. Teams look for alternatives when they need negotiated rates stored centrally rather than sent in a per-request cf-aig-custom-cost header, routing logic for requests other than OpenAI chat completions (dynamic routes accept that shape only), an organization model of projects, roles and audit, or cost checked against the provider's bill. Alternatives: Vercel AI Gateway, self-hosted LiteLLM or Kong, OpenRouter, and BYOK control planes such as INFRO.

Key takeaways:
- Start with Cloudflare AI Gateway if you are on Cloudflare: core features are free and its spend limits count BYOK traffic for priced models.
- Negotiated rates travel in a per-request cf-aig-custom-cost header, so every caller carries a copy of your commercial terms.
- Dynamic routes accept the OpenAI chat completions shape only; other formats return 400.
- Cloudflare describes cost tracking as a best-effort estimate and notes concurrent bursts can briefly pass a limit.
- Teams add an alternative for central rates, an organization model, routing beyond chat, or reconciliation with the provider's bill.

**Should you use Cloudflare AI Gateway or an alternative?** If your traffic already runs through Cloudflare, start with AI Gateway: analytics, logging, caching, rate limiting and retries with model fallback are its core features[1], and they are free with a Cloudflare account[2]. Its spend limits count your own-key traffic for models with known pricing[3]. Teams look elsewhere when they need negotiated rates held centrally, routing logic for requests other than OpenAI-shaped chat, an organization model of projects, roles and audit, or cost checked against the provider's bill.

This guide sets out where Cloudflare's own documentation draws those lines, and which alternative fits each reason.

## What Cloudflare AI Gateway does well

- **Free core.** Analytics, caching and rate limiting at no charge; guardrails are billed as Workers AI inference and Unified Billing carries a 5% fee on purchases[2].
- **Spend limits in dollars.** Budgets scoped by provider, model or a metadata key, applied to Unified Billing and BYOK requests for priced models, returning 429 at the cap or moving traffic to a fallback model through a dynamic route; up to 20 rules per gateway[3].
- **Visual routing with rollback.** Dynamic routes compose conditions, percentage splits, rate and budget limits and model nodes, with drafts and "instant rollback"[4].
- **Your own rates.** A `cf-aig-custom-cost` header carries input, output, cache-read and cache-write rates per request, so estimates reflect negotiated pricing[5].

For a single team on Cloudflare, that is a complete answer. Stay.

## The lines teams reach later

### Negotiated rates travel with every request

Custom costs are set per request in a header[5]. That works, and it means every service that calls a model must know your commercial terms, and a renegotiated rate is a deploy across all of them. Teams with several services and contracts often want rates stored once, per model and per provider account, and applied to every matching request. [Negotiated rates vs list price](https://infro.io/blog/negotiated-rates-list-price-drift) explains why estimates drift when they are not.

### Routing logic is chat-only

Cloudflare states that "dynamic routes accept the OpenAI chat completions request shape only", and that other formats, such as Anthropic Messages, return 400[4]. If your routing problem includes image, video or audio requests, or clients that speak Anthropic's API such as Claude Code, the visual routing does not cover them.

### Estimates, not invoices

Cloudflare is straightforward that "cost tracking is a best-effort estimation based on token counts and model pricing", and that because enforcement trails real-time usage, a burst of concurrent requests can briefly exceed a limit[3]. Every gateway's per-request cost is an estimate; the question is whether anything checks it against the provider's own cost data, and whether limits hold under concurrent load. [Reconciling LLM spend with provider invoices](https://infro.io/blog/reconcile-llm-spend-provider-invoices) covers the first; [the 500-request concurrency test](https://infro.io/blog/ai-spend-cap-concurrency-test) the second.

### One gateway, or an organization

AI Gateway's unit is the gateway, with access governed by Cloudflare account roles and identity carried in request metadata. Once several teams share AI spend, the questions become which team may call which model, who approved a budget change, and what each project spent — an object model of projects, keys, roles, allowlists and an audit log.

## Alternatives by reason

| Reason to look | Alternatives to consider |
| --- | --- |
| You deploy on Vercel and use the AI SDK | Vercel AI Gateway |
| You must self-host | LiteLLM, Kong AI Gateway, Bifrost |
| You want one balance for every model, no provider accounts | OpenRouter, Vercel AI Gateway |
| Central negotiated rates, an organization model, reconciliation | A BYOK control plane such as INFRO |
| Routing for media and Anthropic-shaped clients | Kong AI Gateway, a BYOK control plane |

**Vercel AI Gateway.** Built into Vercel and the AI SDK. Note its BYOK behaviour: failed requests on your credentials are retried on Vercel's system credentials, and BYOK spend is not counted in budgets[6].

**LiteLLM.** The default self-hosted gateway: more than 100 providers, virtual keys with budgets, spend tracking by key, team, user and tag, fallbacks and logging integrations, run against Postgres[7].

**Kong AI Gateway.** For teams already on Kong: one API across major providers, failover, a semantic cache, model cost management with spend limits, guardrails and MCP tooling, with self-hosted or cloud data planes[8].

**INFRO.** A hosted BYOK control plane on provider accounts you connect, with 0% markup on model spend. Negotiated rates are stored per model and optionally per provider kind from the Team plan and apply to every matching request; routes with priority or weighted targets apply to chat, image, video and audio requests, and INFRO also answers Anthropic's Messages and OpenAI's Responses APIs for coding agents; projects, environments, five roles, allowlists, budgets and an audit log are part of the organization model; and on the Business plan the month's estimate is compared with OpenAI's and Anthropic's own cost APIs. It costs a subscription where Cloudflare's core is free, and its response cache covers chat completions only.

## Using both

Cloudflare and a control plane are not exclusive. A common pattern keeps Cloudflare at the edge for what it does best — caching, the network, Workers AI — and puts budgets, attribution and audit across every provider account in a control plane behind it. Decide which layer owns retries and spend limits so they are not applied twice.

## Summary

Cloudflare AI Gateway is the right first gateway for teams on Cloudflare, and free. Add or move when you need rates held centrally rather than per request, routing beyond OpenAI-shaped chat, an organization model with audit, or estimates checked against the provider's bill — and pick the alternative by which of those you need.

## Questions

### Is Cloudflare AI Gateway free?

Its core features are free with a Cloudflare account: dashboard analytics, caching and rate limiting. Guardrails are billed as Workers AI inference, Logpush is billed by volume, and Unified Billing carries a 5% fee. Log storage has limits by plan.

### Does Cloudflare AI Gateway support spend limits on my own API keys?

Yes, for models with known pricing. Cloudflare's spend limits page says they apply to both Unified Billing requests and BYOK requests for models with known pricing, returning 429 at the cap or routing to a fallback model.

### What are the limitations of Cloudflare AI Gateway?

From its documentation: dynamic routes accept only the OpenAI chat completions request shape; negotiated rates are sent per request in a cf-aig-custom-cost header; cost tracking is a best-effort estimate; and a burst of concurrent requests can briefly exceed a spend limit.

## Sources

1. AI Gateway overview — Cloudflare. https://developers.cloudflare.com/ai-gateway/ (accessed 2026-10-20)
2. AI Gateway pricing — Cloudflare. https://developers.cloudflare.com/ai-gateway/reference/pricing/ (accessed 2026-10-20)
3. Spend limits — Cloudflare. https://developers.cloudflare.com/ai-gateway/features/spend-limits/ (accessed 2026-10-20)
4. Dynamic routing — Cloudflare. https://developers.cloudflare.com/ai-gateway/features/dynamic-routing/ (accessed 2026-10-20)
5. Custom costs — Cloudflare. https://developers.cloudflare.com/ai-gateway/configuration/custom-costs/ (accessed 2026-10-20)
6. Bring Your Own Key (BYOK) to AI Gateway — Vercel. https://vercel.com/docs/ai-gateway/authentication-and-byok/byok (accessed 2026-10-20)
7. LiteLLM AI Gateway (proxy server) — LiteLLM. https://docs.litellm.ai/docs/simple_proxy (accessed 2026-10-20)
8. Kong AI Gateway — Kong. https://developer.konghq.com/ai-gateway/ (accessed 2026-10-20)
