Repository navigation
[Workers AI, AI Gateway] Move docs off workers-ai-provider and ai-gateway-provider - #34482
mattzcarey wants to merge 4 commits into
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://docs-deprecate-workers-ai-ai-gateway-providers.previews.developers.cloudflare.com (commit 8495c88)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
AI Review✅ Reviewed 👉 Fix in your agent 👈Fix the following review findings in PR #34482 (https://github.com/cloudflare/cloudflare-docs/pull/34482).
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, 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 because the next review reads PR comments.
## Code Review
- C-169abcb3 | src/content/docs/ai-gateway/integrations/vercel-ai-sdk.mdx:56 | Catalog-id model calls contradict the createAI reference
This example calls `ai("anthropic/claude-opus-5.5")` with a catalog id string, but the in-repo `/agents/models/ai-sdk/` reference for the same function states that any string that is not a `@cf/` id throws a `TypeError` and that third-party models must be passed as vendor model objects (e.g. `ai(anthropic("claude-opus-5-5"))`). The fallback example on line 91 lists `"openai/gpt-5.5"` even though the reference types `fallback` as `(WorkersAIModelId | LanguageModelV4)[]`. The selector's unified tab renders the same `ai("openai/gpt-6-luna")` pattern. Either the examples or the reference are wrong; reconcile before merge.
```txt
model: ai("anthropic/claude-opus-5.5"),
```
- C-013d99c2 | src/components/ai-gateway/code-examples.astro:114 | Unified API tab renders the same vendor-native code as Native
The `["unified", "native"]` flatMap renders `aiSDKNativeCode` with identical replacements for both API types, so with a key in the request the "Unified" tab shows byte-for-byte the same vendor-SDK code as "Native" (`createOpenAI({ apiKey: "{API_KEY}" })` plus `{ vendorKey: "request" }`). The PR describes the Unified tab as the catalog-id form (`ai("{id}")`), which is what the stored-key unified block renders. On `ai-gateway/usage/chat-completion` (which forces `forceAPI="unified"`), picking "Key in Request" therefore shows vendor-native code with the user's vendor key under the Unified label.
```txt
(["unified", "native"] as const)
```
## Style Guide
- S-01e45b3d | src/content/changelog/workers-ai/2026-10-21-workers-ai-provider-ai-gateway-provider-deprecated.mdx:13 | Prose contains `please`
The core writing style rules require removing `please` from prose. This line is plain prose (not inside a code block or backtick span), so it should state the instruction directly without the word.Code Review
Style Guide
Commands
|
|
Folded into #34300, so it's one PR. |
workers-ai-providerandai-gateway-providerare deprecated on npm. This moves the docs tocreateAIfromagents/models/ai-sdk.createWorkersAIforcreateAIand replaceworkers-ai-providerwithai @ai-sdk/provider(plusagentswhere it was missing) in their install commands. This includesagents/harnesses/think/configuration, which the original page list missed. Inagents/concepts/calling-llms, the embedding call now usesai.embedding().sandbox/sdk/tutorials/ai-code-executoronly had a related-resources link, which now points to/agents/models/ai-sdk/.workers-ai/configuration/ai-sdkandai-gateway/integrations/vercel-ai-sdkare rewritten as shortcreateAIpages that link to/agents/models/ai-sdk/.ai-gateway/usage/chat-completion(src/components/ai-gateway/) usescreateAIwith an account id and API token: a catalog id for Unified, the vendor's model object for Native, andvendorKey: "request"for a key in the request. The selector's models are current:gpt-6-luna,claude-opus-5-5,gemini-4-argon,grok-4.7(catalog ids checked on the REST API; vendor ids on/compat).changelog/workers-ai/2026-10-21-workers-ai-provider-ai-gateway-provider-deprecated.mdx.Merge after #34300 (it adds
/agents/models/ai-sdk/) and theagents0.29.0 release.Pages left unchanged:
ai-search/agent-sdks/ai-sdk: pairsai-search-provider(AI SDK v6) withworkers-ai-provider@^3.createAIneeds AI SDK v7.ai-search/how-to/human-in-the-loop-knowledge-base: pinsai@6.sandbox/sdk/tutorials/workers-ai-code-interpreter: walks through the code in thecloudflare/sandbox-sdk/examples/code-interpreter#v0template, which pinsai@^6andworkers-ai-provider@^3.