OpenRouter Connector
A WordPress plugin that connects the WordPress Connectors API to [OpenRouter](https://openrouter.ai), enabling access to hundreds of AI models through a unified interface.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/benridane/wp-openrouter-connector/archive/refs/heads/main.zipA WordPress plugin that connects the WordPress Connectors API to OpenRouter, enabling access to hundreds of AI models through a unified interface.
Note: A more official OpenRouter provider implementation for WordPress is being developed separately. This project is maintained at its current version (0.1.0) and will not receive further feature development.
Features
- Registers OpenRouter as an AI provider through the WordPress 7.0+ Connectors API
- Text generation via GPT-4o, Claude 3.5 Sonnet, Gemini 2.0 Flash, Llama 3, Mistral, and more
- Image generation via Gemini multimodal models
- Flexible API key configuration (environment variable, PHP constant, or admin UI)
- Fallback settings page for WordPress versions without the Connectors API
Requirements
- WordPress 7.0 or later
- PHP 7.4 or later
- An OpenRouter API key
Installation
- Upload the
openrouter-connectordirectory to/wp-content/plugins/ - Activate the plugin through the Plugins screen
- Go to Settings > Connectors (or Settings > OpenRouter if the Connectors API is not available)
- Enter your OpenRouter API key
API Key Configuration
The API key is resolved in the following priority order:
- Environment variable --
OPENROUTER_API_KEY - PHP constant --
define( 'OPENROUTER_API_KEY', 'sk-or-...' );inwp-config.php - Database option -- set via the admin settings page
Supported Models
Text Generation
| Model ID | Name |
|---|---|
openai/gpt-4o |
GPT-4o |
openai/gpt-4o-mini |
GPT-4o Mini |
anthropic/claude-3.5-sonnet |
Claude 3.5 Sonnet |
google/gemini-2.0-flash |
Gemini 2.0 Flash |
meta-llama/llama-3-8b-instruct |
Llama 3 8B Instruct |
mistralai/mistral-7b-instruct |
Mistral 7B Instruct |
Image Generation (Multimodal)
| Model ID | Name |
|---|---|
gemini-2.5-flash-image |
Gemini 2.5 Flash Image |
gemini-3.1-flash-image-preview |
Gemini 3.1 Flash Image Preview |
See openrouter.ai/models for the full catalog of models available through OpenRouter.
License
GPL-2.0-or-later. See LICENSE for details.