Cloudflare AI Gateway

Cloudflare-hosted AI gateway for caching, rate limiting, logging and provider fallback close to the edge.

Visit Cloudflare AI Gateway Opens the vendor's site in a new tab

Cloudflare AI Gateway is a managed proxy for model API traffic. It sits in front of providers such as OpenAI, Anthropic, Google and Workers AI, then adds caching, rate limiting, retries and analytics without requiring a new model SDK.

Because it runs on Cloudflare's network, teams already using Workers, R2 or Cloudflare security products can keep AI traffic in the same account and observe it beside the rest of their edge traffic.

The gateway supports provider-specific endpoints and an OpenAI-compatible route, request logging, cost estimates and fallback to another provider when the primary call fails.

Pricing follows Cloudflare's usage model: the gateway itself has a free allowance and paid usage for higher volume, while model inference remains billed by the provider. Check the current limits before routing production traffic.

The main constraints are provider coverage and platform coupling. It is an access and control layer, not a model marketplace, and advanced behaviour is limited to what the gateway exposes rather than arbitrary application logic.

Our take

Cloudflare AI Gateway is the lowest-friction option for a team already living in Cloudflare. Caching, rate limits and request logs are close to the rest of the edge configuration, and secrets do not need to be copied into every Worker. For simple production controls, that is a useful amount of capability without another specialist vendor.

It is not a full routing platform. Provider coverage and custom logic are narrower than Portkey or LiteLLM, and caching can go wrong when keys are too broad. Treat it as an edge control layer for straightforward traffic, not as a replacement for a model gateway with complex policy.

What it does

  • Managed proxy for major model APIs and Workers AI.
  • Caching for repeated requests.
  • Rate limiting and request budgets.
  • Logs, analytics and cost estimates.
  • Provider fallback and retries.
  • Secrets management for upstream keys.
  • Works with Cloudflare Workers and AI SDKs.
  • Edge deployment close to existing Cloudflare services.

Best for

  • Apps already running on Cloudflare Workers.
  • Teams that need caching and rate limits without a new vendor.
  • Projects that want model logs beside edge traffic.
  • Workloads with repeated prompts that benefit from caching.
  • Teams testing fallback between two providers.

Not ideal for

  • Multi-cloud teams that do not want another platform dependency.
  • Workloads needing custom routing logic beyond the gateway.
  • Buyers who need a model owner or GPU capacity.
  • Apps where every request must reach a pinned provider with no proxy.

Pros

  • Tight integration with Cloudflare's edge stack.
  • Caching and rate limiting are straightforward to enable.
  • Secrets can stay out of application code.
  • Useful logs and cost estimates.
  • Free allowance supports evaluation.
  • No separate model SDK required.

Cons

  • Provider coverage is narrower than specialist gateways.
  • Adds Cloudflare as a dependency in the AI path.
  • Complex routing is limited.
  • Caching needs careful key design.
  • Higher volume moves to paid usage.

Pricing and facts

Pricing modelFreemium · from Free allowance / usage-based
Free tierFree allowance for gateway requests; confirm current limits.
Pricing detail
  • Gateway has a free request allowance.
  • Higher volume is billed by usage.
  • Model inference is billed separately by the provider.
  • Caching can reduce repeated provider calls.
  • Enterprise terms follow Cloudflare contracts.
PlatformsCloudflare dashboard, REST API, Workers integration
DeveloperCloudflare
Launched2024
Websitehttps://developers.cloudflare.com/ai-gateway/?utm_source=aibookmarks.net
Last reviewed2026-11-27

Example prompt

Put a Cloudflare AI Gateway in front of the support bot, cache repeated FAQ prompts for five minutes, cap each user at 20 requests per minute and log cost by route.

Alternatives to Cloudflare AI Gateway

Questions about Cloudflare AI Gateway

What is Cloudflare AI Gateway?

Cloudflare AI Gateway is a managed proxy for model API traffic. It sits in front of providers such as OpenAI, Anthropic, Google and Workers AI, then adds caching, rate limiting, retries and analytics without requiring a new model SDK.

Because it runs on Cloudflare's network, teams already using Workers, R2 or Cloudflare security products can keep AI traffic in the same account and observe it beside the rest of their edge traffic.

The gateway supports provider-specific endpoints and an OpenAI-compatible route, request logging, cost estimates and fallback to another provider when the primary call fails.

Pricing follows Cloudflare's usage model: the gateway itself has a free allowance and paid usage for higher volume, while model inference remains billed by the provider. Check the current limits before routing production traffic.

The main constraints are provider coverage and platform coupling. It is an access and control layer, not a model marketplace, and advanced behaviour is limited to what the gateway exposes rather than arbitrary application logic.

Is Cloudflare AI Gateway free?

Cloudflare AI Gateway is freemium. Free allowance for gateway requests; confirm current limits.

What is Cloudflare AI Gateway best for?

Apps already running on Cloudflare Workers.; Teams that need caching and rate limits without a new vendor.; Projects that want model logs beside edge traffic.; Workloads with repeated prompts that benefit from caching.; Teams testing fallback between two providers.

Listed in Model Gateways & Aggregators. Something out of date? Tell us.