

AI Client Credentials settings page where you enter your Grok (xAI) API key.
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:
Available models are dynamically discovered from the Grok API.
Requirements:
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:
$text = AI_Client::prompt( 'Explain quantum computing.' )->using_provider( 'grok' )->generate_text();
$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();
$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 = 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.
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.
All communication is sent to: 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.
We welcome contributions! You can help by:
Please read our Contributing Guide before submitting a pull request.