WP Manifestindependent plugin directory
manifest / ai / webberzone-grok-account

WebberZone Grok Account

Use your SuperGrok or X Premium subscription for Grok text and image generation in the WordPress AI Client, instead of an xAI API key.

by WebberZone · github.com/webberzone/webberzone-grok-account · website

★ 0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/webberzone/webberzone-grok-account/archive/refs/heads/master.zip

Requires: WordPress 7.0, PHP 7.4 License: GPL-2.0+


[!WARNING] This plugin signs in with the public OAuth client used by Grok CLI-style coding agents and calls the regular xAI API with that sign-in. xAI has not published documentation permitting this for third-party apps, and may change or block it. Some subscriptions can sign in but are refused by the API (HTTP 403). Anyone with admin access to the site can use your Grok plan while you are signed in.

Overview

WebberZone Grok Account adds a Grok Account provider to the WordPress AI Client. You sign in with your xAI account (SuperGrok or X Premium) using a one-time device code, and Grok text and image generation run against your plan instead of an xAI API key.

  • Sign in from Settings → Connectors: replaces core's API-key field with a "Sign in with xAI" card and modal. Settings → Grok Account offers the same flow.
  • Device flow: standard OAuth 2.0 device authorization grant (RFC 8628) against auth.x.ai.
  • Text generation: api.x.ai/v1/chat/completions, via the AI Client's OpenAI-compatible base classes. No other plugin required.
  • Image generation: Grok Imagine via api.x.ai/v1/images/generations.
  • Tokens: encrypted with libsodium using a key derived from the site's auth salt, refreshed automatically under a lock.
  • No build step: hand-written ES module for the Connectors card.

Shares its sign-in, token storage and Connectors card design with WebberZone ChatGPT Account.

Not supported: video, speech, embeddings and image editing.

Filters

Filter Purpose
wzgka_fallback_models Models offered when the live model list can't be fetched (ID => text or image).

Shared files

This plugin and its sibling (WebberZone ChatGPT Account) share their sign-in, token and Connectors code. These files are identical in both repos apart from the namespace (ChatGPT_Account / Grok_Account), prefix (wzcga / wzgka, WZCGA / WZGKA) and text domain (webberzone-chatgpt-account / webberzone-grok-account):

  • includes/class-oauth-client.php — refresh with locking, pending device codes, HTTP helpers
  • includes/class-token-store.php — encrypted token storage
  • includes/class-admin.php — settings page and AJAX endpoints
  • includes/class-connectors.php — Settings → Connectors integration
  • includes/class-availability.php
  • assets/js/connectors.js — Connectors card and sign-in modal
  • uninstall.php

Provider-specific wording lives in includes/class-config.php; the device-code flow and refresh request live in includes/class-oauth.php. Change a shared file in one repo, apply the same rename to copy it to the other, and keep them in step.

Contributing

  • Fork the repository and create your branch from master.
  • Run composer test (phpcs, PHP compatibility, phpstan) before opening a pull request.
  • composer zip builds the installable zip into build/.

For Users

See readme.txt for installation and usage instructions.

Changelog

See releases.

License

GPL v2 or later.