Skip to content

[Workers AI, AI Gateway] Document unified billing - #32561

Merged
mchenco merged 3 commits into
productionfrom
mchen/wai-unified-rate-limits
Aug 7, 2026
Merged

[Workers AI, AI Gateway] Document unified billing#32561
mchenco merged 3 commits into
productionfrom
mchen/wai-unified-rate-limits

Conversation

@mchenco

@mchenco mchenco commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Documents Workers AI unified billing through AI Gateway, including gateway configuration, AI binding and REST API usage, paid model access, and elevated rate limits for frontier models. Adds a cross-product changelog entry for the update.

Screenshots (optional)

Documentation checklist

@github-actions github-actions Bot added product:ai-gateway AI Gateway: https://developers.cloudflare.com/ai-gateway/ product:workers-ai Workers AI: https://developers.cloudflare.com/workers-ai/ product:changelog size/m labels Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/changelog/ @cloudflare/pm-changelogs, @cloudflare/product-owners, @hoan-pom
/src/content/docs/ai-gateway/ @abhishekkankani, @palashgo, @thebongy, @roerohan, @kathayl, @mchenco, @zeke, @superhighfives, @adriandlam, @mattrothenberg, @ethulia, @aninibread, @kflansburg, @cloudflare/product-owners
/src/content/docs/workers-ai/ @rita3ko, @craigsdennis, @mchenco, @zeke, @superhighfives, @mattrothenberg, @ethulia, @aninibread, @kflansburg, @cloudflare/product-owners
/src/content/partials/ai-gateway/ @abhishekkankani, @palashgo, @thebongy, @roerohan, @kathayl, @mchenco, @zeke, @superhighfives, @adriandlam, @mattrothenberg, @ethulia, @aninibread, @kflansburg, @cloudflare/product-owners
* @cloudflare/product-owners

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Preview URL: https://117e0b93.preview.developers.cloudflare.com
Preview Branch URL: https://mchen-wai-unified-rate-limits.preview.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/changelog/post/2026-08-07-workers-ai-unified-billing/ https://mchen-wai-unified-rate-limits.preview.developers.cloudflare.com/changelog/post/2026-08-07-workers-ai-unified-billing/
https://developers.cloudflare.com/ai-gateway/configuration/manage-gateway/ https://mchen-wai-unified-rate-limits.preview.developers.cloudflare.com/ai-gateway/configuration/manage-gateway/
https://developers.cloudflare.com/ai-gateway/usage/worker-binding-methods/ https://mchen-wai-unified-rate-limits.preview.developers.cloudflare.com/ai-gateway/usage/worker-binding-methods/
https://developers.cloudflare.com/workers-ai/platform/limits/ https://mchen-wai-unified-rate-limits.preview.developers.cloudflare.com/workers-ai/platform/limits/
https://developers.cloudflare.com/workers-ai/platform/pricing/ https://mchen-wai-unified-rate-limits.preview.developers.cloudflare.com/workers-ai/platform/pricing/
https://developers.cloudflare.com/ai-gateway/features/unified-billing/ https://mchen-wai-unified-rate-limits.preview.developers.cloudflare.com/ai-gateway/features/unified-billing/
https://developers.cloudflare.com/ai-gateway/usage/rest-api/ https://mchen-wai-unified-rate-limits.preview.developers.cloudflare.com/ai-gateway/usage/rest-api/
https://developers.cloudflare.com/ai-gateway/get-started/ https://mchen-wai-unified-rate-limits.preview.developers.cloudflare.com/ai-gateway/get-started/
https://developers.cloudflare.com/ai-gateway/usage/providers/workersai/ https://mchen-wai-unified-rate-limits.preview.developers.cloudflare.com/ai-gateway/usage/providers/workersai/
https://developers.cloudflare.com/workers-ai/platform/ai-gateway/ https://mchen-wai-unified-rate-limits.preview.developers.cloudflare.com/workers-ai/platform/ai-gateway/

Comment thread src/content/docs/ai-gateway/configuration/manage-gateway.mdx
@mchenco
mchenco marked this pull request as ready for review August 6, 2026 01:38
@mchenco
mchenco requested a review from craigsdennis as a code owner August 6, 2026 01:38
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 3 warnings, 💡 1 suggestion found in commit 117e0b9.

👉 Fix in your agent 👈
Fix the following review findings in PR #32561 (https://github.com/cloudflare/cloudflare-docs/pull/32561).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
  or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.

The comment must come before the commit — the bot reads PR comments when a new
push triggers a review, so skip comments posted after the push will be missed.

---

## Code Review

### Warnings (2)

#### CR-2d960f7a39f4 · Content contradicts existing Unified Billing docs
- **File:** `src/content/partials/ai-gateway/create-gateway.mdx` line 16
- **Issue:** The added step says Workers AI requests can be billed via **Unified billing**, but `/ai-gateway/features/unified-billing/` currently states: "Workers AI models (models prefixed with `@cf/`) routed through AI Gateway are not charged via Unified Billing... Unified Billing only applies to third-party provider models."
- **Fix:** Reconcile the two pages. If Workers AI now supports Unified Billing, update `/ai-gateway/features/unified-billing/` to remove or qualify the statement that it only applies to third-party models. If Workers AI does not support Unified Billing, do not present it as an option for Workers AI billing here.

#### CR-f2c50ced7414 · REST API example omits required gateway header
- **File:** `src/content/docs/ai-gateway/features/unified-billing.mdx` line 77
- **Issue:** Line 77 instructs users to include the `cf-aig-gateway-id` header for REST API requests, but the curl example in the following REST API subsection does not include it. For Workers AI requests, this header is required to route through AI Gateway and use Unified Billing credits.
- **Fix:** Update the REST API curl example to include `--header "cf-aig-gateway-id: my-gateway"` (or use a `@cf/` Workers AI model in an example that demonstrates the Workers AI flow).

---

## Style Guide Review

### Warnings (1)

#### SG-a7bcf7a62d57 · Directional words
- **File:** `src/content/docs/ai-gateway/usage/rest-api.mdx` line 120
- **Issue:** Line uses `shown above` to refer to a previous example
- **Fix:** Replace `shown above` with a direct reference by name or link, such as `in the cURL example` or `in the example request`.

### Suggestions (1)

#### SG-232fa8063e50 · Serial comma
- **File:** `src/content/docs/ai-gateway/usage/providers/workersai.mdx` line 15
- **Issue:** List `analytics, logging, caching, security, and prepaid billing` is missing the comma before the final `and`.
- **Fix:** Add a comma before `and`: `analytics, logging, caching, security, and prepaid billing``analytics, logging, caching, security, and prepaid billing`.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

Warnings (2)
File Issue
partials/ai-gateway/create-gateway.mdx line 16 Content contradicts existing Unified Billing docs — The added step says Workers AI requests can be billed via **Unified billing**, but /ai-gateway/features/unified-billing/ currently states: "Workers AI models (models prefixed with @cf/) routed through AI Gateway are not charged via Unified Billing... Unified Billing only applies to third-party provider models." Fix: Reconcile the two pages. If Workers AI now supports Unified Billing, update /ai-gateway/features/unified-billing/ to remove or qualify the statement that it only applies to third-party models. If Workers AI does not support Unified Billing, do not present it as an option for Workers AI billing here.
ai-gateway/features/unified-billing.mdx line 77 REST API example omits required gateway header — Line 77 instructs users to include the cf-aig-gateway-id header for REST API requests, but the curl example in the following REST API subsection does not include it. For Workers AI requests, this header is required to route through AI Gateway and use Unified Billing credits. Fix: Update the REST API curl example to include --header "cf-aig-gateway-id: my-gateway" (or use a @cf/ Workers AI model in an example that demonstrates the Workers AI flow).

Conventions

No convention issues found.

Style Guide Review

Warnings (1)
File Issue
ai-gateway/usage/rest-api.mdx line 120 Directional words — Line uses shown above to refer to a previous example Fix: Replace shown above with a direct reference by name or link, such as in the cURL example or in the example request.
Suggestions (1)
File Issue
ai-gateway/usage/providers/workersai.mdx line 15 Serial comma — List analytics, logging, caching, security, and prepaid billing is missing the comma before the final and. Fix: Add a comma before and: analytics, logging, caching, security, and prepaid billinganalytics, logging, caching, security, and prepaid billing.
Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

@mchenco
mchenco marked this pull request as draft August 6, 2026 03:44
@mchenco

mchenco commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

DO NOT MERGE

@mchenco
mchenco marked this pull request as ready for review August 6, 2026 21:23
@mchenco
mchenco marked this pull request as draft August 6, 2026 21:23
@mchenco
mchenco force-pushed the mchen/wai-unified-rate-limits branch from 52e4670 to 117e0b9 Compare August 6, 2026 23:49
@mchenco
mchenco marked this pull request as ready for review August 7, 2026 05:17
@mchenco
mchenco merged commit 3ac62a2 into production Aug 7, 2026
13 checks passed
@mchenco
mchenco deleted the mchen/wai-unified-rate-limits branch August 7, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:ai-gateway AI Gateway: https://developers.cloudflare.com/ai-gateway/ product:changelog product:workers-ai Workers AI: https://developers.cloudflare.com/workers-ai/ size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.