releases.sh

Workers AI and AI Gateway unify model access and billing

4 featuresThis release4 featuresNew capabilitiesAI-tallied from the release notes
From the original release noteView original ↗

Workers AI and AI Gateway now provide a unified path for accessing models and managing inference traffic. 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.

Unified entrypoints and observability

The AI binding supports both Workers AI and third-party models through env.AI.run(). The REST API provides shared /ai/ endpoints with Cloudflare authentication across providers.

Route a Workers AI request through AI Gateway by specifying a gateway ID. Use default to automatically create a gateway on the first authenticated request, or specify an existing gateway to separate applications and workloads:

<span class="line"><span class="nb-shiki-1itgoe">const</span><span class="nb-shiki-dzsirb"> response</span><span class="nb-shiki-1itgoe"> =</span><span class="nb-shiki-1itgoe"> await</span><span class="nb-shiki-140thh"> env.</span><span class="nb-shiki-dzsirb">AI</span><span class="nb-shiki-140thh">.</span><span class="nb-shiki-1t8gfj">run</span><span class="nb-shiki-140thh">(</span></span>
<span class="line"><span class="nb-shiki-mdbnqw">	"@cf/zai-org/glm-5.2"</span><span class="nb-shiki-140thh">,</span></span>
<span class="line"><span class="nb-shiki-140thh">	{</span></span>
<span class="line"><span class="nb-shiki-140thh">		messages: [{ role: </span><span class="nb-shiki-mdbnqw">"user"</span><span class="nb-shiki-140thh">, content: </span><span class="nb-shiki-mdbnqw">"What is the capital of France?"</span><span class="nb-shiki-140thh"> }],</span></span>
<span class="line"><span class="nb-shiki-140thh">	},</span></span>
<span class="line"><span class="nb-shiki-140thh">	{</span></span>
<span class="line"><span class="nb-shiki-140thh">		gateway: { id: </span><span class="nb-shiki-mdbnqw">"default"</span><span class="nb-shiki-140thh"> },</span></span>
<span class="line"><span class="nb-shiki-140thh">	},</span></span>
<span class="line"><span class="nb-shiki-140thh">);</span></span>
<span class="line"><span class="nb-shiki-1itgoe">const</span><span class="nb-shiki-dzsirb"> response</span><span class="nb-shiki-1itgoe"> =</span><span class="nb-shiki-1itgoe"> await</span><span class="nb-shiki-140thh"> env.</span><span class="nb-shiki-dzsirb">AI</span><span class="nb-shiki-140thh">.</span><span class="nb-shiki-1t8gfj">run</span><span class="nb-shiki-140thh">(</span></span>
<span class="line"><span class="nb-shiki-mdbnqw">	"@cf/zai-org/glm-5.2"</span><span class="nb-shiki-140thh">,</span></span>
<span class="line"><span class="nb-shiki-140thh">	{</span></span>
<span class="line"><span class="nb-shiki-140thh">		messages: [{ role: </span><span class="nb-shiki-mdbnqw">"user"</span><span class="nb-shiki-140thh">, content: </span><span class="nb-shiki-mdbnqw">"What is the capital of France?"</span><span class="nb-shiki-140thh"> }],</span></span>
<span class="line"><span class="nb-shiki-140thh">	},</span></span>
<span class="line"><span class="nb-shiki-140thh">	{</span></span>
<span class="line"><span class="nb-shiki-140thh">		gateway: { id: </span><span class="nb-shiki-mdbnqw">"default"</span><span class="nb-shiki-140thh"> },</span></span>
<span class="line"><span class="nb-shiki-140thh">	},</span></span>
<span class="line"><span class="nb-shiki-140thh">);</span></span>

Requests routed through AI Gateway can be logged and included in analytics for request volume, errors, latency, token usage, and costs. You can also configure controls such as caching, rate limiting, and request retries on the gateway.

Unified billing and higher rate limits

You can now use prepaid AI Gateway credits to pay for Workers AI inference. This provides one credit balance for Workers AI and supported third-party model providers. To use credits for Workers AI, set the gateway's Workers AI billing setting to Unified billing. Workers AI requests routed through that gateway deduct from your credit balance in real time.

Prepaid credits also provide access to the following Workers AI frontier models without requiring the Workers Paid plan. Each frontier Workers AI model has a rate limit of 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:

These limits are designed for typical agentic and coding workloads, where requests to frontier models can take longer to complete.

For details, refer to Workers AI limits, Workers AI pricing, Unified Billing, and the AI Gateway model catalog.

Fetched August 7, 2026

Workers AI and AI Gateway unify model access and billing —… — releases.sh