Drupal is a registered trademark of Dries Buytaert
drupal 10.6.11 Update released for Drupal core (10.6.11)! drupal 11.3.12 Update released for Drupal core (11.3.12)! drupal 11.2.14 Update released for Drupal core (11.2.14)! drupal 10.5.12 Update released for Drupal core (10.5.12)! cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)!

A Drupal client for the Cloudflare AI Gateway: it stores each gateway as configuration, builds the gateway's request URLs and cf-aig-* control headers, and exposes its live model catalogue.

A Cloudflare AI Gateway is a hosted service that sits in front of AI providers and adds caching, logging, cost analytics and fallbacks. This module is the layer that lets Drupal talk to one. Most sites install it as a dependency of the Cloudflare AI Gateway Provider, which connects it to the Drupal AI module; developers can also use its client service directly.

Features

  • A gateway configuration entity, so you can define one or more gateways (host, slug, default provider, and the credential set that authorizes them).
  • URL building for the gateway's endpoint styles (the OpenAI-compatible endpoint, the universal endpoint, and per-provider passthrough).
  • The cf-aig-* request headers for cache TTL, metadata and fallbacks, built from an immutable options object.
  • Access to the gateway's live model catalogue, the union of models across every provider it fronts, cached per gateway.
  • Credentials (account ID and token) are resolved from settings.php through the Cloudflare SDK, never stored in configuration.

Use it as the foundation for the AI provider, or directly from your own code when you need to send requests through a Cloudflare AI Gateway.

Post-Installation

This module has no user-facing AI features on its own. It provides the gateway client and configuration that other modules (or your own code) build on. After enabling it:

  1. Add a credential set in the Cloudflare SDK module, and put its account ID and token in settings.php.
  2. Add a gateway at Configuration > Web services > Cloudflare AI Gateways. Set the host (the global endpoint is the default), the gateway slug from your Cloudflare dashboard, the default upstream provider, and the credential set that supplies its authorization token.

To route the Drupal AI module through the gateway, also install the Cloudflare AI Gateway Provider.

Additional Requirements

This module requires the Cloudflare SDK module, which provides the credential framework and the shared HTTP client. Installing with Composer pulls it in:

composer require drupal/cloudflare_ai_gateway

While the suite is in alpha, require it as drupal/cloudflare_ai_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.

Install the Cloudflare AI Gateway Provider to use a configured gateway with the AI module, so every AI feature in your site routes through it.

Similar projects

The existing Cloudflare module focuses on CDN and cache management and does not cover the AI Gateway. This module is part of a small Cloudflare suite built on the Cloudflare SDK, alongside the AI Gateway Provider.

Supporting this Module

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

Community Documentation

Cloudflare's AI Gateway documentation is at developers.cloudflare.com/ai-gateway.

Activity

Total releases
2
First release
Jun 2026
Latest release
3 hours ago
Release cadence
0 days
Stability
0% stable

Releases

Version Type Release date
1.0.0-alpha2 Pre-release Jun 21, 2026
1.0.0-alpha1 Pre-release Jun 21, 2026