BACK TO DIRECTORY

AIPCF – AI Provider for Cloudflare

by Abhishek Deshpande

0.0
(0 ratings)

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 daily allowance of 10,000 neurons, and a budget guard 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: an hourly backfill fills missing meta descriptions (Yoast, Rank Math, AIOSEO, SEOPress) and image alt text, a batch at a time, within its own daily budget. 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 e-mail 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

  1. A Cloudflare account. No credit card is needed for the Workers AI daily allowance.
  2. An API token created from the “Workers AI” template at dash.cloudflare.com/profile/api-tokens.
  3. 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, the 10,000-neuron daily guard, no paid fallbacks, caching on.
  • Daily budget guard: e-mail at 80%; at 100% either pause until midnight UTC or switch to the cheapest model instead of failing.
  • 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: one test that goes amber only for things that need you: not connected, connector unapproved, a licence gate, the gateway bypassed, the 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: Llama 3.2 11B Vision reads inline and remote 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.

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, translation, usage tracking, budget guard) work without it.

Usage

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( 'Summarise 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( ... ).

Filters

  • 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.

Actions: aipcf_usage_recorded, aipcf_cache_hit, aipcf_gateway_marked_down, aipcf_backfill_meta_description, aipcf_backfill_alt_text, aipcf_defaults_applied.

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).

External Services

This plugin sends data to Cloudflare, Inc. to run AI inference on Cloudflare Workers AI. Nothing is sent to any other third party, and nothing is sent until you have entered your Cloudflare credentials.

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/completions for chat models, or https://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 Bulk 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 the daily backfill budget 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 to https://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 licence re-checks on the settings page send one request on demand, as above.

Nothing is sent by the neuron meter, the monthly e-mail (generated locally from stored totals), or Site Health.

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/

Roadmap

  • Semantic search and related posts on Cloudflare embeddings, as a companion plugin with pluggable vector stores.
  • 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.

Screenshots

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

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.

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.

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

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

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

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

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

Backfill: backlog, progress and controls.

Backfill: backlog, progress and controls.

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

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

Site Health showing the Cloudflare Workers AI test.

Site Health showing the Cloudflare Workers AI test.

Plugin Details

Active Installs
0
Total Downloads
358
Version
1.8.13
Requires WP
7.0
Requires PHP
7.4
Tested Up To
7.1
Added
2026-05-29
Last Updated
2026-09-14 3:12pm GMT

Ratings

5
0
4
0
3
0
2
0
1
0