Cloudflare Just Made It Easier to Use Claude and Other AI Models Together
Cloudflare has eliminated the friction of juggling multiple AI model providers by merging its Workers AI and AI Gateway platforms into a single unified system. Starting August 7, developers can now call Anthropic's Claude, OpenAI's GPT-4, Google Gemini, xAI's Grok, and more than 70 other models across 12 different providers through the same code binding, eliminating the need to maintain separate API keys and different code paths for each service.
What Changed in Cloudflare's AI Developer Stack?
Before the unification, developers working with Cloudflare's infrastructure faced an awkward split personality. If you wanted to use Cloudflare-hosted models like Meta's Llama, you'd call them through env.AI.run(). But if you wanted to use Claude or GPT-4, you'd have to write completely different code, fetch those APIs separately, and manage API keys outside your main application logic. This meant maintaining two separate code paths in the same application.
The unified approach collapses this complexity. Now, whether you're calling Cloudflare's Llama model or Anthropic's Claude, the syntax is nearly identical. The only thing that changes is the model string. You still use env.AI.run(), but now you can pass "anthropic/claude-opus-4-6" or "openai/gpt-4.1-mini" the same way you'd pass a Cloudflare-hosted model. API keys are stored securely in Cloudflare Secrets, so you never handle them directly in your worker code.
How to Migrate to Cloudflare's Unified AI Platform?
- For Existing Workers AI Users: Add a gateway ID parameter to your current env.AI.run() calls and enable unified billing in your AI Gateway settings. Automatic observability and request logging activate immediately, and your rate limits for frontier models jump from 20 requests per minute to 50 requests per minute.
- For Third-Party Provider Users: Consolidate separate fetch calls to OpenAI, Anthropic, or other providers into the unified env.AI.run() binding. You'll gain automatic logging of every request, including token counts, latency, and cost attribution, without any additional configuration.
- For Multi-Provider Workflows: Enable unified billing to cover both Cloudflare-hosted inference and third-party API calls under one balance and one invoice, simplifying expense tracking and budget management.
Why Does Automatic Observability Matter More Than You Might Think?
One of the most underrated aspects of this launch is the automatic observability layer. Every request, whether it's calling Claude, GPT-4, or Llama, is automatically logged with full payloads, token counts, latency measurements, and cost attribution. No pipeline configuration required. Simply pass "default" as the gateway ID, and AI Gateway creates itself on the first authenticated request.
This addresses a real pain point in 2026. Most teams running AI-heavy workflows have struggled to get clear visibility into which models are costing what. The automatic observability that comes with unified billing may be worth more than the billing consolidation itself, giving teams the data they need to optimize their AI spending across multiple providers.
What Are the Trade-Offs and Next Steps?
There are a few practical considerations. Credits purchased through Cloudflare carry a 5% purchase fee, so if you load $100 in credits, you're charged $105. This is worth factoring into your cost calculations before consolidating all your AI spending through Cloudflare.
Additionally, routing Claude and OpenAI calls through Cloudflare's env.AI.run() creates a platform dependency. If you move off Cloudflare Workers in the future, you lose the unified billing, automatic observability, and routing logic. Open-source alternatives like LiteLLM or Portkey offer similar multi-provider proxy capabilities without the lock-in, though they require more infrastructure management on your end.
Cloudflare's stated next move is model-first routing, where instead of hardcoding "anthropic/claude-opus-4-6," you'd declare what you need, such as "fast," "cheap," or "reasoning-capable," and the control plane would automatically route to the best available option across all providers, handling failover automatically. This feature is not yet fully shipped, but the unified platform released on August 7 provides the foundation for this capability.
For developers already deep in the Cloudflare Workers ecosystem, the unification is a clear improvement in developer experience and operational visibility. For teams hedging across multiple platforms, the lock-in trade-off is worth evaluating carefully before committing to consolidate all AI API calls through Cloudflare's infrastructure.