Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bulk Operations (VBO) 4.4.8 Minor update available for module views_bulk_operations (4.4.8). Release: Commerce Authorize.Net 2.0.0 Major update available for module commerce_authnet (2.0.0). Usage Milestone: Easy Breadcrumb Module easy_breadcrumb crossed 100,000 active installs. Release: SDC Components 2.0.3 Minor update available for module sdc_components (2.0.3). Release: Commerce ML Starter 8.x-1.94 Minor update available for module cmlstarter (8.x-1.94). Release: Field Label Visibility (an intuitive approach to editing node forms) 1.0.3 Minor update available for module field_label_visibility (1.0.3). Release: DruxtJS 1.3.1 Minor update available for module druxt (1.3.1). Release: Monobank payment API 1.0.4 Minor update available for module monobank (1.0.4). Release: Personified 1.0.4 Minor update available for module personified (1.0.4). Module Revived: Fleetview client 1.1.2 Module fleetview_client updated after 16 months of inactivity (1.1.2).

This module connects Drupal to xAI's Grok AI services, enabling text generation, chat, and image/video creation directly within Drupal. It supports multimodal prompts, function calling, and optional xAI-hosted tools like web search, with API keys managed securely.

Grok Integration connects Drupal's AI module to xAI. It provides Grok chat and multimodal models, Grok Imagine image and video generation, voice operations, hosted tools, Drupal AI Explorer enhancements, and best-effort cost estimates.

The xAI API key is stored in Drupal's Key module, not in exported configuration. This is an unofficial community integration and is not affiliated with or endorsed by xAI.

Supported Drupal AI operations

  • Chat, streaming chat, vision input, function tools, and structured output
  • Text to Image and Image to Image
  • Text to Video and Image to Video
  • Text to Speech and Speech to Text
  • Image Classification
  • Model-based Moderation
  • Grok Collections knowledge-base search through xAI Collections Search. The optional Grok Documents (grok_doc) module adds Drupal administration for registering existing Collections, uploading documents, and queued bulk ingestion.

Ordinary requests use Chat Completions. Requests that enable xAI-hosted tools use the Responses API automatically. Moderation is a probabilistic Grok assessment, not a dedicated safety or compliance endpoint.

Drupal AI Explorer enhancements

Compatible Explorers include operation-specific example prompts, token and reasoning usage, xAI-reported or estimated request cost, shared image inputs, and optional generated audio/video saving to Drupal Media. Administrators can customize or disable the example prompts from the provider configuration form.

Image operations can use an upload, the bundled example image, or a compatible Drupal Media item. The optional Media Library Form Element module provides a visual selector; entity autocomplete remains available without it.

Cost estimation

When xAI reports usage.cost_in_usd_ticks, that value is shown. Otherwise, Grok Integration estimates cost from an editable, versioned pricing schedule covering tokens, cached and long-context input, images, video, speech characters, and transcription hours. Estimates are informational and may differ from the final xAI invoice.

Optional xAI-hosted tools

  • Web Search
  • X Search
  • Code Interpreter
  • Collections Search
  • Allowlisted remote MCP servers

Hosted tools are disabled by default at both site and request level. Remote MCP servers require HTTPS and an explicit allowed-tools list. Grok Integration includes Collections Search, but it does not itself manage collections or documents. Install the separately maintained Grok Documents module when Drupal needs collection registration, document upload, or queued bulk ingestion.

Installation and configuration

Install the current beta with Composer:

composer require 'drupal/grok:^1.0@beta'
drush en grok

Create a Drupal Key entity containing an xAI API key, then configure Grok Integration at /admin/config/ai/providers/grok. Use Test connection and load models to verify credentials and discover models available to the key. When discovery finds a newer numbered Grok family, Drupal AI's AI Capabilities from Installed Providers section offers a confirmed action to update older Grok defaults. Newly published pricing rows are also merged into the provider form for review without overwriting custom pricing.

Drupal 11.2+ sites can alternatively apply the included recipe after Composer installation:

vendor/bin/dr recipe web/modules/contrib/grok/recipes/grok

Upgrading from alpha8 or earlier

The machine name changed from grok_ai_provider to grok in alpha9. Export or record the existing settings, uninstall the former Grok AI Provider module, update the code, enable grok, and restore the settings.

Requirements

Security and privacy

Prompts, uploaded media, generated content, and enabled hosted-tool context are sent to the configured API endpoint. Web Search, X Search, Code Interpreter, Collections Search, and remote MCP can send context to additional services. Review data-residency, retention, and privacy requirements before enabling them.

Responses API storage is disabled by default. A custom API base URL receives the configured xAI key and must be trusted. Grok Documents should use a separate, least-privilege Management API key for document operations.

Report security issues privately through the process in the project's SECURITY.md; do not publish secrets or customer data in an issue.

Translations

Grok Integration uses Drupal's String Translation API and includes basic packaged translations for Arabic, German, Spanish, French, Hindi, Japanese, Portuguese, Russian, Swahili, and Simplified Chinese. Community translations can be contributed through Drupal localization.

Project status

The 1.0.x beta series is intended for compatibility and release-candidate testing across Drupal 10.6 and Drupal 11.2+. Please report reproducible defects with Drupal, PHP, AI module, Key module, and Grok Integration versions.

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
12
Tracked since
Jul 2026
Latest release
2 weeks ago
Releases (12 mo)
12 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.0-beta5 Pre-release 10–11 Aug 26, 2026
1.0.0-beta4 Pre-release 10–11 Aug 16, 2026
1.0.0-beta2 Pre-release 10–11 Aug 3, 2026
1.0.0-beta1 Pre-release 10–11 Aug 2, 2026
1.0.0-alpha9 Pre-release 10–11 Aug 1, 2026
1.0.0-alpha8 Pre-release 10–11 Jul 31, 2026
1.0.0-alpha7 Pre-release 10–11 Jul 28, 2026
1.0.0-alpha6 Pre-release 10–11 Jul 28, 2026
1.0.0-alpha5 Pre-release 10–11 Jul 27, 2026
1.0.0-alpha4 Pre-release 10–11 Jul 27, 2026
1.0.0-alpha3 Pre-release 10–11 Jul 26, 2026
1.x-dev Dev 10–11 Jul 25, 2026