Tool profile
Cloudflare AI Gateway: cost, fit and limits
Cloudflare AI Gateway is a managed LLM gateway from Cloudflare that proxies requests to model providers and adds analytics, logging, caching, rate limiting, retries, fallbacks and guardrails. It sits inside the Cloudflare dashboard and is listed as available on all plans.
What to know first
Cloudflare AI Gateway is the one to look at first if your traffic already crosses Cloudflare. Core features cost nothing, per the pricing page. You get analytics on request volume, tokens and cost, a cache that can answer repeat requests without calling the provider, and rate limits. Guardrails and billing add charges, and log storage rules changed for gateways created after September 24, 2026.
Cloudflare AI Gateway at a glance
| Maker | Cloudflare, United States |
|---|---|
| Free plan | Yes |
| Entry price | $0 for core features |
| API access | Yes |
| Category | Best LLM Gateway Software in 2026, rank 5 of 11 |
| Website | developers.cloudflare.com/ai-gateway/ |
Who Cloudflare AI Gateway is best for
Existing Cloudflare customers
Gateway settings live beside Workers and DNS, so no new vendor, contract or login is needed to start caching and capping requests.
Apps with many repeated prompts
Serving a repeat request from Cloudflare's cache skips the model provider, which can cut both latency and token spend for FAQ-style traffic.
Teams adding safety checks cheaply
Guardrails run Llama Guard 3 and Prompt Guard 2 with a flag, block or ignore choice per category, and DLP is free on all plans.
Cloudflare AI Gateway plans and pricing
| Plan | Price | What it includes |
|---|---|---|
| Core features | $0, on all plans | Dashboard analytics, caching and rate limiting. The pricing page says the core features available today are offered for free. |
| Logs on Workers Free (legacy gateways) | Included | Persistent logs up to 100,000 across all gateways. Applies to gateways created before September 24, 2026. |
| Logs on Workers Paid (legacy gateways) | Included with the plan | Up to 10,000,000 logs per gateway. Newer gateways bill under Workers Logs pricing, with figures on a linked page. |
| Unified Billing | 5% on credit purchases | One bill for provider inference passed through at provider rates. A $100 credit costs $105, and only credit cards are accepted. |
Checked November 2026.
What Cloudflare AI Gateway does
- Caching and rate limiting
- Responses can be served from Cloudflare's cache instead of the provider, and a rate limit caps how many requests the app receives. Both are in the free core feature set.
- Guardrails
- One policy per gateway checks prompts and eligible responses. Blocked prompts never reach the provider and return error code 2016, blocked responses return 2017. Streamed responses are buffered for evaluation.
- Routing with fallbacks
- Model aliases choose models and fallbacks, and dynamic routes handle conditional flows. Retries and model fallback are listed, though the overview gives little detail on how they trigger.
- Data loss prevention
- DLP is free on all plans. Without Zero Trust you get two predefined profiles, and with Zero Trust DLP the full set applies, with matches recorded in the log entry.
- Logpush
- Logs can be shipped to external storage and are billed under Logpush pricing by volume, which helps teams that keep long-term records outside Cloudflare. That suits audit needs.
How Cloudflare AI Gateway handles your data
Cloudflare's logging documentation says logs are enabled by default for each gateway, and each entry can contain the prompt, response, provider, timestamp, status, token usage, cost and duration. You can disable logging gateway-wide in settings, skip an entry with the cf-aig-collect-log header set to false, or keep metadata but drop bodies with cf-aig-collect-log-payload set to false. Requests paid through Unified Billing are always logged without request and response bodies. The page gives no retention period for new gateways, so check the linked Workers Logs terms. Training use and subprocessors weren't checked for this page.
Where Cloudflare AI Gateway falls short in practice
- Governance is shallow. The pages read describe no virtual keys, team budgets or per-user quotas inside the gateway. Request-level controls are strong, but allocating spend between teams has to happen somewhere else.
- Log rules differ by gateway age. Gateways made before September 24, 2026 use legacy logs with fixed caps, while newer ones bill under Workers Logs. A team with both kinds will track two sets of rules.
- Guardrail cost is open-ended. Guardrails bill as Workers AI inference, so cost rises with prompt and response length, and no per-token rate is printed on the page read. Budget this before enabling it widely.
Works with
Alternatives to Cloudflare AI Gateway
Cloudflare AI Gateway: common questions
Is Cloudflare AI Gateway free?
Core features are free on all plans, according to the pricing page: dashboard analytics, caching and rate limiting. Guardrails bill as Workers AI inference, Unified Billing adds a 5% fee on credit purchases, and log storage and Logpush follow their own pricing as of November 2026.
Does Cloudflare store my prompts?
By default, yes. Logs are enabled for each gateway and can include prompts and responses. You can turn logging off for a gateway, skip single entries with a header, or keep metadata while dropping payloads. Unified Billing requests are always logged but without bodies.
What models do the guardrails use?
Llama Guard 3 (8B) checks content hazards in categories S1 to S14, and Prompt Guard 2 checks prompts for injection. For each category you choose flag, block or ignore. One policy applies per gateway, and streamed responses are buffered before evaluation.
How many logs can I keep?
For gateways created before September 24, 2026, Workers Free allows 100,000 logs in total across gateways and Workers Paid allows 10,000,000 per gateway. Newer gateways use Workers Logs, whose figures sit on a separate pricing page that wasn't read for this page.
Which providers can I proxy?
The overview names Workers AI, Anthropic, Google Gemini, OpenAI and Replicate, along with others. The guardrails page also mentions DeepSeek. Check the provider list for the specific model endpoints you need before building, since the overview page isn't exhaustive and may lag.