Comparison

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 GatewayCloudflare AI Gateway
Where it runsYour servers, or managed by LayerXCloudflare's network
CostCommercial licenceCore features free; 5% on Unified Billing credits
ProvidersYour vLLM and Ollama servers plus OpenAI-compatible vendorsWorkers AI, OpenAI, Anthropic, Gemini, Replicate and more
CachingNoneResponse caching at the edge
LimitsDaily and monthly token budgets per person; RPM per keyRate limiting per gateway
GuardrailsNoneLlama Guard on Workers AI; DLP scanning
LogsUsage data only; prompts never storedRequest logs (storage rules depend on account age)
Your own GPUsUsed first, with health checks, concurrency limits, prefix-cache affinityNot 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.

More comparisons

Other gateways, side by side.

See how AI Gateway fits your setup.

Tell us what you run today and how many people need access. We'll get back to you to learn more about your setup.

See how AI Gateway fits your setup.

What do you run today?