Drupal is a registered trademark of Dries Buytaert

ai_provider_openrouter

29 sites No security coverage
View on drupal.org

Adds OpenRouter to Drupal AI: 300 + models with chat/completions/embeddings/text-to-image, dynamic model discovery, key-based setup, optional curated model lists for lean UIs.

Features

  • One-click gateway to 367 LLMs – instantly tap every model available on OpenRouter (GPT-4o, Claude 3 family, o1/o3 reasoning models, Gemini, Grok, etc.).
  • Always up-to-date model list – the provider queries OpenRouter's /models and /embeddings/models endpoints on demand, so new models appear in Drupal as soon as OpenRouter lists them.
  • Curated model selection – administrators may whitelist a smaller subset of models to keep drop-downs manageable for editors and automated workflows. Also select models according to price.
  • Full support for Chat, Completions, Embeddings, and Text-to-Image operations – generate images from text prompts using Gemini, GPT-5, and other multimodal models.
  • 21 dedicated embedding models – with automatic vector size detection (384-3072 dimensions) for seamless integration with vector databases.
  • Batch embeddings processing – process multiple texts in a single API call for improved performance.
  • Advanced multimodal support – chat with images, PDFs, and videos. Models can "watch" video content and analyze visual information.
  • Reasoning model controls – fine-tune o1/o3/GPT-5 reasoning models with effort parameters (minimal to extra-high).
  • Streaming responses – real-time output with token usage, reasoning tokens, and finish reason tracking.
  • Function Calling/Tools – full support for tool calls and agentic workflows.
  • Site builders can use OpenRouter models anywhere the AI module exposes providers: text formats, CKEditor AI, content moderation, custom automations, and more.

Post-Installation

  1. Install the module (and its dependencies) via Composer or the Extend page.
  2. Add your OpenRouter API key
    • Navigate to Configuration » System » Keys (provided by the Key module).
    • Create a new key of type “Authentication” and paste your OpenRouter key.
  3. Enable OpenRouter provider
    • Go to Configuration » AI » Provider Settings.
    • Select “OpenRouter”, choose the key you just created, and (optionally) pick which models to expose.
    • If you leave the model list blank, every available model (300 +) will be offered.
  4. Use it anywhere the AI module appears – in text formats, CKEditor AI buttons, custom plugins, or your own code via \Drupal::service('ai_provider_openrouter.client').

Additional Requirements

  • AI module (core provider framework)
  • Key module ≥ 1.18 – secure storage for your API token
  • openai-php/client ^0.10.1 – installed automatically when you run
    composer require drupal/ai_provider_openrouter

This provider works out-of-the-box; no extra libraries are required beyond those listed above.

Similar projects

OpenRouter AI Provider differentiates itself by aggregating hundreds of models from multiple vendors through one API, giving site builders unmatched choice without juggling keys or endpoints.

Supporting this Module

Issue queues, bug reports, and merge requests are always welcome.

Community Documentation

Documentation Link: Coming soon.

Activity

Total releases
5
First release
Jun 2025
Latest release
3 days ago
Release cadence
63 days
Stability
80% stable

Release Timeline

Releases

Version Type Release date
1.1.3 Stable Mar 1, 2026
1.1.2 Stable Feb 2, 2026
1.1.1 Stable Nov 13, 2025
1.0.0 Stable Jun 25, 2025
1.0.x-dev Dev Jun 21, 2025