Skip to content

Conversation

dkotter
Copy link
Contributor

@dkotter dkotter commented Sep 9, 2025

This PR adds in a new AI provider, xAI, using the existing OpenAI compatible classes. xAI claims to have full compatibility with the OpenAI REST API, making it fairly straightforward to add.

I've added support for both text generation and image generation, as well as support for both text and image input modalities.

This can be quickly tested using our cli.php command:

XAI_API_KEY=xai-KEY php cli.php 'Hello' --providerId=xai
XAI_API_KEY=xai-KEY php cli.php 'Hello' --providerId=xai --modelId=grok-3-mini

Note

I know there's an existing roadmap and adding new providers is currently not on that roadmap. I also know there was a discussion on which providers to initially support, with xAI not being on that list.

Happy to close this out if we don't want to consider this right now or we can also look at supporting this as a stand-alone, 3rd party thing under the 10up/Fueled repo if we don't want to support xAI directly in this package

Copy link

github-actions bot commented Sep 9, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @dkotter.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: dkotter.


To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant