# Cloudflare AI Gateway

> Free caching, rate limits, spend caps and model fallback in front of OpenRouter. Works even from Lambda.

- Verdict: Watching (Proposed: research-backed, not yet confirmed by Nic)
- Vendor: Cloudflare
- Layer: [AI](https://cloudlesslabs.com/stack/layers/ai.md). Job: LLM traffic control
- Last reviewed: 18 October 2026, by Nicolas Dao (Cloudless Labs, Sydney)
- Web page: https://cloudlesslabs.com/stack/cloudflare-ai-gateway/. The whole stack in one file: https://cloudlesslabs.com/stack/brief.md

A base-URL change in front of OpenRouter buys caching, budgets and fallback. On my shortlist.

## Use it when

- Per-client spend caps and logs for AI features, and automatic fallback when a provider is down.

## Pricing

Core features free. Logs: 20M events a month included on Workers Paid, then $0.60 per million (pricing changes 1 December 2026).

## Provisioning

Official Pulumi package · Official Terraform provider

## Worked examples

- [The LLM streaming proxy](https://cloudlesslabs.com/stack/guides/llm-proxy/index.md): How do I add an AI chat feature without leaking my API key or paying for the model's thinking time?

## Where it fits

- [An AI chat or LLM feature](https://cloudlesslabs.com/stack/use-cases/ai-chat.md): pick 4. Caching, spend caps and fallback, on my shortlist.

## Sources

- [AI Gateway](https://developers.cloudflare.com/ai-gateway/)

## Related

- [AI](https://cloudlesslabs.com/stack/layers/ai.md): every tool in this layer, with its verdict
- [The whole stack in one file](https://cloudlesslabs.com/stack/brief.md): every use case and tool, for questions that span many
- [Map of every Markdown file on cloudlesslabs.com, with what each one answers](https://ask.cloudlesslabs.com)
