# Zactonz AI Connector for OpenRouter: Installation & setup

> 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.

Page: https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-openrouter/installation/

Complete documentation for this product: https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-openrouter.md

## 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.

![The OpenRouter connector on the WordPress Connectors screen](https://developers.zactonz.com/assets/images/wordpress/zactonz-ai-connector-for-openrouter-connector.webp)

*Settings › Connectors: the OpenRouter connector with its key saved, as WordPress shows it beside its own connectors.*

## 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.
