Drupal is a registered trademark of Dries Buytaert

Cloudflare Workers AI Integration for Drupal

Seamlessly integrate Cloudflare Workers AI into your Drupal website with this powerful module. Leverage serverless AI capabilities for real-time text generation, image classification, audio transcription, and more — directly from your Drupal interface.

This module is part of the AI ecosystem and enables your Drupal site to connect to Cloudflare Workers AI, a fully serverless platform offering 50+ free AI models with automatic scaling, no infrastructure overhead, and lightning-fast performance.

Features

  • Access over 50+ free AI models via Cloudflare Workers AI
  • Enhance your Drupal site with cutting-edge artificial intelligence using AI-powered capabilities:
    • Embeddings
    • Speech to Text
    • Chat (text generation)
    • Image Classification
    • Translate Text
    • Moderation
    • Chat with Complex JSON

    • ...and several other AI-powered features!
  • Deep Drupal integration via the AI module
  • Easy API setup using your Cloudflare credentials
  • Developer-friendly: extendable hooks and services for custom AI logic
  • Serverless architecture — no infrastructure to manage or scale
  • Fully integrates with Drupal via the AI ecosystem
  • Simple API setup — just add your Cloudflare credentials
  • Extendable hooks and services to use AI results programmatically
  • No need to run your own models — inference happens at the edge with zero server overhead

Requirements

  • Creative Mind
  • Drupal 10.1 or higher
  • PHP 8.1+
  • AI module installed and enabled
  • A valid Cloudflare account and API token with Workers AI access

Post-Installation

Install the Cloudflare Workers AI Provider module using Composer:

  • Now Setup the Workers Ai Key, Base URL and Cloudfare Account ID
  • Select models for your desired category in AI Default Settings
  • Chat with Workers Ai in Chat Generation Explorer

Setup

Getting Cloudflare credentials:

  • Login/Create account in Cloudflare Dashboard
  • Now pay attention to the URL in your address bar, it will be something like https//dash.cloudflare.com/{YOUR_ACCOUNT_ID}/home/.... Copy that {YOUR_ACCOUNT_ID} from the URL and save it somewhere.
  • Click on the profile icon in the top right and go to Profile → API Tokens
  • Click on Create Token button
  • Click on Use Template button next to Workers AI
  • In Account Resources dropdown, select All accounts and leave all other options as default.
  • Click on Continue to summary button.
  • Review your settings and click on Create Token button.
  • Your API token is generated — copy it and save it somewhere, as you won’t be able to see it again. You’ll also get a cURL request to test your token. Verify it to ensure everything works as expected. Your Cloudflare Base URL is https://api.cloudflare.com, save that too.

Additional Requirements

  • AI — Base module that enables AI integrations in Drupal

Similar Projects

  • OpenAI — Paid API integration with fewer free models and higher latency

Supporting this Module

Maintained by the open-source community. Contributions, bug reports, and feature requests are welcome on Drupal.org or GitHub.

Community Documentation

Setup guides and usage examples are available in the README.md file included with the module.

Activity

Total releases
3
First release
May 2025
Latest release
9 months ago
Release cadence
3 days
Stability
67% stable

Release Timeline

Releases

Version Type Release date
1.0.1 Stable May 20, 2025
1.0.0 Stable May 14, 2025
1.0.x-dev Dev May 14, 2025