Skip to main content

Cloudflare createAI: Check Routing and Credentials During Migration

3 min read

Cloudflare createAI replaces two deprecated provider packages. Check model routes, API credentials, fallback behavior and the separate AI Search migration.

Cloudflare createAI: Check Routing and Credentials During Migration

One provider entry point can simplify code while changing how requests reach a model. Preserve the old route details before replacing the imports.

What changes in the provider layer

Cloudflare’s October 21 changelog introduces createAI in the Agents SDK. Applications can select Workers AI models or route through AI Gateway. The interface also accepts dynamic routes and model objects from vendor packages.

The older Workers AI and AI Gateway provider packages are feature-frozen and deprecated. The notice asks users to migrate when convenient; it does not announce a removal date.

Keep credentials and routing explicit

The new interface accepts an AI binding or an account identifier with an API token. The migration example changes apiKey to apiToken for the account-based configuration.

Record the account, gateway, and model identifier the current application uses. Preserve the intended BYOK settings and logging policy while changing the provider. A working response alone cannot prove the request used the intended account.

Vendor model objects use AI Gateway’s provider-native endpoint. Review that path separately from catalog identifiers and dynamic routes, especially where your application depends on provider-specific request fields.

Exercise the fallback path deliberately

I would use a small staging request with an observable result and a safe failure condition. Save the actual model route used for each outcome.

  • Compare a successful request before and after migration.
  • Trigger a controlled failure of the primary route.
  • Check the selected fallback and the number of attempts.
  • Inspect charges and logs for the test requests.
  • Verify that a rejected credential does not silently change the intended access path.

Cloudflare describes stream resume through the binding for catalog and dynamic-route streams. Do not assume every provider and transport has identical resume behavior.

Move AI Search through its own package

The changelog directs AI Search users to ai-search-provider. Its example maps createAISearch to createAISearchNamespace. Treat that as a separate integration change.

Keep a small migration record with the old configuration, replacement, and verified behavior. It gives the next maintainer a concrete reason for each changed setting.

The AI Search article covers indexing and retrieval. Our cost-control guide explains how retries and routing affect accepted-task costs.

Read the sources and choose your next check

Which route would be hardest to observe if it changed unexpectedly?

Checked October 21, 2026. This article is based on source review and analysis. Suggested tests have not been performed by MustHave.ai.

Leave a comment

Your email address will not be published. Required fields are marked *