Title: AI Provider for Grok
Author: Aslam Doctor
Published: <strong>16. měrca 2026</strong>
Last modified: 17. oktobra 2026

---

Tykace pytaś

![](https://ps.w.org/aslams-ai-provider-for-grok/assets/banner-772x250.png?rev=3490096)

![](https://ps.w.org/aslams-ai-provider-for-grok/assets/icon.svg?rev=3490096)

# AI Provider for Grok

 Wót [Aslam Doctor](https://profiles.wordpress.org/aslamdoctor/)

[Ześěgnuś](https://downloads.wordpress.org/plugin/aslams-ai-provider-for-grok.1.0.4.zip)

 * [Drobnostki](https://dsb.wordpress.org/plugins/aslams-ai-provider-for-grok/#description)
 * [Pógódnośenja](https://dsb.wordpress.org/plugins/aslams-ai-provider-for-grok/#reviews)
 *  [Instalacija](https://dsb.wordpress.org/plugins/aslams-ai-provider-for-grok/#installation)
 * [Wuwiśe](https://dsb.wordpress.org/plugins/aslams-ai-provider-for-grok/#developers)

 [Pódpěra](https://wordpress.org/support/plugin/aslams-ai-provider-for-grok/)

## Wopisanje

This plugin provides Grok (by xAI) integration for the WP AI Client SDK. It enables
WordPress sites to use Grok models for text generation and related AI capabilities.

**Features:**

 * Text generation with Grok models
 * Function calling support
 * Vision input support (for compatible models)
 * Automatic provider registration

Available models are dynamically discovered from the Grok API.

**Requirements:**

 * PHP 7.4 or higher
 * WP AI Client plugin must be installed and activated
 * Grok API key from xAI
 * Purchased API tokens from [x.ai](https://x.ai/) — a valid token balance is required
   for API requests to work

### Usage

The provider automatically registers itself on the `init` hook. Once both plugins
are active and your API key is configured, you can start generating text:

#### Basic Text Generation

    ```
    $text = AI_Client::prompt( 'Explain quantum computing.' )->using_provider( 'grok' )->generate_text();
    ```

#### With System Instructions

    ```
    $text = AI_Client::prompt( 'Summarize the history of WordPress.' )->using_provider( 'grok' )->using_system_instruction( 'Be concise and accurate.' )->using_temperature( 0.2 )->using_max_tokens( 500 )->generate_text();
    ```

#### Vision (Image Input)

    ```
    $text = AI_Client::prompt( 'Describe this image.' )->using_provider( 'grok' )->with_file( 'https://example.com/photo.jpg', 'image/jpeg' )->generate_text();
    ```

Requires a Grok model with vision capabilities.

#### JSON Output

    ```
    $json = AI_Client::prompt( 'Analyze this topic: WordPress plugins' )->using_provider( 'grok' )->as_json_response( $schema )->generate_text();
    ```

For full usage examples including chat history, function calling, and feature detection,
see the [README on GitHub](https://github.com/aslamdoctor/ai-provider-for-grok).

### External services

This plugin connects to the xAI Grok API to provide AI-powered text generation capabilities
within WordPress. The xAI Grok API is a third-party service operated by xAI Corp.

#### What data is sent and when

 * **API key**: Your xAI API key is sent with every request for authentication.
 * **Model listing**: When the plugin checks provider availability or lists available
   models, it sends a request to the xAI API to retrieve the current list of Grok
   models.
 * **Text generation prompts**: When your site uses the plugin to generate text,
   the prompt text (and any attached images or files, system instructions, and conversation
   history) is sent to the xAI API for processing.

All communication is sent to: [https://api.x.ai/v1](https://api.x.ai/v1)

Data is only sent when the plugin is actively used to generate text or when checking
model availability. No data is sent passively or in the background.

#### Service links

 * xAI website: [https://x.ai](https://x.ai)
 * xAI API documentation: [https://docs.x.ai/developers/models](https://docs.x.ai/developers/models)
 * xAI Terms of Service: [https://x.ai/legal/terms-of-service](https://x.ai/legal/terms-of-service)
 * xAI Privacy Policy: [https://x.ai/legal/privacy-policy](https://x.ai/legal/privacy-policy)

### Contributing

We welcome contributions! You can help by:

 * Reporting bugs or suggesting features via [GitHub Issues](https://github.com/aslamdoctor/ai-provider-for-grok/issues)
 * Submitting pull requests on [GitHub](https://github.com/aslamdoctor/ai-provider-for-grok)

Please read our [Contributing Guide](https://github.com/aslamdoctor/ai-provider-for-grok/blob/master/CONTRIBUTING.md)
before submitting a pull request.

## Screenshots

[⌊AI Client Credentials settings page where you enter your Grok (xAI) API key.⌉⌊
AI Client Credentials settings page where you enter your Grok (xAI) API key.⌉[

AI Client Credentials settings page where you enter your Grok (xAI) API key.

## Instalacija

 1. Purchase API tokens from [x.ai](https://x.ai/) if you haven’t already
 2. Ensure the WP AI Client plugin is installed and activated
 3. Upload the plugin files to `/wp-content/plugins/ai-provider-for-grok/`
 4. Activate the plugin through the ‚Plugins‘ menu in WordPress
 5. Go to Settings > AI Credentials and enter your Grok (xAI) API key

## FAQ

### How do I get a Grok API key?

Visit the [xAI Console](https://console.x.ai/) to create an account and generate
an API key.

### Does this plugin work without the WP AI Client?

No, this plugin requires the WP AI Client plugin to be installed and activated. 
It provides the Grok-specific implementation that the WP AI Client uses.

## Reviews

There are no reviews for this plugin.

## Sobustatkujuce a wuwijarje

„AI Provider for Grok“ jo software wótwórjonego žrědła. Slědujuce luźe su pśinosowali
k toś tomu tykacoju.

Sobustatkujuce

 *   [ Aslam Doctor ](https://profiles.wordpress.org/aslamdoctor/)

“AI Provider for Grok” has been translated into 3 locales. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/aslams-ai-provider-for-grok/contributors)
for their contributions.

[Translate “AI Provider for Grok” into your language.](https://translate.wordpress.org/projects/wp-plugins/aslams-ai-provider-for-grok)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/aslams-ai-provider-for-grok/),
check out the [SVN repository](https://plugins.svn.wordpress.org/aslams-ai-provider-for-grok/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/aslams-ai-provider-for-grok/)
by [RSS](https://plugins.trac.wordpress.org/log/aslams-ai-provider-for-grok/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.4

 * Fixed JSON schema structured output by conforming to xAI response_format structure(
   fixes #3)
 * Excluded video models from image generation mapping
 * Enabled multimodal image input for Grok 3 and newer models
 * Added webSearch option support when supported by WP AI Client SDK
 * Improved model version sorting to handle decimal releases (e.g. Grok 4.20)
 * Added direct file access protection to autoloader
 * Escaped exception strings in provider class
 * Bumped WordPress tested up to version to 7.1

#### 1.0.3

 * Updated plugin assets with revised icons and banners

#### 1.0.2

 * Renamed plugin to „AI Provider for Grok“
 * Restored WordPress.org plugin slug
 * Added ‚connector‘ tag to readme.txt

#### 1.0.1

 * Updated banner images with WordPress + Grok logos
 * Added contribution guide, issue templates, and PR template
 * Internal tooling improvements

#### 1.0.0

 * Initial release
 * Support for Grok text generation models
 * Function calling support
 * Vision input support for compatible models

## Meta

 *  Version **1.0.4**
 *  Last updated **4 tyźenje**
 *  Active installations **100+**
 *  WordPress version ** 6.9 abo nowša **
 *  Tested up to **7.1.4**
 *  PHP version ** 7.4 abo nowša **
 *  Languages
 * [Czech](https://cs.wordpress.org/plugins/aslams-ai-provider-for-grok/), [Dutch](https://nl.wordpress.org/plugins/aslams-ai-provider-for-grok/),
   [English (US)](https://wordpress.org/plugins/aslams-ai-provider-for-grok/) a 
   [Persian](https://fa.wordpress.org/plugins/aslams-ai-provider-for-grok/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/aslams-ai-provider-for-grok)
 * Tags
 * [AI](https://dsb.wordpress.org/plugins/tags/ai/)[artificial intelligence](https://dsb.wordpress.org/plugins/tags/artificial-intelligence/)
   [connector](https://dsb.wordpress.org/plugins/tags/connector/)[grok](https://dsb.wordpress.org/plugins/tags/grok/)
   [xai](https://dsb.wordpress.org/plugins/tags/xai/)
 *  [Rozšyrjony naglěd](https://dsb.wordpress.org/plugins/aslams-ai-provider-for-grok/advanced/)

## Pógódnośenja

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/aslams-ai-provider-for-grok/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/aslams-ai-provider-for-grok/reviews/)

## Sobustatkujuce

 *   [ Aslam Doctor ](https://profiles.wordpress.org/aslamdoctor/)

## Pódpěra

Got something to say? Need help?

 [Forum pomocy pokazaś](https://wordpress.org/support/plugin/aslams-ai-provider-for-grok/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://github.com/sponsors/aslamdoctor)