0+
May 29, 2026
May 29, 2026
This plugin connects WordPress to Cloudflare Workers AI, making its hosted large language models available to any WordPress feature or plugin that uses the WordPress AI Client (introduced in WordPress 7.0).
The plugin fetches the full list of available text generation models directly from your Cloudflare account and shows them in the settings dropdown, so you always see what is actually available to you. The list is cached for 12 hours and refreshed whenever you save your credentials.
A built-in fallback list is used when your credentials are not yet configured or the API is unreachable. See Cloudflare’s model catalogue for the current full list.
Unlike hosted AI services that charge per seat or per API call at a premium rate, Cloudflare Workers AI runs inference at the edge on a usage-based model. The free tier covers 10,000 neurons per day (Cloudflare’s billing unit — roughly 200–500 average generation requests) — enough for a content-heavy site to generate post summaries, meta descriptions, and moderation checks without any cost. Paid usage is billed per neuron, making it significantly cheaper at scale compared to per-token pricing from closed providers.
Your prompts and completions also never leave Cloudflare’s network to reach a third-party AI company’s servers, which matters for sites with privacy or data-residency requirements.
Once the plugin is configured, any WordPress AI Client-compatible feature or plugin will automatically use Cloudflare Workers AI as its provider.
Developers can also call it directly:
use WordPress\AiClient\AiClient;
$result = AiClient::prompt( 'Summarise this post in two sentences.' )
->usingProvider( 'cloudflare-workers-ai' )
->usingModel( '@cf/meta/llama-4-scout-17b-16e-instruct' )
->generateTextResult();
echo $result->toText();
Switch models without changing any other code — swap llama-4-scout-17b-16e-instruct for qwen2.5-coder-32b-instruct and you are running a coding assistant instead.
This plugin does not add a chatbot or front-end widget by itself. It registers the provider so that other AI Client-powered features, plugins, and themes can use it.
This plugin connects to the Cloudflare Workers AI REST API to run AI inference.
The service is used to:
When you click “Test connection” in the plugin settings, your Account ID and API token are sent to https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/models/search to verify the credentials. No prompt data is sent during this check.
When a compatible AI Client feature generates text, the plugin sends your API token, the selected model ID, and the prompt messages to https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/run/{model_id}. Requests are only made when AI generation is explicitly triggered — nothing is sent automatically in the background.
Cloudflare Workers AI is provided by Cloudflare, Inc.
Current version supports Workers AI edge inference. AI Gateway support for caching, rate-limiting, and analytics coming soon.
/wp-content/plugins/.You can define credentials in wp-config.php instead of the settings page:
define( 'CLOUDFLARE_WORKERS_AI_ACCOUNT_ID', 'your-account-id' );
define( 'CLOUDFLARE_WORKERS_AI_API_TOKEN', 'your-api-token' );
You can also hard-code the default model (the settings page dropdown takes precedence over this constant):
define( 'CLOUDFLARE_WORKERS_AI_DEFAULT_MODEL', '@cf/meta/llama-3.3-70b-instruct-fp8-fast' );
Environment variables with the same names are also supported.
Go to dash.cloudflare.com and select your account. The Account ID appears in the right-hand sidebar of the account home page.
Visit dash.cloudflare.com/profile/api-tokens, click Create Token, and select the Workers AI template (or manually add “Workers AI – Edit” permission).
Yes. Go to Settings Cloudflare Workers AI and use the Text generation model dropdown. The list is fetched live from your Cloudflare account (all text generation models available to you are shown) and cached for 12 hours.
The default when nothing is selected is Meta Llama 4 Scout 17B — a good all-round starting point. You can also override the model in wp-config.php — the settings page takes precedence over the constant.
Different models have different strengths, response styles, and context lengths. If the default model isn’t producing the results you want:
Swap models from the Text generation model dropdown in Settings — no code changes needed.
Not in version 1.0. Text generation is supported in this release. Image generation support via Cloudflare Workers AI is planned for a future version.
WordPress requires site administrators to explicitly allow each AI connector before any feature can use it. Go to Settings Connectors, find Cloudflare Workers AI, and click Allow. You only need to do this once.
No. The WordPress AI Client API is introduced in WordPress 7.0. The plugin will not register itself if the AI Client is not available.