Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Workflow Modeler 1.0.9 Minor update available for module modeler (1.0.9). Release: Vite 1.5.6 Minor update available for module vite (1.5.6). Release: Mautic Audiences 1.1.0 Minor update available for module mautic_audiences (1.1.0). Release: Freja eID for Drupal 1.0.2 Minor update available for module freja_eid (1.0.2). Release: FileGate 1.10.1 Minor update available for module file_gate (1.10.1). Release: MCP Sentinel 2.23.0 Minor update available for module mcp_sentinel (2.23.0). Release: Synapse helper module 3.0.9 Minor update available for module synhelper (3.0.9). Release: Synapse helper module 3.0.8 Minor update available for module synhelper (3.0.8). Module Revived: Decorative Images 1.3.6 Module decorative_images updated after 7 months of inactivity (1.3.6). Security Coverage: Pixie Dark Theme pixie_dark now has official Drupal security advisory coverage.

Cloudflare AI Gateway Provider

No security coverage

Part of the AI ecosystem · 308 projects

View on drupal.org

This module provides a single connection to Cloudflare's AI Gateway, allowing your Drupal site to access various AI models from different providers like OpenAI, Anthropic, and Google. It leverages the gateway's caching, logging, and cost analytics, and centralizes billing and API key management through Cloudflare instead of storing them in Drupal.

One Drupal AI provider that reaches every model a Cloudflare AI Gateway fronts (OpenAI, Anthropic, Google, Workers AI and more), with the gateway's caching, logging and cost analytics.

The AI module is how Drupal connects to AI services. This provider points it at a single Cloudflare AI Gateway, so every AI feature in your site (the Explorer, Automators, Chatbot, AI Search and more) can use any model the gateway offers, all through one connection.

With unified billing on the gateway, you do not need a separate API key for each vendor: Cloudflare bills your account directly and every model is available. If you prefer, you can bring your own provider keys, held in the gateway rather than in Drupal. Either way, no provider key is stored in your Drupal site.

Features

  • One provider for every model the gateway fronts, instead of installing a separate provider module for each vendor.
  • Chat (including streamed responses) and embeddings, available to every part of the AI module.
  • The gateway's caching, request logging and cost analytics, applied across all upstream models.
  • Per-request gateway controls: bypass the cache, and attach metadata — with the operation type and any tags — so requests are filterable in the Cloudflare dashboard.
  • A model picker that filters the gateway's live model catalogue by provider and shows each model's price per million tokens, so you choose exactly which models to expose.
  • Cloudflare Dynamic Routing: name a route as dynamic/<route> to use its multi-provider fallback and retries as a model.
  • Credentials (account ID and token) live in settings.php, never in configuration or the database.

Use it when you want one place to manage models, spend and observability across several AI vendors, or when you want Cloudflare's caching and analytics in front of your AI calls.

Post-Installation

After enabling the module:

  1. In the Cloudflare dashboard, create an AI Gateway and an API token for it. Note your account ID and the gateway slug.
  2. Add a credential set at Configuration > Web services > Cloudflare credentials, giving it a machine name. Put its account ID and token in settings.php, keyed by that machine name:
    $settings['cloudflare']['credentials']['my_gateway'] = [
      'account_id' => 'your-account-id',
      'token' => 'your-token',
    ];
  3. Add a gateway at Configuration > Web services > Cloudflare AI Gateways, setting its slug and selecting the credential set.
  4. Go to Configuration > AI > Providers > Cloudflare AI Gateway, select the gateway, and choose the chat and embeddings models to expose. Filter by provider to find models in the gateway's live catalogue, where each model's price per million tokens is shown.

The models you select become available to every AI feature that uses this provider.

Additional Requirements

This module requires the AI module, the Cloudflare AI module and the Cloudflare SDK module. Installing with Composer pulls in all of them:

composer require drupal/ai_provider_cloudflare_gateway

While the suite is in alpha, require it as drupal/ai_provider_cloudflare_gateway:^1.0@alpha (or set your project's minimum-stability to alpha) so the pre-stable releases resolve. You also need a Cloudflare account with an AI Gateway configured.

Any module in the AI ecosystem benefits from this provider, since they route their requests through it. Examples include AI Chatbot, AI Search and AI Automators, all submodules of the AI module.

Similar projects

Single-vendor providers such as OpenAI Provider and Anthropic Provider connect the AI module to one vendor each. This provider instead fronts many vendors through a single Cloudflare AI Gateway, and adds the gateway's caching, cost analytics and fallbacks across all of them. Use a single-vendor provider if you only need one vendor and no gateway; use this one to consolidate several vendors, billing and observability behind one connection.

Supporting this Module

Issue reports, patches and feedback are welcome in the project's issue queue.

Community Documentation

Documentation for the Drupal AI module is available at project.pages.drupalcode.org/ai.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
7
Tracked since
Jun 2026
Latest release
2 months ago
Releases (12 mo)
7 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.0-alpha7 Pre-release 10–11 Jul 11, 2026
1.0.0-alpha6 Pre-release 10–11 Jul 11, 2026
1.0.0-alpha5 Pre-release 10–11 Jul 10, 2026
1.0.0-alpha4 Pre-release 10–11 Jul 8, 2026
1.0.0-alpha3 Pre-release 10–11 Jul 7, 2026
1.0.0-alpha2 Pre-release 10–11 Jun 21, 2026
1.0.0-alpha1 Pre-release 10–11 Jun 21, 2026