AIPCF – AI Provider for Cloudflare
AIPCF – AI Provider for Cloudflare
Description
AIPCF connects WordPress to Cloudflare Workers AI. Once connected, the AI features built into WordPress 7.0+ and the WordPress AI plugin run on Cloudflare’s models: excerpts, titles and meta descriptions in the editor, alt text on upload, image generation. A background job fills in the meta descriptions and alt text your archive is missing. Everything runs inside Cloudflare’s free daily allowance of 10,000 neurons, and a daily budget makes sure a busy day never turns into a bill.
AIPCF is an independent community plugin, not an official Cloudflare or WordPress product. It was built out of need, and love for the idea that every small site should get useful AI without a bill.
What it costs, measured on a live site
- a meta description, excerpt or title: about 2 neurons (about 5,000 a day inside the allowance)
- a generated 1024×1024 image: about 170 neurons (about 55 a day)
- describing an image for alt text: about 17 neurons
- translating a sentence: under 1 neuron
What you get
- In the editor, with the WordPress AI plugin: excerpts, titles, meta descriptions, summaries, alt text on upload, image generation.
- Across your archive: Backfill fills missing meta descriptions (Yoast, Rank Math, AIOSEO, SEOPress) and image alt text every hour, a batch at a time, within its daily limit. It works with or without the AI plugin. A 140-post backlog cost about 175 neurons on a real site.
- A receipt after every action: feature, model, neurons and time, shown in the editor. Today’s total sits in the admin bar. A monthly email sums up requests, tokens and neurons.
- Translation for any theme or plugin:
aipcf_translate( $text, 'mr' ), 100 languages via M2M100 and 22 Indian languages via IndicTrans2.
What you need
- A Cloudflare account. No credit card is needed for the Workers AI daily allowance.
- An API token created from the “Workers AI” template at dash.cloudflare.com/profile/api-tokens. For Embeddings with Cloudflare Vectorize, add the permission Account > Vectorize > Edit to it.
- Your Account ID, the 32-character code on the right of the Workers & Pages page in the Cloudflare dashboard.
The setup panel walks through all three, and one click applies the recommended defaults.
How it stays inside the allowance
- Recommended defaults: Gemma 4 26B for writing, Granite 4 Micro for short tasks, a daily budget of 10,000 neurons, no paid fallbacks, caching on.
- Daily budget: email at 80%; at 100% either pause until midnight UTC or switch text requests to the cheapest model instead of failing (Backfill, Embeddings, Link assistant chat, the Site assistant, Member search, Search insights, images and translation pause).
- Short tasks on a small model: titles, excerpts, meta descriptions, moderation and alt text go to a model that costs a fraction of the neurons; long-form keeps your default.
- Caching: repeated identical prompts are answered from cache for zero neurons, at Cloudflare’s edge through AI Gateway or locally. A “Regenerate” click within ten minutes bypasses it so you get a new answer.
- Never fall back to paid providers: one switch keeps Anthropic, Google and OpenAI out of the AI plugin’s fallback list.
- Site Health: two tests (the connection, and Embeddings when on) that warn only about things that need you: not connected, connector unapproved, a license gate, the gateway bypassed, the daily budget reached.
Every Workers AI model
The model list is read from your account and cached for 12 hours. Each entry shows context window, neurons per 1,000 tokens from your account’s current price list, and whether it supports tool calling or image input.
- Chat models: Llama, Gemma, GPT-OSS, Qwen, Mistral, DeepSeek, GLM, Granite, Kimi, Nemotron and whatever Cloudflare adds next. Requests use Cloudflare’s OpenAI-compatible endpoint, so new families work without a plugin update.
- Tool calling, JSON output with schema, system instructions, stop sequences and penalties through the standard AI Client API. Reasoning models keep their thinking on the AI Client’s thought channel, out of the answer.
- Vision: a vision model (Llama 3.2 11B Vision on most accounts, selectable on the Models tab) reads inline and remote images. Your default text model is not used for images.
- Image generation: FLUX.1 schnell, SDXL Lightning, SDXL, DreamShaper, Leonardo Lucid Origin and Phoenix.
AI Gateway
Enter a gateway name and requests go through Cloudflare AI Gateway for edge caching, rate limits, spend limits, logs and analytics. Each request is tagged with the site, feature, model and user, so the gateway’s analytics answer “which feature is spending my neurons”. If the gateway ever refuses a request, the plugin falls back to direct calls for an hour and tells you.
Embeddings (beta)
Turn the content you choose into vectors and keep them in a vector store, which the Site assistant, Related posts, the Link assistant, Member search and Search insights use. Off until you switch it on.
- You choose what goes in: post types (products and other custom types too), images, published and/or private content, which fields (title, content, excerpt, categories and tags, author, SEO description, custom fields), a date cut-off, and categories or tags to include or leave out. Any post can be left out from its editor, and password-protected content never goes in.
- You choose where it is stored: Cloudflare Vectorize on the same account (included in the Workers Free plan), a Qdrant server or Qdrant Cloud, or PostgreSQL with pgvector. Switching store later moves the vectors, at no neuron cost.
- It stays in sync: saving, trashing or deleting a post updates the vector store within about a minute; an unchanged save costs nothing.
- You see the cost first: an estimate of passages, neurons and storage before anything is sent. Embedding whoisabhi.com (166 posts and pages) took about 60 neurons, well inside one day’s allowance, with an Embeddings daily limit on top of the daily budget.
- Test search on the settings page, and
wp aipcf embedcommands for large sites.
The default model is BGE-M3 (multilingual, 1,024 dimensions).
What the embeddings are used for
Each tool is off until you switch it on, and each has a daily limit so one cannot use up what the others need.
- Site assistant (Cloudflare AI > Site assistant): a chat that answers from your posts and pages, cites them, and says when it cannot find the answer. For members you choose, or every visitor. Built-in guardrails plus your own rules, blocked topics and an optional safety check. Chats are saved only with consent. When its daily limit is used up, it goes offline.
- Related posts:
[aipcf_related], or added automatically (after the content, before it or after a paragraph). Lists are built in the background from the stored vectors: no neurons, nothing runs when a visitor opens a page. Each entry can say why it is related. - Link assistant (Cloudflare AI > Link assistant, for everyone who can edit posts): for a post, which posts it should link to and which should link back, with the exact word to link and the sentence it is in. A word is only suggested if it is really there. “Posts with no links to them” lists every post without internal links to it. A chat answers questions about the suggestions (“which two matter most?”). Nothing in your posts is changed.
- Member search:
[aipcf_search]finds posts by meaning, for logged-in members (you choose which roles), and can lead the site’s normal search results for them. Visitors who are not logged in get the normal WordPress search, so nobody outside can spend your neurons. Results only, no generated answers. - Search insights: what people search for on the site, which searches found nothing, and the content gaps: searches your posts do not answer well. “What to write next” groups the gaps into topics and suggests an article or a post to extend for each. No user, IP address or browser details are stored.
Editable prompts
Every prompt the plugin sends on its own behalf is on the Prompts tab, with placeholders, reset to default, and a test button that shows the result and its cost. Developers keep the aipcf_prompt filter.
The AI plugin (recommended)
AIPCF is the engine. The WordPress AI plugin adds the block-editor features that use it: excerpts, titles, meta descriptions, alt text on upload, summaries, image generation. It is recommended, not required; AIPCF’s own features (backfill, Embeddings and the content tools, usage tracking, daily budget, and aipcf_translate() for developers) work without it.
External Services
This plugin sends data to Cloudflare, Inc. to run AI inference on Cloudflare Workers AI. If you switch Embeddings on, it also stores content in the vector store you choose: Cloudflare Vectorize, a Qdrant server (yours or Qdrant Cloud), or your PostgreSQL database. Nothing is sent to any other third party, nothing is sent until you have entered your Cloudflare credentials, and nothing goes to a vector store until you switch Embeddings on and configure it.
What is sent, and when
- When an AI feature runs (you or another plugin ask for text, an image, a translation, or an image description): your API token, the model id, and the prompt (post title and content, messages, and any attached image data) go to
https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/v1/chat/completionsfor chat models, orhttps://api.cloudflare.com/client/v4/accounts/{account_id}/ai/run/{model}for image, vision and translation models. - When an AI Gateway name is configured, the same requests go to
https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway}/...instead, with request metadata attached: your site’s host name, the WordPress feature, the model id, the current user’s numeric ID and the plugin version. Cloudflare stores these in the gateway’s logs according to your gateway settings; the “Log prompts” option controls whether prompt and response text are stored there. - On a schedule, if you enable Backfill: the hourly job sends the title and content of posts that lack a meta description, and the image files (or their public URLs, read by the plugin) of attachments that lack alt text, to the endpoints above. This runs in the background until the backlog is done or Backfill’s daily limit is reached. It is off by default.
- Credentials checks: “Test connection” and the settings save send your Account ID and API token to
https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/models/search; the Connectors screen’s key validation sends the token tohttps://api.cloudflare.com/client/v4/user/tokens/verify. The model list is read from the models/search endpoint and cached for 12 hours. - Prompt tests and license re-checks on the settings page send one request on demand, as above.
- Embeddings, only when switched on (off by default): the text of the content you selected (title, content and the other fields you ticked, split into passages) goes to
https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/run/{embedding model}(or through your AI Gateway) to be turned into vectors. This happens once for existing content, then when selected content is saved, and within the Embeddings daily limit. The vectors are then written, with each passage’s text (unless “Store the text” is off) and its post ID, type, title, URL, publish date, language and a site ID, to the vector store you chose: - Embeddings stored in Cloudflare Vectorize:
https://api.cloudflare.com/client/v4/accounts/{account_id}/vectorize/v2/indexes/..., with your Cloudflare API token. - Embeddings stored in Qdrant: the URL you enter (a Qdrant Cloud cluster or your own server), with the API key you enter.
- Embeddings stored in PostgreSQL: the database server you enter, over the PostgreSQL protocol, with the user and password you enter.
- Member search, only when switched on and only for logged-in members: the words typed into
[aipcf_search](or the site’s search, if you let it lead) go to Cloudflare Workers AI to be embedded, then the vector store is queried. Cached for an hour per query. - Search insights, only when switched on: the searches recorded on your site are sent to Cloudflare Workers AI in the background, each distinct search once, to compare them with your content; “What to write next” sends the content-gap searches and the titles of your closest posts to your default model.
- Link assistant chat: the suggestions for the chosen post (titles, dates, shared words and quoted sentences from your posts) and the editor’s question go to your light model (or default model).
- Site assistant, only when switched on: the question is embedded and the vector store queried as above; then the question, up to ten earlier turns and the matching passages go to your default text model. With the safety check on, the question and answer also go to
.../ai/run/@cf/meta/llama-guard-3-8b. The asker’s name, account and IP address are not sent. - Cloudflare Turnstile, only in the Site assistant’s public mode and only if Simple Cloudflare Turnstile’s keys are set: once a day, the visitor’s browser loads
https://challenges.cloudflare.com/turnstile/v0/api.js, and your site sends the token with your secret key tohttps://challenges.cloudflare.com/turnstile/v0/siteverify. - Related posts sends nothing to Workers AI: it queries the vector store with vectors that are already there.
- Keeping the vector store in sync: deleting, trashing or unselecting content deletes its vectors there. Through an AI Gateway, embedding requests are sent with payload logging off (
cf-aig-collect-log-payload: false), whatever the “Log prompts” setting says. “Test connection”, “Create index”, “Test search” and “Delete vectors” contact the same vector store on demand, and Test search also embeds your query. Site Health reads the vector store’s status (cached for a minute).
The neuron meter and the monthly email (generated locally from stored totals) send nothing. Site Health sends none of your content: it only reads the model list and the vector store’s status, both cached.
Service provider
Cloudflare Workers AI and AI Gateway are provided by Cloudflare, Inc.
- Workers AI documentation: https://developers.cloudflare.com/workers-ai/
- AI Gateway documentation: https://developers.cloudflare.com/ai-gateway/
- Cloudflare Terms of Service: https://www.cloudflare.com/terms/
- Cloudflare Privacy Policy: https://www.cloudflare.com/privacypolicy/
- Vectorize documentation: https://developers.cloudflare.com/vectorize/
- Turnstile documentation: https://developers.cloudflare.com/turnstile/
- Turnstile privacy addendum: https://www.cloudflare.com/turnstile-privacy-policy/
Qdrant, used only if you choose it as the vector store, is open-source software; Qdrant Cloud is provided by Qdrant Solutions GmbH.
- Qdrant documentation: https://qdrant.tech/documentation/
- Qdrant Terms and Conditions: https://qdrant.tech/legal/terms_and_conditions/
- Qdrant Privacy Policy: https://qdrant.tech/legal/privacy-policy/
PostgreSQL with pgvector, used only if you choose it, runs on a database server you provide; no third party is involved beyond that server’s host. pgvector: https://github.com/pgvector/pgvector
Roadmap
- Answers written from your own content, for visitors, with the guards Member search has.
- Inserting a suggested internal link in one click, from the Link assistant.
- Speech-to-text (Whisper) for transcripts, and text-to-speech “listen to this post”.
- Per-site budgets on multisite sharing one gateway.
- WP-CLI commands for backfill, translation and usage (embeddings have them already).
Installation
- Install and activate the plugin. You land on Cloudflare AI, a new item in the admin menu.
- Add your Cloudflare API token on Settings > Connectors (WordPress 7.0+ manages provider keys there) and your Account ID on the Overview tab. The setup panel has the exact clicks for creating the token.
- Click Apply recommended defaults. That picks the models, turns on the daily budget and caching, and approves the connector.
- Optional: install the WordPress AI plugin for AI in the block editor, and enter an AI Gateway name on the AI Gateway tab for edge caching and logs.
wp-config.php constants (optional)
define( 'CLOUDFLARE_WORKERS_AI_ACCOUNT_ID', 'your-account-id' );
define( 'CLOUDFLARE_WORKERS_AI_API_TOKEN', 'your-api-token' );
define( 'CLOUDFLARE_WORKERS_AI_DEFAULT_MODEL', '@cf/google/gemma-4-26b-a4b-it' );
define( 'CLOUDFLARE_AI_GATEWAY_TOKEN', 'gateway-auth-token' ); // only for authenticated gateways
define( 'AIPCF_QDRANT_API_KEY', 'qdrant-api-key' ); // Embeddings stored in Qdrant
define( 'AIPCF_PG_PASSWORD', 'postgres-password' ); // Embeddings stored in PostgreSQL
Settings saved on the page take precedence over the constants. Environment variables with the same names are also read.
Screenshots

Overview: connection, today's neurons with the remaining-work estimate, gateway and backfill at a glance.

Setup panel after activation: connect, apply the recommended defaults, and the recommended AI plugin.

Models: default model with cost and capability labels, light model for short tasks, image model.

Budget & cache: the daily budget, what happens when it is reached, and caching.

A neuron receipt in the block editor after generating a meta description.

Backfill: backlog, progress and controls.

Prompts: every plugin prompt, editable, with a test button.

Site Health showing the Cloudflare Workers AI test.
Faq
Cloudflare Workers AI includes 10,000 neurons a day on every account, with no card on file. Measured on a live site, a meta description costs about 2 neurons and an alt text about 17, so a normal site never gets near the limit. Above the allowance Cloudflare bills per neuron at its published rate; the plugin’s daily budget is there so that does not happen by accident.
You choose: pause AI requests until midnight UTC, or switch text requests to the cheapest model on your account. Only text requests have a cheaper model: Backfill, Embeddings, Link assistant chat, the Site assistant, Member search, Search insights, image generation, image reading (alt text) and translation pause either way. Generated images count about 170 neurons each when Cloudflare does not report the figure. Either way you get an email at 80% and at 100%. The count resets at midnight UTC.
Start with the recommended defaults: Gemma 4 26B for writing and Granite 4 Micro for short tasks. They were picked by measuring output quality against neurons on real posts. Llama 3.3 70B writes a little better and costs several times more per token. The Models tab shows the neurons per 1,000 tokens for every model on your account, read from Cloudflare’s price list.
That is expected for some requests, and the Overview and Models tabs list the model for each one under “Current model setup”. Writing uses your default model. Short tasks (titles, excerpts, meta descriptions, alt text wording) use the light model if you set one; a model you pick for a feature in the AI plugin is used as picked. Anything that reads an image, such as alt text, uses the vision model, because text models cannot see images; on most accounts that is Llama 3.2 11B Vision, and you can pick another vision model on the Models tab. Generated images use the image model, translation uses M2M100 or IndicTrans2, and once the daily budget is used up text requests can switch to the cheapest model. The AI Gateway logs show which feature sent each request in the metadata field.
Not for AIPCF’s own features (backfill, Embeddings and the content tools, usage tracking, daily budget, and aipcf_translate() for developers). You need it for AI inside the block editor: excerpts, titles, meta descriptions, summaries, alt text on upload and image generation. Install it from wordpress.org; AIPCF registers itself as the provider.
Backfill, Embeddings, the content tools and the budget do, and so does aipcf_translate(). The in-editor buttons come from the WordPress AI plugin and need the block editor.
To Cloudflare. When a feature runs, the post title and content (or the image) go to Cloudflare Workers AI on your own account. Nothing is sent until you enter your credentials, and the External Services section below lists every endpoint. With an AI Gateway you decide in the Cloudflare dashboard whether prompts are logged.
If you switch Embeddings on, the content you selected is also stored, with its embeddings, in the vector store you chose: Cloudflare Vectorize on your account, your Qdrant server or Qdrant Cloud cluster, or your PostgreSQL database. Nothing else receives it. Embedding requests go through your AI Gateway (when you use one) with payload logging off, so the gateway’s logs never hold a copy of your content. Author names are embedded only if you tick “Author name”, and change in the vector store when a name changes or a user’s posts are reassigned.
On WordPress 7.0+ it lives in the core Connectors screen (Settings > Connectors), like every other AI provider key. You can also define it as a constant in wp-config.php. The plugin never sends it anywhere except Cloudflare.
An embedding is a list of numbers that captures what a piece of text is about, so text with a similar meaning gets similar numbers. Kept in a vector store, they let a site find posts by meaning instead of by keyword (“how much does it cost” finds the pricing page) and suggest truly related posts. AIPCF uses them for Related posts, the Link assistant, Member search and Search insights.
Cloudflare Vectorize if you want nothing else to run: it uses the same Cloudflare account and token (add the permission Account > Vectorize > Edit), and the Workers Free plan stores about 4,900 passages at 1,024 dimensions, enough for a few hundred posts. Bigger sites need Workers Paid ($5 a month, 10 million stored dimensions included). Qdrant if you already run it or want Qdrant Cloud’s free 1 GB cluster. PostgreSQL with pgvector if you have such a database; your host’s PHP needs the pdo_pgsql extension, which many do not enable (the settings page tells you).
Yes, without paying again. Pick the new store on the Embeddings tab (set up its connection first) and save: the vectors are copied from the old store, not embedded again, so it costs no neurons. Related posts and search keep using the old store until the move is done, and you can cancel it. Afterwards the Embeddings tab offers to delete what is left in the old store. Posts edited since they were embedded, and a change of embedding model, do need new embeddings. From WP-CLI: wp aipcf embed move qdrant.
With BGE-M3, about 1,070 neurons per million tokens. Cloudflare reports no usage for embeddings, so the plugin estimates it from text length and shows it with a “~”. A typical blog post of 2,000 characters costs under 1 neuron; a 150-post blog about 60. The Embeddings tab estimates your site before you start, and Embeddings has a daily limit.
Switch Embeddings off to stop sending anything. “Delete vectors” on the Embeddings tab switches it off and deletes this site’s vectors from the vector store (the whole index when it is the site’s own, only this site’s entries when the index is shared). Resetting or deleting the plugin removes its own tables and settings but never deletes anything in the vector store, so use “Delete vectors” first if you want them gone.
No. It only fills empty fields. Posts that already have a meta description and images that already have alt text are never touched. It writes to the meta key of your SEO plugin (Yoast, Rank Math, AIOSEO or SEOPress), so you can edit the result where you always do.
Switch off Backfill (“Run hourly”) on the Backfill tab and it stops after the current batch. Descriptions it wrote are ordinary post meta; edit or clear them like any other. The tab shows the last skipped item, with “Retry skipped items” to try skipped items again.
No. Requests only happen when a feature runs, and the backfill runs in the background through WP-Cron, one batch an hour. Visitors never wait on Cloudflare.
Yes, and many people do. Keep in mind the 10,000-neuron allowance is per Cloudflare account, not per site, so set each site’s daily budget to a share of it. An AI Gateway shows the usage of all sites in one place.
Yes. The Prompts tab holds every prompt the plugin sends on its own behalf, with placeholders and a test button. Developers can also use the aipcf_prompt filter.
This is Meta’s license for its Llama models, not a license of this plugin. Cloudflare will not run some Meta models (Llama 3.2 Vision) on your account until Meta’s Llama Community License and Acceptable Use Policy have been accepted once, and Cloudflare keeps the record of that acceptance. AIPCF has no license of its own to accept: it shows a notice with Meta’s terms and an “Accept Meta’s license and send it to Cloudflare” button, which sends it with your own token. A curl command is included if you prefer to send it yourself.
WordPress asks administrators to allow each AI connector once. “Apply recommended defaults” does it for you; otherwise go to Tools > Connector Approvals and allow Cloudflare Workers AI there.
The plugin waits up to 60 seconds. 70B-class and reasoning models can take longer on a cold start. Raise the limit with the aipcf_request_timeout filter or pick a smaller model.
Qwen3, GLM and GPT-OSS spend tokens thinking before they answer. The plugin turns thinking off by default where the model allows it and applies a 2,048-token output limit when the caller sets none. If you still see empty answers, raise max_tokens or pick a non-reasoning model.
“Reset plugin” at the foot of the About card deletes the plugin’s settings, including the credentials saved in them, your prompt edits, usage history, backfill progress, caches, embeddings tracking, the Link assistant’s data, logged searches and the “What to write next” analysis, and the Related lists. It keeps what the plugin wrote into your posts (meta descriptions, alt text), the posts you left out of Embeddings and the images you marked decorative. Credentials set in wp-config.php or environment variables are not touched.
Reset does not touch the vector store: vectors already there stay, and “Delete vectors” on the Embeddings tab deletes them. Use it before Reset if you want them gone.
Deleting the plugin from the Plugins screen does the same cleanup and also removes the Embeddings exclusions and decorative marks, on every site of a network. The API token on Settings > Connectors is WordPress’s own setting: remove it there.
Related posts: no neurons (lists come from stored vectors); one vector store query per post when its list is built. Member search: about 0.03 neurons per search, one vector store query, cached for an hour. Search insights: about 0.03 neurons per distinct search compared, and one request to your default model when you ask “What to write next”. The Link assistant’s suggestions are free; each chat message is one short request to your light model. Each tool has a daily limit in Cloudflare AI > Settings > Content tools. On the Vectorize free plan (30 million queried dimensions a month, about 29,000 queries), Site Health warns when the month’s queries are heading past it.
Each question is one search (about 0.03 neurons) and one answer from your default text model, typically 10 to 30 neurons; the optional safety check adds a small Llama Guard request per question and per answer. It has its own daily limit on the Budget tab, and visitors (if you let them in) get only a share of it and a number of questions each per day. Chats are stored in your database only when the person ticks “save this chat”: their name (no email), the questions, the answers and the posts cited. Administrators see them under Cloudflare AI > Site assistant, with a CSV download. They are deleted after 90 days (adjustable), are covered by WordPress’s personal data export and erase tools, and the suggested privacy-policy text describes them. Visitors’ IP addresses are never stored: the daily count uses a one-way key that changes every day.
Administrators, under Cloudflare AI > Search insights. For each search: the text, when, how many results, the best match and whether the searcher was logged in. No user account, IP address or browser details. Bots are skipped, a repeat by the same visitor within an hour counts once, rows are capped each day, and searches are deleted after 90 days (adjustable). Off by default; the suggested privacy-policy text covers it.
Yes; settings and usage history carry over both ways. Versions before 1.9.0 do not know about Embeddings, so they do not follow edits meanwhile; when 1.9.0 or later is back, it checks every item again and catches up (unchanged content costs nothing). The same happens after the plugin has been deactivated. Deleting the plugin while an earlier version is installed leaves the data added in 1.9.0 behind (tables, options and post meta for Embeddings and the Content tools). The same goes for the activity log added in 1.10.0 and the saved chats added in 1.11.0. Reinstall the latest version and delete it again to remove everything.
Any feature or plugin built on the WordPress AI Client uses Cloudflare Workers AI once the plugin is configured. Direct calls:
use WordPress\AiClient\AiClient;
// Uses the model chosen in Settings.
$result = AiClient::prompt( 'Summarize this post in two sentences.' )
->usingProvider( 'cloudflare-workers-ai' )
->generateTextResult();
echo $result->toText();
// A specific model:
$model = AiClient::defaultRegistry()->getProviderModel( 'cloudflare-workers-ai', '@cf/qwen/qwen2.5-coder-32b-instruct' );
$result = AiClient::prompt( 'Write a PHP function that slugifies a string.' )->usingModel( $model )->generateTextResult();
// Translation:
echo aipcf_translate( 'Good morning', 'mr' ); // Marathi via IndicTrans2
echo aipcf_translate( 'Bonjour', 'en', 'fr' ); // any pair via M2M100
Structured output and tools use the standard AI Client API: ->asJsonResponse( $schema ) and ->usingFunctionDeclarations( ... ).
wp aipcf embed status [–store] # embedded, waiting, failed; the vector store’s own count
wp aipcf embed estimate # passages, tokens, neurons and storage for the selection
wp aipcf embed run –until-done # embed everything now (large sites); resumable
wp aipcf embed search “query” # test a search
wp aipcf embed reconcile | retry | rebuild | purge
wp aipcf embed move [–index=] # copy the vectors to another store, no neurons
wp aipcf embed move –status | –cancel
wp aipcf embed cleanup-old # delete what a move left in the old store
run, `reconcile` and `rebuild` refuse to work while Embeddings are switched off.
wp aipcf related refresh [--all] # build related lists now
wp aipcf related show 123 # a post's list with scores
wp aipcf activity list [--tool=backfill] [--failed] # recent entries
wp aipcf activity export --file=activity.csv # the same CSV as Download CSV
[aipcf_related count=”5″ title=”Related posts” heading=”h2″ excerpt=”no” thumbnail=”no”]
[aipcf_search placeholder=”Search by meaning” results=”10″]
count is 1 to 12 (default: the Content tools setting, 5), `heading` is h2, h3, h4 or p, and only posts at least as similar as the "Minimum similarity" setting (default 0.55, a 55% match) are listed. `results` is 1 to 20. Related posts outputs a `<nav class="aipcf-related">` list and Member search a `<form class="aipcf-search">` with an `<ol class="aipcf-search__list">`; both take the theme's styles.
aipcf_prompt( $text, $key, $vars ): final say on any plugin-owned prompt.aipcf_route_text_model( $model, $requested, $task ): override which model serves a request.aipcf_available_models( $models ): adjust the model list before it is cached.aipcf_request_timeout( $seconds, $model ),aipcf_default_max_tokens,aipcf_disable_thinking,aipcf_system_instruction_suffix.aipcf_gateway_headers( $headers, $task, $model ),aipcf_gateway_metadata,aipcf_gateway_enabled.aipcf_over_budget,aipcf_cheapest_model,aipcf_local_cache_ttl,aipcf_regenerate_window.aipcf_backfill_meta_description_key,aipcf_backfill_alt_prompt,aipcf_vision_model.aipcf_image_neurons_estimate( $neurons, $model ),aipcf_translation_neurons_per_1k( $rate, $model ): what to count when Cloudflare reports no neurons;aipcf_vision_byte_array_max( $bytes ).- Embeddings:
aipcf_embed_should_index( $bool, $post ),aipcf_embed_text( $text, $post ),aipcf_embed_metadata( $metadata, $post ),aipcf_embed_post_types( $types ),aipcf_embed_locale( $locale, $post ),aipcf_embedding_models( $models ),aipcf_vector_store( $store, $id, $index )(supply your own store),aipcf_vectorize_token( $token ).
Actions: aipcf_usage_recorded, aipcf_cache_hit, aipcf_gateway_marked_down, aipcf_backfill_meta_description, aipcf_backfill_alt_text, aipcf_defaults_applied, aipcf_model_licence_accepted( $model, $owner ) (after Cloudflare confirms your acceptance of a model publisher’s license, such as Meta’s).
REST (users who can edit posts): GET /wp-json/aipcf/v1/last (last request’s receipt), GET /wp-json/aipcf/v1/usage (today’s totals).
No. The AI Client arrives in WordPress 7.0; the plugin does nothing on older versions.
Reviews
Changelog
1.11.2
- Fixed: with the WordPress AI plugin’s connector approvals (AI 1.3.0), Site Health said the token was not answering when the real problem was that this plugin had not been approved, which blocks every AI feature. It now says so first, as critical, and points to Tools > Connector Approvals.
1.11.1
- Fixed: the Site assistant page’s usage bar stayed empty whatever the day’s use; it now fills (amber from 80%, red at 100%).
- Fixed: the Site assistant page said “A chat for logged-in members” when the assistant was open to every visitor.
1.11.0
- New: Site assistant (Cloudflare AI > Site assistant), a chat for logged-in members that answers questions from your own posts and pages. It finds the passages that match, answers from them with your default text model, cites and links the posts it used, and says when it could not find the answer instead of guessing (no model call then). A chat button in the corner of every page and a panel on the wp-admin Dashboard. Off by default; needs Embeddings.
- New: follow-up questions (“without coconut oil?”, “the second one”) stay on the posts the previous answer cited, and list questions get a wider choice of posts (at most two passages from one post).
- New: its look and words are yours, with a live preview: name, subtitle, an emoji avatar, colour, left or right, a welcome message that greets members by first name, up to three starter questions, the “no answer” reply and the offline reply.
- New: before the first question it asks for a name (no email) and whether to save the chat. Saved chats (only with consent) are listed on the page with the questions it could not answer, downloadable as CSV, kept 90 days by default, and covered by WordPress’s personal data export and erase tools.
- New: public mode. The assistant can answer every visitor, not only members. Visitors get their own share of the assistant’s daily limit (half by default) and a number of questions each per day (20 by default); bots and spam-form fillers are turned away, and with Simple Cloudflare Turnstile set up, a visitor passes a Turnstile check once a day. Works on cached pages.
- New: guardrails, on their own tab. The built-in rules are always on and listed there: answers only from your posts, text in posts and chats treated as data (an instruction hidden in a post is not followed), no links, no personal data asked for. On top, add your own rules, block topics or words with your own reply (a blocked question never reaches the AI), turn on a safety check of questions and answers with Llama Guard on Workers AI (counted in the assistant’s limit), choose the answer length and edit the note under the chat.
- New: the assistant has its own daily limit on the Budget tab. When that limit or the daily budget is used up, the chat goes offline with your message and takes no questions until midnight UTC.
- New: switching vector stores (Vectorize, Qdrant, PostgreSQL) moves the vectors instead of embedding everything again: they are read from the old store and written to the new one, with their metadata rebuilt from the posts, so the move costs no neurons. Only posts edited since, or vectors missing from the old store, are embedded again.
- New: related posts, Member search, Search insights, the Link assistant and Test search keep using the old store until the move is done, so nothing goes missing while it runs. The Embeddings tab shows the progress, and “Cancel move” goes back (what was copied is copied back, also free).
- New: before saving another store, the Embeddings tab says how many posts and vectors will move and that it is free; with a new model too, it says everything is embedded again and what that costs.
- New: after a move, the Embeddings tab offers to delete what is left in the old store (the whole index when it was this site’s own, only this site’s vectors from a shared one), or to keep it.
- New:
wp aipcf embed move <store>,--status,--cancelandwp aipcf embed cleanup-old. - New: related posts “Add automatically” (was “After post content”) can put the list after the content, before it or after a chosen paragraph, on the post types you tick. A post with the [aipcf_related] shortcode keeps its own list, so there are never two.
- New: related lists can say why each post is in them: the tags and categories the two posts share (“Also about Malcolm Gladwell and Success”), or how close in subject they are. No AI is used. Content tools, Show, “Why it is related”, or
why="yes"on the shortcode. - New: the related list’s title, title size, excerpt and featured image are settings on the Content tools tab; the shortcode’s attributes still override them.
- Fixed: after a big Embeddings run, related lists were only worked out in the time left over by the hourly run, so hundreds of posts waited for hours. While lists are waiting, the next run now comes in a few minutes (still within the daily query limit).
- Fixed: during a rebuild, related posts and search used the new index while it filled; they now keep using the old index until the new one is complete (when the model is unchanged).
- Fixed: pointing the vector store at another server with the same collection or table name (a new Qdrant URL, PostgreSQL host or database) left the new server empty; everything is now embedded again there, and the Activity log says why.
- Changed: Activity filters update the list without reloading the page, and so do its page links; the address keeps the filters.
- New: Activity shows how much room the log takes in the database, and a Clear log button deletes it (download the CSV first to keep a copy).
- Changed: an Activity entry’s items read in two columns, the item with its field and the text before and after, then the result. A skipped item reads “Not changed”, since nothing was sent to the AI.
- Changed: “People” is now “Users” in Activity.
- New: Embeddings count the words of each post. The status and the estimate show the total, and a new “Shortest post” setting under What to embed leaves out posts and pages under a number of words (off by default); they also drop out of related posts.
- Changed: the Translation row in “Current model setup” shows only when a theme or plugin used
aipcf_translate()in the last 30 days; AIPCF has no translation screen of its own. - Changed: on the Overview, the shortcuts sit right under the status boxes, and the model table moves to the bottom, renamed “Current model setup” (also on the Models tab).
1.10.0
- New: Cloudflare AI > Activity (administrators only): what people did in the plugin and what the plugin did on its own. Settings saved (each changed setting, old and new; tokens and passwords never), setup, Reset, every tool’s buttons with their outcome, Backfill batches, Embeddings runs, the daily budget reached, AI Gateway outages and the monthly report.
- New: each Backfill batch lists every post and image it changed, with the field, the text before and after, and why an item was skipped.
- New: Download CSV of what the filters show (who, tool, dates, failures only), one row per change;
wp aipcf activity listandwp aipcf activity export. - New: entries are kept 90 days by default (30 days, 1 year or forever on the Activity screen). Reset and deleting the plugin delete the log; a deleted user’s entries stay without the user. The suggested privacy-policy text mentions the log.
1.9.0
- Changed: requires PHP 8.2 or newer (7.4, 8.0 and 8.1 are end of life). Sites on older PHP keep their current version until PHP is upgraded.
- New (beta): Embeddings. Choose what content to embed (post types, images, statuses, fields, custom fields, date, categories and tags, per-post opt-out) and where to keep the vectors: Cloudflare Vectorize, Qdrant or PostgreSQL with pgvector. The vector store follows every save, trash and delete; unchanged saves cost nothing.
- New: an estimate of passages, neurons, days and storage (against the Vectorize free plan) before anything is sent, a separate daily limit for Embeddings, and embedding neurons in the usage report (estimated, marked “~”).
- New: status panel with Run one batch now, Keep going until done, Re-check selection, Retry failed items, Rebuild and Delete vectors; Test search; a Site Health test and debug information for embeddings.
- New:
wp aipcf embed status | estimate | run --until-done | reconcile | retry | rebuild | purge | search. - New: suggested privacy-policy text under Settings > Privacy.
- New: Related posts,
[aipcf_related]or after the content, built in the background from stored vectors: no neurons, nothing runs on page views. - New: Cloudflare AI > Link assistant: internal-link suggestions with the exact word and sentence for each link (never made up), links back, posts with no links to them, and a chat about the suggestions.
- New: Member search,
[aipcf_search], by meaning, for logged-in members; optionally leads the site’s search results for them. Visitors keep the normal search. - New: Cloudflare AI > Search insights: top searches, searches that found nothing, content gaps, and “What to write next” suggestions. Off by default; no personal data stored.
- New: each tool has a daily limit; the admin-bar tooltip splits today’s neurons by feature, and Site Health warns when Vectorize queries are heading past the free plan.
- New: the Budget & cache tab shows the daily budget and how it is shared: each tool’s daily limit and today’s use, a warning when the tools’ limits add up to more than the daily budget (also when saving any tab), and an alert when today has used up the budget or, with no budget set, gone past the free daily allowance.
- Changed: the Link assistant sits in the plugin’s own menu (Cloudflare AI > Link assistant), next to Settings; editors and authors see only the Link assistant there.
- Changed: a softer page background on the plugin’s screens.
- Fixed: messages after saving settings (“Settings saved.”, the credentials test result) were not shown on the plugin’s page.
- Changed: the token instructions mention the Vectorize permission, needed only for Embeddings on Vectorize.
- Changed: the Site Health test checks that Cloudflare accepts the saved token and Account ID (through the cached model list, no neurons), instead of only that both are filled in.
- Changed: the admin-bar counter says “free” next to 10,000 when no daily budget is set, and turns amber, not red, past it.
- Changed: Reset keeps the posts left out of Embeddings and the images marked decorative.
1.8.14
- New: “Which model answers what” on the Overview and Models tabs. Writing, short tasks, reading images, generating images, translation and the over-budget fallback each list the model that actually answers, so the AI Gateway logs hold no surprises.
- New: a Vision model setting. Alt text and image reading always use a vision model (Llama 3.2 11B Vision on most accounts), never your default text model; this is now said on the Models and Backfill tabs.
- New: one click to accept Meta’s licence for Llama 3.2 Vision. The licence is Meta’s, not this plugin’s; Cloudflare records the acceptance and the plugin only sends it. Replaces the Playground step, which did not work.
- Changed: a model you pick for a feature in the AI plugin is used as picked, instead of being swapped for the light model.
- Changed: the “Test gateway” button uses your default model instead of Llama 3.2 1B.
- Changed: over the daily budget, image generation, image reading and translation pause even on “switch to the cheapest model”, since none has a cheaper model. Generated images and IndicTrans2 translations now count towards the budget.
- Changed: backfill retries an item up to three times after a temporary error instead of skipping it, and marks decorative images as done so they are not paid for again.
- Changed: saved API and gateway tokens are no longer shown in the settings page; leave the field blank to keep them, or tick “Remove the saved token”.
- Fixed: saving a customised prompt crashed the site.
- Fixed: the backfill left the cron process logged in as an administrator.
- Fixed: image prompts failed with a gateway dynamic route and switched the gateway off for an hour.
- Fixed: two backfill batches could run at once; progress was lost on a PHP timeout; “Run one batch now” repeated the previous run’s message.
- Fixed: a slow model through the gateway was sent twice; a failed model-list fetch was retried on every request; usage counts could be lost under load.
- Fixed: deactivating left the cron jobs scheduled; uninstall cleaned only one site on multisite; “Reset plugin” flushed a shared object cache, and now clears cached answers and receipts on sites with Redis or Memcached without touching anything else.
1.8.13
- Fixed: “Run one batch now” did nothing while the hourly backfill switch was off, and said nothing either. It now runs regardless and reports what it filled, skipped and what is left.
- Removed a leftover check that made the backfill depend on the Abilities API; it has used its own prompts since 1.7.
1.8.12
The first update since 1.0.3. If you are coming from 1.0.3, this is what changed:
- Your credentials and model choice are kept. The settings page has moved from Settings to its own “Cloudflare AI” menu; old links redirect. A setup panel offers the recommended defaults (Gemma 4 26B for writing, Granite 4 Micro for short tasks, a daily budget guard, caching); nothing is applied until you click.
- Requests use Cloudflare’s OpenAI-compatible endpoint, so newer model families (Gemma 4, GPT-OSS, Qwen3, GLM, Granite) work, and the “Missing result.response” failures of 1.0.x are gone.
- The model list is read from your account with context, cost in neurons and capability labels, refreshed every 12 hours.
- New since 1.0.3: neuron usage tracking with a daily budget guard and emails; a receipt in the editor after every AI action and today’s total in the admin bar; Cloudflare AI Gateway support with edge caching and analytics; light-model routing for short tasks; response caching; image generation; translation; hourly backfill for missing meta descriptions and image alt text; editable prompts; a monthly usage email; a Site Health test; “Reset plugin”.
- The settings screen was redesigned: sidebar navigation, section cards, switches, one line of help per field with a “Why?” link, advanced fields hidden until asked for.
- Fixed along the way: the configured default model was not first in the provider’s list; text sent as content parts broke Llama; a 5-second request timeout; Meta licence gates were opaque; vision requests failed on the OpenAI-compatible endpoint; “Regenerate” returned the cached answer; edge cache hits were counted at full cost.
1.7.8
- New: Prompts tab. Every prompt the plugin sends on its own behalf is editable, with placeholders, reset and a test button.
- New: meta-description backfill no longer needs the WordPress AI plugin. The AI plugin is recommended with an install link, not required.
- New: Models tab shows how many models were read from the account and when, with a “Refresh now” link.
- Fixed: “Regenerate” in the editor returned the cached answer. A repeat of the same request within ten minutes now bypasses the local and gateway caches.
- Fixed: editor receipts were fetched after every abilities request instead of only after a run.
- Changed: the “Try it” hint names a feature that is actually on; usage labels read “Other (direct API calls)” and “Backfill: meta description”.
- Code passes the WordPress security and i18n sniffs; 78 integration tests on the WordPress test framework.
1.6.0
- New: two-step setup after activation with one-click recommended defaults and a token walkthrough.
- New: neuron receipts in the block editor after every AI action, and today’s total in the admin bar.
- New: monthly usage email on the 1st.
- New: Site Health test.
1.5.0
- New: tabbed settings with an Overview (status cards, today’s neurons, quick actions).
1.4.8
- New: image generation (FLUX.1 schnell, SDXL, DreamShaper, Leonardo) registered with the AI plugin’s image features.
- New: translation via M2M100 and IndicTrans2,
aipcf_translate(). - New: hourly backfill for missing meta descriptions and image alt text, with its own daily budget, failed and decorative markers, and support for offloaded media read by URL.
- New: vision requests go through Cloudflare’s native endpoint with a system message, which the OpenAI-compatible endpoint rejects for images.
- New: Meta licence gates are detected and explained with a re-check button.
- Fixed: responses served from the AI Gateway edge cache were counted at full cost; a model-level 403 no longer triggers the gateway bypass.
1.3.0
- New: light-model routing for short tasks (titles, excerpts, meta descriptions, moderation, alt text).
- New: local response cache for deterministic requests.
- New: “Never fall back to paid providers”.
1.2.0
- New: Cloudflare AI Gateway support with edge cache TTL, request metadata, prompt-logging toggle, authenticated gateways, dynamic routes and automatic direct fallback.
- New: neuron usage tracking per day, feature and model, with a daily budget guard and 80%/100% emails.
1.1.2
- Changed: requests use Cloudflare’s OpenAI-compatible endpoint, so new model families work without a plugin update.
- New: the model list is read live from the account, grouped by vendor, with context, cost and capability labels.
- Fixed: the configured default model was not the first in the provider’s list; text content sent as parts broke Llama; a 5-second request timeout; model caches not cleared after upgrades.
1.0.0
- Cloudflare Workers AI registered as a provider for the WordPress AI Client.