# Zactonz AI Connector for OpenRouter

> OpenRouter connector for the WordPress AI Client. Hundreds of models from dozens of labs behind one API key, with each model's capabilities taken from the OpenRouter catalogue.

- **Type:** Plugin (WordPress plugins)
- **Version:** 1.0.1, released 5 Oct 2026
- **Requires:** WordPress 7.0+, PHP 7.4+, An OpenRouter account and API key
- **Tested with:** WordPress 7.1.2
- **Licence:** GPL-2.0-or-later
- **Download:** https://downloads.wordpress.org/plugin/zactonz-ai-connector-for-openrouter.latest-stable.zip
- **WordPress.org:** https://wordpress.org/plugins/zactonz-ai-connector-for-openrouter/
- **Source:** https://github.com/zactonz/zactonz-ai-connector-for-openrouter
- **Documentation:** https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-openrouter/

## Overview

Zactonz AI Connector for OpenRouter registers OpenRouter as a connector for the WordPress AI Client. It is built for the **Settings › Connectors** screen and for the plugin-directory connector search, so when WordPress asks for a connector you can add OpenRouter in a couple of clicks. Once active, any model your OpenRouter key can reach is available to every AI feature in WordPress.

OpenRouter is a routing gateway that exposes hundreds of models from dozens of labs behind one OpenAI-compatible API and one bill. The connector reads the OpenRouter catalogue directly and takes each model's capabilities from what OpenRouter publishes about it, so vision, tool calling and structured output are offered where the catalogue says the model supports them. Where OpenRouter publishes nothing for a model, the connector falls back to the model identifier.

### Features

- Text generation with every OpenRouter chat model your credentials can reach.
- Automatic model discovery, taking each model's capabilities from the OpenRouter catalogue wherever it publishes them.
- A separate default model per capability, or automatic selection by the WordPress AI Client.
- Vision input on models that accept images.
- Tool calling on models that report function support.
- Structured output with a JSON schema on models that support it.
- Reasoning effort control for the default text model.
- Cancellable server-sent event streaming for content, reasoning and tool-call chunks.
- A configurable request timeout for text generation.
- API key supplied by a PHP constant or an environment variable instead of the database.
- An API base URL override for a proxy or gateway, within the hosts and ports WordPress allows outbound requests to.
- Redacted diagnostics and a WordPress Site Health connectivity test.

### Part of a family

This connector is one of the Zactonz AI Connector plugins, which add the providers WordPress core leaves out. They follow one set of conventions, so every connector behaves the same way in the admin. [Zactonz AI Connector for Ollama](https://developers.zactonz.com/wordpress/plugins/zactonz-ai-provider-ollama/) covers local, self-hosted and Ollama Cloud models; [Zactonz AI Connector for Groq](https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-groq/) covers very low latency inference on GroqCloud; [Zactonz AI Connector for DeepSeek](https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-deepseek/) covers a very long context window and thinking mode; [Zactonz AI Connector for Mistral AI](https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-mistral-ai/) covers Mistral AI's open-weight and commercial models with capabilities read from its catalogue; [Zactonz AI Connector for xAI Grok](https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-xai-grok/) covers Grok text, vision and image generation. All of them are listed under [WordPress](https://developers.zactonz.com/wordpress/).

### Not affiliated

This connector is developed by Zactonz Technologies and is not affiliated with, endorsed by or sponsored by OpenRouter. OpenRouter is a trademark of OpenRouter, Inc.

## Installation & setup

### Install the plugin

From the dashboard, go to **Plugins › Add New**, search for **Zactonz AI Connector for OpenRouter** and click **Install Now**, then **Activate**. WordPress also links here directly from **Settings › Connectors** when it needs a connector that is not installed yet.

With WP-CLI:

```bash
wp plugin install zactonz-ai-connector-for-openrouter --activate
```

To install manually, download the zip from the Download button above, upload the folder to `/wp-content/plugins/zactonz-ai-connector-for-openrouter/` and activate it from the **Plugins** menu.

### Connect to OpenRouter

1. Create an API key on the [OpenRouter dashboard](https://openrouter.ai/keys).
2. Go to **Settings › Connectors** and paste the key into the OpenRouter connector.
3. Go to **Settings › OpenRouter** to review the discovered models and choose a default model per capability, a reasoning effort for the default text model, and the request timeout.

### Keep the key out of the database

Define `OPENROUTER_API_KEY` in `wp-config.php`, or set an environment variable of the same name. When either is present the connector uses it, the settings field is disabled, and nothing is written to the database.

```php
define( 'OPENROUTER_API_KEY', 'sk-or-…' );
```

### Use a proxy or gateway

**Settings › OpenRouter** has an API base URL field. Leave it empty to use `https://openrouter.ai/api/v1`, or point it at a gateway that speaks the same API.

AI features reach the gateway through the WordPress AI Client, which sends every request with `wp_safe_remote_request()`. WordPress refuses such requests to loopback and private network addresses and to any port other than 80, 443 and 8080, so a gateway on a LAN address or a non-standard port will not work unless the site allows that host with the `http_request_host_is_external` filter. The connector's own connection check and Site Health test do not apply that restriction, so with such a gateway they can report a healthy connection while AI features still cannot reach it. Use a public hostname on a standard port, or add the filter.

### Check the connection

**Tools › Site Health** includes a connectivity test for OpenRouter, and **Settings › OpenRouter** has a diagnostics button that reports the endpoint, HTTP status, latency, the number of discovered models, any configured defaults missing from the current catalogue, and the AI Client version. The key never appears in the report.

## FAQ

### Where do I get an API key?

Create one on the OpenRouter dashboard at [openrouter.ai/keys](https://openrouter.ai/keys). OpenRouter bills usage across every model to that one account.

### Which models will I see?

Models are listed from the OpenRouter catalogue your API key can reach. Each model is offered as vision, tool-calling or structured-output capable according to what OpenRouter publishes about it, and the connector falls back to the model identifier only where OpenRouter publishes nothing. Models OpenRouter marks inactive are left out.

### Does this replace the connectors in WordPress core?

No. WordPress core ships its own connectors. This plugin adds OpenRouter alongside them, and you can keep several connectors active at once and pick a default model per capability.

### Can I keep the key out of the database?

Yes. Define `OPENROUTER_API_KEY` in `wp-config.php` or as an environment variable. The settings field is then disabled and nothing is stored.

### Is my key ever displayed or logged?

No. The key is stored in its own option, is never rendered back into the settings screen, and is excluded from the diagnostics report and from Site Health debug information.

### Does OpenRouter know which site is calling?

The connector sends the standard OpenRouter attribution headers, `HTTP-Referer` with your site URL and `X-Title` with your site name, so requests show up under your site in the OpenRouter activity view. No other site data is sent.

### Which WordPress and PHP versions are supported?

WordPress 7.0 or newer and PHP 7.4 or newer. The connector is tested against the AI Client build that ships with WordPress 7.1 as well as the newest release.

## Changelog

### 1.0.1 — 5 October 2026

**Fixed**

- A model OpenRouter marks inactive was offered, and sorted ahead of the rest, so a site with no default set could pick one that no longer serves traffic.
- A callback that throws on the final stream event escaped raw instead of the wrapped error every other path reports.
- The settings screen reported no saved API key, and hid the control that removes it, on a site where AI support is switched off.
- The feature list promised request timeouts for embeddings and images. This connector offers neither; only the text timeout exists.
- The model-discovery answer in the FAQ described capability detection for embeddings, which this connector does not offer.

**Changed**

- Model-discovery wording. It claimed capabilities are read from the provider rather than guessed; where a provider publishes no capability data for a model the connector falls back to inference, so the description now says so.

### 1.0.0 — 18 September 2026

- Initial release.
- Registers OpenRouter with the WordPress AI Client and the Settings › Connectors screen.
- Discovers models from the OpenRouter catalogue and advertises only the capabilities it reports.
- Per-capability default model selection, reasoning effort, a configurable timeout and an API base URL override.
- Redacted diagnostics report and a WordPress Site Health connectivity test.
- API key from a PHP constant or an environment variable.
