Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Mailchimp 3.1.5 Minor update available for module mailchimp (3.1.5). Release: Commerce Shipping 3.0.5 Minor update available for module commerce_shipping (3.0.5). Release: GoogleTag Manager 2.0.1 Minor update available for module gtm (2.0.1). Usage Milestone: Easy Breadcrumb Module easy_breadcrumb crossed 100,000 active installs. Release: FlowDrop 1.6.1 Minor update available for module flowdrop (1.6.1). Release: MCP Sentinel 2.17.0 Minor update available for module mcp_sentinel (2.17.0). Release: Commerce ML Exchange 2.0.1 Minor update available for module cmlexchange (2.0.1). Release: Commerce ML Exchange 2.0.0 Major update available for module cmlexchange (2.0.0). Release: SynImport 2.0.0 Major update available for module synimport (2.0.0). Module Revived: Contextual Filter from Referer 1.0.2 Module contextual_filter_referer updated after 22 months of inactivity (1.0.2).

AI Writer

No security coverage Drupal 10–11

Part of the AI ecosystem · 302 projects

View on drupal.org

This module adds an AI writing assistant powered by OpenAI directly into your content editing forms. It allows content creators to generate drafts for articles, news posts, or landing pages by providing simple text instructions, streamlining the content creation process without leaving Drupal.

AI Writer adds an OpenAI-powered writing assistant directly to your content forms. When creating or editing an article or any other content type, authors can type a plain-language instruction — like "Write a 300-word news article about our upcoming spring festival" — and the module generates a draft and drops it right into the body editor, ready to review and refine. It turns a blank page into a starting point, without leaving Drupal or copying and pasting from another AI tool.

Features

The basic functionality: an AI Writer panel appears on node add/edit forms with a prompt box and a Generate draft button. Behind the scenes the module calls the OpenAI Chat Completions API server-side, sanitizes the response, and inserts the resulting HTML into the body field's CKEditor 5 editor (falling back to a plain textarea when no WYSIWYG is present).

Unique features this module adds:

  • A single admin config page to set your OpenAI API key, model, system prompt, temperature, and max tokens — no code required.
  • Environment-variable support for the API key (OPENAI_API_KEY), which takes precedence over the stored config value, so secrets can stay out of your database and exported configuration.
  • Server-side API calls: the key is never exposed to the browser.
  • Output passed through Drupal's XSS filter before it reaches the editor.
  • Permission-gated (Use AI Writer) and CSRF-protected requests.
  • Works on every content type automatically — no per-type configuration.

When and why to use it: any site where editors regularly draft articles, news posts, or landing-page copy and would benefit from a fast first draft. Typical use cases include newsrooms, university and marketing sites, and multi-author blogs where reducing "blank page" friction speeds up publishing.

Post-Installation

After enabling the module:

  1. Go to Administration → Configuration → Content authoring → AI Writer (/admin/config/content/ai-writer) and provide your OpenAI API key (or set the OPENAI_API_KEY environment variable instead — it wins over the config value). Optionally adjust the model, system prompt, temperature, and max tokens.
  2. Grant the Use AI Writer permission to the roles that should have the assistant (e.g. Author, Editor) at /admin/people/permissions.
  3. Create or edit any content item. You'll see the AI Writer panel above the fields — enter an instruction, click Generate draft, and the draft is inserted into the body editor.

There is no new content type to look for and no text-format changes are required. The module targets the body field's CKEditor 5 instance automatically; if a form has no WYSIWYG, the text is appended to the raw textarea instead. Clear caches after enabling (drush cr) so the form additions and library attach correctly.

Additional Requirements

  • Drupal core ^10 || ^11 with the Node module (a core module, and a declared dependency).
  • An OpenAI API key with access to a chat model (default gpt-4o-mini) — see platform.openai.com.
  • Outbound HTTPS access from your server to api.openai.com.

No additional contributed modules or third-party PHP libraries are required — the module uses Drupal's built-in Guzzle HTTP client.

  • Any CKEditor 5 configuration (core) — the generated HTML lands in the body editor, so an editor set up for the tags the model returns (headings, lists, links) gives the best result.
  • Key or environment-based secret management (e.g. Pantheon Secrets, or the Key module pattern) to keep the API key out of exported configuration.

Similar projects

The AI (Artificial Intelligence) ecosystem provides a broad, provider-agnostic framework with many sub-modules and integrations. AI Writer is intentionally narrower: a small, self-contained module focused on one job — generating body content from a prompt on node forms — with minimal configuration and no dependency on a larger AI framework. Choose AI Writer when you want a lightweight, drop-in assistant; choose the AI framework when you need multiple providers, agents, or deeper platform integration.

Supporting this Module

Add your Patreon, Open Collective, GitHub Sponsors, or contact links here.

Community Documentation

Add links to walkthrough videos, a demo site (via DrupalPod), or extended docs here. See the module's README.md for full configuration, security notes, and testing instructions.

Depends on

Dependencies of the latest stable release

  • node Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jul 2026
Latest release
1 month ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.0.1 Stable 10–11 Jul 12, 2026
1.0.0 Stable 10–11 Jul 12, 2026