Cloudflare AI Gateway

"Connect to any model, dynamically route requests, and manage usage, billing, and logs from one unified gateway." [1]

developers.cloudflare.com/ai-gateway/ · By Cloudflare · Agent JSON · Suggest an edit · Last verified 2026-06-21 · Source confidence: high

Cloudflare AI Gateway is a unified proxy layer for teams routing requests across multiple LLM providers, offering automatic fallback, response caching, rate limiting, spend controls, and centralized observability from a single endpoint. Core features including analytics, caching, and rate limiting are free on all plans with 100,000 logs per account; paid plans expand log capacity and gateway count, and an enterprise tier adds HIPAA coverage and Logpush. The gateway is OpenAI and Anthropic API-compatible, supports bring-your-own-key management, and holds SOC 2 Type II, ISO 27001, PCI DSS, and GDPR certifications. A 5% fee applies to credits purchased through Unified Billing, while provider inference pricing passes through without markup.

Best for / Avoid if

Best for: Prototypes and side projects - free to start, no sales call; Regulated or enterprise workloads - compliance attestations and an enterprise plan; AI agents and automation - an agent-ready surface (MCP / llms.txt)

Pricing & procurement

Pricing model
Hybrid (base + usage) [2]
Published pricing
Yes
Free tier
Yes [3]
Free tier details
Core features (dashboard analytics, caching, rate limiting) are free on all Cloudflare plans. Workers Free plan includes 100,000 logs per account across all gateways. DLP scanning is free on all plans (2 predefined profiles without Zero Trust subscription). [4]
Self-serve signup
Yes
Requires sales call
No
Enterprise plan
Yes [5]
Published prices
PlanItemPerAmountSource
Workers FreeGateway core features (analytics, caching, rate limiting)month$0source
Workers FreePersistent log storage100,000 logs total across all gateways$0source
Workers PaidPersistent log storage10,000,000 logs per gateway$0source
Workers PaidLogpush base allowance10,000,000 requests/month$0source
Workers PaidLogpush overage1,000,000 requests$0.05source
Unified Billing credit purchase fee% of credits purchased5%source

Capabilities

  • Fallback / routing
  • Spend controls
  • Observability
  • Guardrails
Supported actions
unified_chat_completions, openai_compatible_api, anthropic_compatible_api, model_routing, automatic_fallback, dynamic_routing, rate_limiting, exact_match_caching, prompt_caching, spend_limits, budgets, observability_logging, analytics, cost_tracking, guardrails, pii_redaction, dlp_scanning, byo_provider_keys, custom_costs, custom_metadata, opentelemetry_tracing, workers_logpush, websocket_support, evaluations, audit_logs, graphql_analytics_api [6]
Input types
chat completions, text completions, image generation, text-to-speech, automatic speech recognition, embeddings, agentic workflows (responses API)
Output types
streaming (SSE), JSON, OpenAI-compatible response, Anthropic-compatible response
Webhooks
No [7]
Sandbox / test mode
No
SDK languages
JavaScript/TypeScript, JavaScript/TypeScript (OpenAI SDK drop-in) [8]
MCP server
Yes [9]

Trust & compliance

SOC 2
SOC 2 Type II [10]
HIPAA
Yes [11]
GDPR
Yes [12]
ISO 27001
Yes [13]
PCI DSS
Yes [14]
Published SLA
Yes [15]
Rate limits
Free plan: 100,000 logs per account; Paid plan: 10,000,000 logs per gateway; log storage rate: 500 logs per second per gateway; individual log size: 10 MB; Unified Billing request rate: 200 requests per 60 seconds per gateway; cacheable request size: 25 MB per request; cache TTL max: 1 month; free plan: 10 gateways per account; paid plan: 20 gateways per account [16]
Known restrictions
AI Gateway is not compatible with Cloudflare Regional Services or Geo Key Manager (no data residency controls), HIPAA BAA only available for Enterprise customers, Logpush only available on Workers Paid plan, Guardrails pricing scales with token usage via Workers AI inference, Unified Billing applies a 5% fee to all credits purchased (inference pricing from providers is passed through with no markup), Free plan DLP limited to 2 predefined profiles (full suite requires Zero Trust subscription), Cache applies exact-match only; semantic caching not yet available (planned for future release), AI Gateway token permissions cannot be restricted to a single gateway - tokens grant access to all gateways in an account [17]

Developer surface

Docs rendering: static · llms.txt present

Integration

API style
rest
Base URL
https://api.cloudflare.com/client/v4/accounts/{account_id}/ai
Version
v1
Versioning
url
Stability
ga
Auth methods
api_key
Error format
vendor-specific
Rate limit
200 / minute

SDKs

  • JavaScript/TypeScript ai-gateway-provider · repo
  • JavaScript/TypeScript (OpenAI SDK drop-in) openai · repo

Adoption & maturity

Launched
2023-09-27
GA
2024-05-22
Notable customers
RightBlogger

Other AI Gateway & LLM Routing APIs

  • Vercel AI Gateway

    "AI Gateway provides a unified API to access hundreds of AI models through a single endpoint, with built-in budgets, usage monitoring, and fallbacks."

    Usage · free tier · public pricing · self-serve

  • Portkey

    "Production Stack for Gen AI Builders"

    Hybrid · free tier · public pricing · self-serve

  • Bifrost (Maxim AI)

    "The fastest, most resilient, enterprise-grade LLM, MCP, and agent gateway."

    Sales-led · free tier · public pricing · self-serve

  • TrueFoundry AI Gateway

    "A unified AI gateway to securely manage and govern AI across 1600+ models with policy control, real-time monitoring, and up to 30% cost reduction."

    Hybrid · free tier · public pricing · self-serve

  • Helicone

    "Open-source LLM observability and monitoring platform for developers" - routes, debugs, and analyzes AI applications with access to 100+ models through one API with built-in observability, automatic fallbacks, and zero markup pricing.

    Hybrid · free tier · public pricing · self-serve

  • OpenRouter

    "The Unified Interface For LLMs" - OpenRouter scouts for the best prices, the lowest latencies, and the highest throughput across dozens of providers, offering a single OpenAI-compatible API with automatic fallback, model routing, and unified billing.

    Usage · free tier · public pricing · self-serve

Cloudflare AI Gateway alternatives · Cloudflare AI Gateway vs Vercel AI Gateway · All AI Gateway & LLM Routing APIs APIs

References

Change history

Every field change, who made it, and when - from our audited data pipeline and editors.

  1. 2026-06-21 Capabilities: {}{"guardrails":true,"observability":true,"spend_controls":true,"fallback_routing…
  2. 2026-06-21 Summary Md: (none)Cloudflare AI Gateway is a unified proxy layer for teams routing requests acros…
  3. 2026-06-21 Score Pricing Transparency: (none)75
  4. 2026-06-21 Score Setup Speed: (none)80
  5. 2026-06-21 Score Docs Quality: (none)55
  6. 2026-06-21 Score Procurement Friction: (none)90
  7. 2026-06-21 Score Trust Readiness: (none)100
  8. 2026-06-21 Best For: (none)Prototypes and side projects - free to start, no sales call, Regulated or enter…
  9. 2026-06-21 Scoring Methodology: (none)Scores are computed deterministically from this profile's published, sourced fi…
  10. 2026-06-21 Score Agent Friendliness: (none)65
  11. 2026-06-21 Llms Txt Present: (none)Yes
  12. 2026-06-21 Rendering: (none)static
  13. 2026-06-21 Has Structured Data: (none)Yes
  14. 2026-06-21 Robots Allows Agents: (none)Yes
  15. 2026-06-21 API Reference URL: (none)https://developers.cloudflare.com/fundamentals/api/reference/sdks/
  16. 2026-06-21 Changelog URL: (none)https://developers.cloudflare.com/changelog
  17. 2026-06-21 Docs URL: (none)https://developers.cloudflare.com/api/
  18. 2026-06-21 Llms Txt URL: (none)https://developers.cloudflare.com/llms.txt
  19. 2026-06-21 Free Tier Available: set to Yes
  20. 2026-06-21 Versioning Scheme: set to url
  21. 2026-06-21 Free Tier Details: set to Core features (dashboard analytics, caching, rate limiting) are free on all Clo…
  22. 2026-06-21 Self Serve Signup: set to Yes
  23. 2026-06-21 Requires Sales Call: set to No
  24. 2026-06-21 Enterprise Plan Available: set to Yes
  25. 2026-06-21 SOC 2: set to type_2
  26. 2026-06-21 HIPAA: set to Yes
  27. 2026-06-21 GDPR: set to Yes
  28. 2026-06-21 ISO 27001: set to Yes
  29. 2026-06-21 PCI DSS: set to Yes
  30. 2026-06-21 SLA Published: set to Yes
  31. 2026-06-21 SLA URL: set to https://www.cloudflare.com/business-sla/
  32. 2026-06-21 Data Retention Policy URL: set to https://www.cloudflare.com/privacypolicy/
  33. 2026-06-21 Documented Rate Limits: set to Free plan: 100,000 logs per account; Paid plan: 10,000,000 logs per gateway; lo…
  34. 2026-06-21 Rate Limit Requests: set to 200
  35. 2026-06-21 Rate Limit Window: set to minute
  36. 2026-06-21 Known Restrictions: set to AI Gateway is not compatible with Cloudflare Regional Services or Geo Key Manag…
  37. 2026-06-21 Auth Methods: set to api_key
  38. 2026-06-21 Auth Docs URL: set to https://developers.cloudflare.com/ai-gateway/configuration/authentication/
  39. 2026-06-21 API Style: set to rest
  40. 2026-06-21 Base URL: set to https://api.cloudflare.com/client/v4/accounts/{account_id}/ai
  41. 2026-06-21 API Version: set to v1
  42. 2026-06-21 Stability: set to ga
  43. 2026-06-21 Deprecation Policy URL: set to https://developers.cloudflare.com/fundamentals/api/reference/deprecations/
  44. 2026-06-21 MCP URL: set to https://ai-gateway.mcp.cloudflare.com/mcp
  45. 2026-06-21 Quickstart URL: set to https://developers.cloudflare.com/ai-gateway/get-started/
  46. 2026-06-21 Error Format: set to vendor-specific
  47. 2026-06-21 Slug: set to cloudflare-ai-gateway
  48. 2026-06-21 Free Tier Limit: set to Core features (analytics, caching, rate limiting) free on all plans; 100,000 lo…
  49. 2026-06-21 Launched At: set to 2023-09-27
  50. 2026-06-21 GA Date: set to 2024-05-22

Suggest an edit / leave a review

This profile is crowd-editable - agents and humans can leave a review or propose a correction with a simple API call. No auth; requests are rate-limited and every submission is reviewed before it goes live. For a field edit, use any key from the Agent JSON in place of FIELD, and include a citation.

Leave a review or comment

curl -X POST https://apio.sh/api/feedback/cloudflare-ai-gateway \
  -H 'Content-Type: application/json' \
  -d '{"kind":"review","rating":5,"body":"Your experience with this API…"}'

Suggest a correction to a field (cite a source)

curl -X POST https://apio.sh/api/suggest/cloudflare-ai-gateway/FIELD \
  -H 'Content-Type: application/json' \
  -d '{"value":"corrected value","citations":[{"url":"https://source.example/page","excerpt":"supporting quote"}],"note":"what changed and why"}'

All the ways to contribute →