AI Gateway vs Cloudflare AI Gateway: edge proxy or your own gateway?
Cloudflare AI Gateway runs on Cloudflare's edge with free analytics and caching. AI Gateway by LayerX runs on your servers, GPUs first.
The short answer
Cloudflare AI Gateway is a hosted proxy on Cloudflare's network, with free analytics, logging, caching, rate limiting and fallbacks in front of your model providers. AI Gateway by LayerX runs on your own servers, or LayerX hosts it, and is built to share your own GPU servers and vendor APIs across many people. If you're on Cloudflare and want visibility and caching for free, pick Cloudflare. If you serve your own models and need per-person budgets, look at AI Gateway.
Choose AI Gateway if
Recommended- Your own GPUs should take traffic first, with vendors as backup.
- Requests your GPUs serve should never leave your network.
- Each person needs their own access: invited by email, own keys, token budgets and allowed models.
- Prompts must never be stored, not even in logs.
Choose Cloudflare AI Gateway if
- You're on Cloudflare and want a free starting point.
- Caching saves you money on repeated prompts.
- You want guardrails or DLP without running anything.
- You don't serve your own models.
At a glance
| AI Gateway | Cloudflare AI Gateway | |
|---|---|---|
| Where it runs | Your servers, or managed by LayerX | Cloudflare's network |
| Cost | Commercial licence | Core features free; 5% on Unified Billing credits |
| Providers | Your vLLM and Ollama servers plus OpenAI-compatible vendors | Workers AI, OpenAI, Anthropic, Gemini, Replicate and more |
| Caching | None | Response caching at the edge |
| Limits | Daily and monthly token budgets per person; RPM per key | Rate limiting per gateway |
| Guardrails | None | Llama Guard on Workers AI; DLP scanning |
| Logs | Usage data only; prompts never stored | Request logs (storage rules depend on account age) |
| Your own GPUs | Used first, with health checks, concurrency limits, prefix-cache affinity | Not its purpose |
Caching vs serving
Both reduce what you pay vendors, in different ways. Cloudflare caches responses at the edge, so an identical prompt sent twice is answered once. That works best for repeated, predictable requests. AI Gateway sends requests to your own GPU servers first, so any request your hardware can serve costs no vendor tokens, repeated or not. Teams with a lot of varied internal traffic and their own GPUs get more from the second. Public apps with repeated prompts get more from the first. Note too that Cloudflare's rate limiting is set per gateway, applying the same limit to all requests through it (Cloudflare docs), while AI Gateway sets limits per key and budgets per person.
Questions
Can I self-host Cloudflare AI Gateway?
No. It runs on Cloudflare's network. AI Gateway by LayerX runs on your servers, or LayerX hosts it.
Is Cloudflare AI Gateway free?
Its core features are free on all plans. Log storage, guardrail inference and Unified Billing credits can cost money.
Which one is better for privacy?
AI Gateway, for traffic your own GPUs serve, because it never leaves your network and prompts are never stored. With Cloudflare, requests pass through Cloudflare first and can be logged by the gateway.
Can I use both?
Yes, for different jobs: Cloudflare in front of hosted providers for caching and analytics, AI Gateway in front of your own GPUs for internal users.
Sources
We make AI Gateway, so weigh this page accordingly. Every statement about Cloudflare AI Gateway comes from the pages below, checked on 3 December 2026. They can change after that date.