Cloudflare createAI Replaces workers-ai-provider: Migrate Now
Cloudflare's Agents SDK createAI replaces workers-ai-provider and ai-gateway-provider, now deprecated. One factory, fallbacks, BYOK. Plan your migration.
If your app calls models on Cloudflare, two of your dependencies just went into maintenance mode. Cloudflare's Agents SDK now ships createAI, one factory for Workers AI, AI Gateway catalog models, dynamic routes and vendor models. The packages it replaces, workers-ai-provider and ai-gateway-provider, are feature frozen and deprecated. There is no removal date yet. That is the time to move, not a reason to wait.
What actually happened
Per the Cloudflare changelog dated October 21:
- Import:
createAIcomes fromagents/models/ai-sdkfor the Vercel AI SDK, with a Pi AI version too. Install withnpm i agents. - Connect two ways: pass the
AIbinding inside a Worker, or an account ID plus API token to reach a gateway in another account or call from outside Workers. - One ID scheme: Workers AI models use
@cf/IDs. Catalog models useprovider/model, such asanthropic/claude-opus-5.5. Dynamic routes usedynamic/<route>. Vendor model objects pass through to provider-native endpoints. - Fallbacks: each model call takes a
fallbacklist. Cloudflare's own example sends Claude first and drops to a Workers AI GLM model if it fails. - Gateway options: caching, logging, metadata, retries, BYOK aliases and zero data retention.
- Stream resume: through the binding, a catalog or dynamic-route stream that drops mid-answer picks back up.
- Migration is mostly a rename:
createWorkersAI({ binding })becomescreateAI({ binding }). TheapiKeyoption becomesapiToken. AI Search moves to the separateai-search-providerpackage.
The Agents models docs cover the full API.
Why createAI matters for your business
Deprecated means no fixes. A frozen package still runs today. It will not get new models, new gateway features or bug fixes. The longer you wait, the bigger the diff when something breaks.
Fallback is now one line. A model outage used to mean a try/catch and a second client. Now it is an array. For a support bot or an order-status agent, a cheap fallback model keeps the lights on when your main provider has a bad hour.
Model IDs become config, not code. With every model behind one string format, swapping Claude for GLM is an environment variable. That is how you keep a vendor honest on price.
Watch the ZDR and BYOK flags. If you handle customer data, set zero data retention and bring your own keys on purpose, and write down why.
Key takeaways
- createAI in the Agents SDK replaces workers-ai-provider and ai-gateway-provider
- Old packages are feature frozen and deprecated, no removal date announced
- One ID format covers Workers AI, gateway catalog, dynamic routes and vendor models
- Per-call fallback lists, BYOK and zero data retention are built in
- Migration is mostly a rename, so do it before you need a new feature
Your AI features hard-wired to one model? We build provider-agnostic model layers with fallbacks and cost logging, on infrastructure you own. See how we build or price the switch.
Sources: Cloudflare changelog, Cloudflare Agents models docs.
- #cloudflare
- #agents-sdk
- #ai-gateway
- #workers-ai
- #vercel-ai-sdk
Tommy Rush — Founder, Rush Commerce
Operator turned builder. 15+ years running operations — now shipping the systems businesses run on. More
Get The Rush Report weekly — one email, zero fluff.
Keep reading
Recursive Flint: a free local coding model that runs on a laptop
Recursive's Flint is a 40B MoE local coding model under Apache 2.0 that runs on an M4 Pro MacBook. Here is where it fits and where paid assistants still win.
Read itOpenAI Decisions API Is GA: 400 Questions a Call, Cached Input
OpenAI's Decisions API is now generally available on GPT-6 Luna: 400 questions per request, prompt caching, JSON input, no output charge. Batch your classifiers.
Read it