Cloudflare AI Gateway

Listed at https://developers.cloudflare.com/ai-gateway/

Overall Rank #10 ⭐ Consider
✅ Global CDN (China edge via partners) | 🌍 International

💰 Token Pricing

TypePriceNote
Input 免费层: 100万次请求/月;超出 $0.20/100万次 + Provider 自身费用 per million tokens
Output 按请求计费,不按 token 计;Gateway 本身加价 $0.20/100万请求 per million tokens
💡 Free Credits:

🤖 Supported Models (500)

通过 Gateway 路由到 20+ Provider 任意模型

✨ Pros

  • Unified API gateway for 20+ AI providers
  • Built-in caching, retry, load balancing, rate limiting
  • Request logging & analytics: volume, errors, latency, spend
  • Multi-provider strategy: Fallback, A/B test, cost routing
  • 1M requests/month free
  • Direct Cloudflare Workers AI integration

⚠️ Cons

  • ×Doesn't host its own models, routing only
  • ×China access requires partner routing
  • ×Cost = Provider fee + Gateway surcharge
  • ×Advanced strategies (A/B, fallback) need configuration
  • ×Gateway not directly available in China (local partner)

🎯 Best For

Teams managing multiple providers; cost monitoring analytics; high-availability API orchestration

💰 Pricing & Plans

TierRequests / monthGateway FeeProvider FeeNotes
FreeUp to 1M$0Pay-as-you-goGenerous free tier for prototyping and small apps; logs retained 1 day
Paid (per-request)> 1M$0.20 / 1M reqPay-as-you-goFlat per-request surcharge on top of the underlying provider cost
Workers PaidUnlimitedIncluded via Workers billPay-as-you-goAI Gateway usage rolls into your Cloudflare Workers / account billing

🔧 API & Developer Experience

  • Unified Endpoint: A single HTTPS endpoint (gateway.ai.cloudflare.com/v1/<account>/<gateway>) proxies any model from 20+ providers, so you swap providers without changing your application code or SDK.
  • OpenAI-Compatible: The gateway speaks the standard OpenAI chat/completions protocol, so OpenAI SDKs and most LLM libraries work after a base-URL change.
  • Caching & Retries: Built-in semantic/response caching, automatic retries on 429/5xx errors, and request timeouts reduce provider failure and cut repeated-call cost.
  • Fallback & A/B Routing: Configure fallback chains, A/B tests, and cost-aware routing across providers — with per-gateway strategies that switch dynamically on failure.
  • Observability: Per-request logging with token counts, latency, error rates and cost per provider on the dashboard; easy to export or alert on anomalies.
  • Workers AI Integration: Native integration with Cloudflare Workers AI and the Workers runtime, letting you run gateway logic and edge AI in the same deployment.

🎯 Multi-Provider Gateway & Observability

Cloudflare AI Gateway's core value is not a model — it is reliability and control across many model providers behind one API. Teams route OpenAI, Anthropic, Google, DeepSeek and dozens more through a single endpoint, then layer on caching, automatic retries and per-provider fallback chains so a single upstream outage never takes down the product. Cost-aware routing and A/B testing shift traffic between vendors on latency, quality and price without code changes. Every call is logged with token counts, timing and cost, giving the spend observability raw provider consoles lack. Riding Cloudflare's global edge, requests serve from the nearest edge for low latency, and gateway fees stay flat at $0.20 per million requests (1M/month free) — the pragmatic control plane for teams that treat AI APIs as interchangeable commodities.

🌐 China Access & Latency

Cloudflare AI Gateway is a global service and is NOT natively hosted in mainland China. It is reachable from China on the global edge network, but the practical experience depends on routing and partner edges — latency from mainland networks is generally higher and less predictable than China-native providers. For China-based teams the common pattern is to use the gateway as a steering/observability layer for overseas vendors while calling Chinese providers (Zhipu, Qwen, Doubao) directly through their own mainland endpoints. Billing is in USD on your Cloudflare account, adding currency and invoicing friction relative to CNY providers. In short: fully usable internationally and from Hong Kong/Tier-1 corridors, but mainland-first teams should treat it as an orchestration layer, not a primary low-latency China endpoint.