# Zactonz AI Connector for xAI Grok

> xAI Grok connector for the WordPress AI Client. Grok text, vision, tool calling, structured output with a real JSON schema, reasoning effort and image generation, with each model's modalities read from xAI's own catalogue.

- **Type:** Plugin (WordPress plugins)
- **Version:** 1.0.0, released 22 Oct 2026
- **Requires:** WordPress 7.0+, PHP 7.4+, An xAI account and API key
- **Tested with:** WordPress 7.1
- **Licence:** GPL-2.0-or-later
- **Documentation:** https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-xai-grok/

## Overview

Zactonz AI Connector for xAI Grok registers xAI 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 xAI Grok in a couple of clicks. Once active, the Grok models on your xAI account are available to AI features in WordPress.

xAI publishes the Grok family for text, vision and image generation from one catalogue. The connector reads xAI's richer model endpoint, which reports each model's input and output modalities, so a Grok model arrives in WordPress with the capabilities xAI declares for it, and image models are wired to the image generation endpoint rather than to chat.

### Features

- Text generation with every Grok chat model your credentials can reach.
- Automatic model discovery, with each model's input and output modalities taken from the xAI catalogue.
- Vision input on the models that accept images.
- Tool calling on the models that support functions.
- Structured output against a JSON schema, not only JSON mode, because xAI accepts a schema.
- Image generation with Grok's image models, through the WordPress AI Client's image generation contract.
- Reasoning effort control for the default text model, offering only the levels xAI documents.
- Cancellable server-sent event streaming for content, reasoning and tool-call chunks.
- Configurable request timeouts for text and images.
- 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.

### What the model list leaves out, and why

xAI serves its video and voice models from the same catalogue as its chat models, and publishes no task flags that would separate them. The connector therefore goes by what each model declares it produces: a model whose output is neither text, an image nor an embedding is not offered as a text model, whatever else it reports. The video and voice models are left out of the picker rather than offered as something WordPress cannot call, and the same rule will catch the next kind of model xAI adds without a code change.

### Reasoning

xAI ships reasoning and non-reasoning snapshots of the same Grok version, so the connector tells them apart by name and flags only the reasoning ones. The reasoning control in **Settings › xAI Grok** offers exactly the levels xAI documents, plus **Model default**, which leaves the parameter off the request.

### A note on structured output

xAI accepts `response_format` as plain text, as JSON mode and as a JSON schema. The connector therefore advertises schema support for Grok models and sends the schema a WordPress feature asks for, rather than falling back to JSON mode and hoping the shape comes out right.

### 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 OpenRouter](https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-openrouter/) covers hundreds of hosted models behind one key; [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 DeepSeek's long-context models; [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. 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 xAI. xAI and Grok are trademarks of X.AI Corp.

## Installation & setup

### Install the plugin

This connector is awaiting review for the WordPress plugin directory. The directory steps below are the route once it is listed; until then, install it from the plugin zip.

From the dashboard, go to **Plugins › Add New**, search for **Zactonz AI Connector for xAI Grok** 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-xai-grok --activate
```

To install manually, upload the folder to `/wp-content/plugins/zactonz-ai-connector-for-xai-grok/` and activate it from the **Plugins** menu.

### Connect to xAI

1. Create an API key in [the xAI console](https://console.x.ai/).
2. Go to **Settings › Connectors** and paste the key into the xAI Grok connector.
3. Go to **Settings › xAI Grok** to review the discovered models and choose a default model per capability, a reasoning level for the default text model, and the request timeouts.

The key is stored in the option WordPress registers for the connector, so the Connectors screen and the connector's own settings screen always show the same credential.

### Keep the key out of the database

Define `XAI_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( 'XAI_API_KEY', '…' );
```

### Choosing a default model

The picker lists the Grok chat and image models your account can reach, each with the input and output modalities xAI reports. Video and voice models are not listed, because the WordPress AI Client has no contract for them. Choose a default per capability, or leave the choice to the AI Client, which picks the first suitable model in the list.

### Reasoning effort

**Settings › xAI Grok** has a reasoning control that applies to the default text model; it is sent only with requests to that model and left off every other request. The levels offered are exactly the ones xAI documents, and **Model default** leaves the parameter off. The highest level is accepted only on xAI's newer models and treated as the next level down elsewhere, as xAI's documentation describes. Which levels a model accepts is up to xAI, so a model that does not reason, or that does not accept the level chosen, may ignore or refuse it. A reasoning reply takes longer to arrive, so raise the request timeout if you ask for long answers at the highest level.

### Image generation

Grok's image models are offered to the WordPress AI Client's image generation capability and are called through xAI's image generation endpoint rather than chat. Choose a default image model in **Settings › xAI Grok**, and set the image timeout separately from the text timeout, since an image takes longer to produce than a sentence.

### Use a proxy or gateway

**Settings › xAI Grok** has an API base URL field. Leave it empty to use `https://api.x.ai/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 xAI Grok, which runs in the background so it never holds the screen open. **Settings › xAI Grok** 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 in the xAI console at [console.x.ai](https://console.x.ai/).

### Which models will I see?

The Grok chat and image models your xAI account can reach. Each model's input and output modalities come from xAI's model endpoint, so vision appears on the models that accept images, image generation on the models that produce them, and reasoning on the snapshots xAI names as reasoning models.

### Why are some Grok models missing from the picker?

xAI lists its video and voice models from the same catalogue as its chat models. The WordPress AI Client has no contract for those outputs, so the connector leaves them out rather than offering something WordPress cannot call.

### Can I ask for a JSON schema?

Yes. xAI accepts a JSON schema, not only JSON mode, so the connector advertises schema support for Grok models and sends the schema a feature asks for. This differs from some other providers, which accept JSON mode only.

### Which reasoning levels can I choose?

Exactly the ones xAI documents, read from its reasoning guide, plus **Model default**, which leaves the parameter off the request. The control applies to the default text model and is sent only with requests to that model. Which levels a model accepts is up to xAI, so a model that does not reason, or that does not accept the level you chose, may ignore or refuse it; check xAI's documentation before relying on a particular level.

### Can WordPress generate images with Grok?

Yes. The WordPress AI Client that ships with WordPress 7.1 includes an image generation contract, and the connector offers Grok's image models to it, calling xAI's image generation endpoint. Choose a default image model and an image timeout in **Settings › xAI Grok**.

### Are embeddings available?

No. xAI does not offer embedding models, so the connector does not advertise the capability.

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

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

### Is my key ever displayed or logged?

No. It is never rendered back into the settings screen, and it is excluded from the diagnostics report and from Site Health debug information.

### 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.0 — 22 October 2026

- Initial release.
- Registers xAI Grok with the WordPress AI Client and the Settings › Connectors screen.
- Discovers models from xAI's model endpoint, reading each model's input and output modalities rather than inferring them from its name.
- Leaves out the video and voice models xAI returns from the same endpoint, by the output each one declares.
- Tells reasoning snapshots from non-reasoning snapshots of the same Grok version by name.
- Structured output against a JSON schema, which xAI accepts.
- Image generation with Grok's image models through xAI's image generation endpoint.
- Reasoning effort control for the default text model, offering only xAI's documented levels and sent only with requests to that model.
- Cancellable server-sent event streaming for content, reasoning and tool-call chunks.
- Redacted diagnostics report and an asynchronous WordPress Site Health connectivity test.
- API key from a PHP constant or an environment variable.
