Workers AI and AI Gateway merge together! Frontier models now available without a Workers Paid plan, with 2.5x higher rate limits!
Hi, it's Shii! Today I found a nice update from Cloudflare's Changelog about Workers AI and AI Gateway. Whether you call Workers AI directly or already lean on AI Gateway, this one's worth knowing about!
Cloudflare ChangelogWhat was announced?
On Cloudflare's Changelog, Cloudflare announced that Workers AI and AI Gateway now unify model access and billing. You can use the same AI binding and REST API to call models hosted on Workers AI or by supported third-party providers, with AI Gateway providing observability, logging, caching, security, and billing controls for those requests.
The story so far
Until now, calling Workers AI directly and routing requests through AI Gateway were somewhat separate paths, with different entry points and billing handling. This update brings both paths onto the same interface and the same billing model.
What changes
- The AI binding using
env.AI.run()now supports both Workers AI and third-party models - The REST API also exposes shared
/ai/endpoints, reachable across providers with the same Cloudflare authentication - You can route a Workers AI request through AI Gateway by specifying a gateway ID; using
defaultautomatically creates a gateway on the first authenticated request - Requests routed through AI Gateway are logged and included in analytics for request volume, errors, latency, token usage, and costs, and you can configure caching, rate limiting, and request retries on the gateway
- You can now pay for Workers AI inference with AI Gateway prepaid credits, giving you a single credit balance across Workers AI and supported third-party providers
Dive Deep
Code example
Here's what calling Workers AI through a gateway looks like:
const response = await env.AI.run(
"@cf/zai-org/glm-5.2",
{
messages: [{ role: "user", content: "What is the capital of France?" }],
},
{
gateway: { id: "default" },
},
);
Just passing gateway: { id: "default" } routes the request through AI Gateway. If you want to separate applications or workloads, you can specify an existing gateway ID instead.
Unified billing setup and supported models
To use credits for Workers AI billing, you need to set the gateway's Workers AI billing setting to Unified billing. Workers AI requests routed through that gateway then deduct from your credit balance in real time.
On top of that, prepaid credits give you access to the following Workers AI frontier models without requiring the Workers Paid plan:
@cf/moonshotai/kimi-k2.6@cf/moonshotai/kimi-k2.7-code@cf/zai-org/glm-5.2
Rate limits are higher too: each frontier model gets 50 requests per minute per account, per model when billed with AI Gateway credits, compared to 20 requests per minute through standard Workers AI billing — a 2.5x increase. These limits are designed for typical agentic and coding workloads, where requests to frontier models can take longer to complete.
Wrap-up
- Workers AI and AI Gateway now share unified model access and billing, so the same AI binding / REST API can call both Workers AI and third-party models
- Routing a Workers AI request through AI Gateway just takes a gateway ID, and
defaultauto-creates a gateway for you - A new "Unified billing" setting lets AI Gateway prepaid credits cover Workers AI charges
- With credit billing, you get access to the Kimi-k2.6, Kimi-k2.7-code, and GLM-5.2 frontier models without a Workers Paid plan, and rate limits rise from 20 to 50 requests per minute
This is a nice update whether you're already combining Workers AI with AI Gateway, or you're just getting started with AI Gateway for observability and cost control!