Cloudflare AI Gateway
Cloudflare AI Gateway is free, but you still pay the model provider, optional Unified Billing adds a 5 percent fee on purchased credits, and log limits depend on when the gateway was created.
Cloudflare AI Gateway is a proxy in front of AI model providers. It adds caching, rate limits, logs, and analytics to your requests. It is for developers who call one or more model APIs.
By CloudflareAIChecked ✓ 23 Nov 2026
Changed in Oct 2026: Clarified optional Unified Billing and export charges and cited the explicit free-account signup policy.
Is it a fit?
Good fit
Use when your app calls one or more model APIs and you want caching, rate limits, logs, and analytics for free.
- LLM apps
- cost control
- multi-provider apps
- teams starting with request analytics
Not a fit
Avoid if you need long log retention on the free plan or want Guardrails for free.
- long-term log storage on the free plan
- Guardrails at no cost (billed as Workers AI inference)
You send your model requests to an AI Gateway endpoint instead of the provider, using a REST call or your Workers code. It suits teams that call several model providers and want caching, limits, and logs in one place.
What the free plan gives you
AI Gateway is available on all plans. The pricing page says the core features are free: dashboard analytics, caching, and rate limiting. All you need is a Cloudflare account. The Free plan allows 10 gateways per account. Data Loss Prevention scanning is free too, with two predefined profiles: Financial Information and national identifier numbers.
Logs depend on when you made your first gateway. New customers whose first gateway is dated on or after September 24, 2026 follow Workers Logs rules. On Workers Free that means 200,000 log events per day with 3 days of retention. Older customers use Legacy Logs, which store 100,000 logs in total across all gateways on Workers Free.
You still pay each model provider for the calls.
When you hit a limit
The pricing page does not describe a hard stop for the core features. Unified Billing adds a 5% fee to purchased credits, and optional Logpush exports are billed separately. For logs, the rules differ by customer type. With Legacy Logs, once you reach the storage limit, the service can stop saving logs or delete the oldest ones, if you turn on automatic deletion.
Guardrails is not part of the free core: it is billed as Workers AI token-based inference. The Unified Billing rate limit is 200 requests per 60 seconds per gateway, and a 429 error comes back above it. That limit does not apply when you bring your own provider keys.
Gotchas
- The pricing page says prices are subject to change, so check it again before you rely on a free feature.
- Workers Logs will move to Cloudflare Observability pricing starting December 1, 2026.
- Logs are on by default for each gateway. You can turn them off in settings or per request with a header.
Alternatives in this atlas
- Portkey: when you want a different gateway with its own logging and controls.
- OpenRouter: when you want one API key that reaches many model providers.
- Cloudflare Workers AI: when you also want Cloudflare to run the models.
Questions people ask
Is Cloudflare AI Gateway free?
Yes. The core features, dashboard analytics, caching, and rate limiting, are free on all plans. You still pay your model provider.
How many logs does Cloudflare AI Gateway store for free?
New customers follow Workers Logs, with 200,000 log events per day and 3 days of retention on Workers Free. Older customers store 100,000 logs in total.
Does Cloudflare AI Gateway need a credit card?
Cloudflare advertises free account signup without a card. AI Gateway’s core features are free, while model inference, Unified Billing credit purchases, and optional exports have separate charges.
How to get started
- Sign up for a free Cloudflare account.
- Find your account ID in the Cloudflare dashboard.
- Create an API token with AI Gateway Read, AI Gateway Edit, and Workers AI Read permissions.
- Send a request to the AI Gateway endpoint with curl. For Workers AI models add the cf-aig-gateway-id header. The default gateway is created on your first authenticated request.
- Or go to AI, then AI Gateway, in the dashboard, select Create Gateway, and name it.
- Open the gateway dashboard to see analytics and logs.
Other free ai options
Same category, safest first.