dsh-grok-xai: Using SuperGrok / X Premium Subscription to Call Grok in DSH

Preface

Integrating Grok into DeepSeek Harness (DSH) typically involves providing your own xAI API Key or manually writing the provider and model catalog in the configuration. If you already have a SuperGrok or X Premium subscription, and prefer to log in with your subscription account—just like in the official Grok client—to view cycle usage and select real-time Grok models from the model menu, you need a plugin path for “Subscription OAuth + pi-ai sync.”

Below is an introduction to the community plugin dsh-grok-xai (maintainer TuDouPn, GitHub repo TuDouPn/dsh-grok-xai). It is an unofficial experimental DSH bundle: it logs in via xAI device code, writes credentials to the DSH credential store, syncs the model list and reasoning capabilities from api.x.ai, and reads plan and usage information from the proxy endpoint used by the Grok CLI. The plugin is categorized as “Model Inference” in the SkillHub directory; the current version in the repo is 1.3.0 (MIT), and the README states it was developed and verified on DSH 0.2.1-rc.2 (Desktop).

What is this

dsh-grok-xai adds a Grok (xAI Subscription) card at the bottom of the Settings → Models page in the DSH Web UI: after completing subscription login, it automatically writes the xai provider and real-time model configuration to llm-pi-ai, allowing you to select Grok from the model menu in the conversation input box. The card also displays the plan name, weekly/monthly usage percentages, breakdowns, reset times, prepaid balance, as well as the context window and pricing for each model (hover to see cached input, long-context pricing, and the full model ID).

Compared to “just filling in an API Key,” this plugin emphasizes subscription login without needing an API Key. The model list is sourced from GET https://api.x.ai/v1/models, and reasoning effort is calibrated according to the capabilities.reasoning_effort returned by each model’s /v1/models/{id}, rather than guessing tiers. Usage and plan data come from undocumented endpoints on cli-chat-proxy.grok.com (consistent with the Grok CLI); xAI may adjust these at any time. Please assess the risks yourself and comply with the xAI Terms of Service before use.

Core Features

The capabilities verified in the documentation are as follows.

  • Device Code OAuth: Credentials are managed by DSH authorization / credentials and recorded as llm-pi-ai/xai; access tokens are renewed with the refresh token within a write lock when nearing expiration.
  • One-click Model Integration: After login, syncs models to providers.xai.models; the model menu uses the xAI real-time list instead of the built-in pi-ai catalog; supports “Refresh and sync models.”
  • Subscription Usage & Plan: Displays plan display names (e.g., SuperGrok Plus); cached in the Host for 60 seconds with manual refresh support.
  • Reasoning Effort: Only displays optional tiers declared by xAI; models that do not support switching will not show invalid options (see the “Reasoning Effort” table in the repo README for details).
  • Implementation Form: Host (index.js) and Client (client.js) are plain JavaScript with no build step and no third-party npm runtime dependencies; injected into DSH as a bundle via cordis.patch.yml.

Environment Requirements

Before installing, ensure the current profile has DSH with a Web UI (Desktop or dsh web), and that llm-pi-ai, authorization, credentials, configEditor, and webServer are enabled (included by default in the basic Web profile). You need a valid SuperGrok or X Premium subscription.

Installation & Activation

The README recommends installing via the Git repository URL within DSH, without needing a prior git clone. Repository URL:

https://github.com/TuDouPn/dsh-grok-xai.git

In the current profile’s session, send the following block to the DSH Agent (consistent with the README; you may add a sentence like “Tell me where to open the Grok card after installation” as needed):

Please install and enable this Git repository as a DeepSeek Harness plugin in the current profile:
https://github.com/TuDouPn/dsh-grok-xai.git

Before installing, check if it is a DSH bundle; after installation, confirm the bundle is enabled and tell me where to open the Grok card.

DSH will read dsh.bundle.patch in package.json, install it via plugin_manager’s install_bundle, and display @local/dsh-grok-xai on the Plugins page. The process may require one approval (e.g., danger-full-access or approval).

Verify Installation:

  1. Plugins page shows @local/dsh-grok-xai and it is enabled;
  2. Open Settings → Models, scroll to the bottom of the page to see the Grok (xAI Subscription) card.

If the installer does not support Git URLs, the README provides an alternative method of “Cloning the directory absolute path + Installing bundle via Plugins”; do not move or delete the cloned directory after local link installation.

Upgrade: For Git URL installations, reinstall the same address in Plugins or execute an update; for local clones, git pull then re-enable the bundle or restart DSH (refreshing the page after Host updates may not be enough).

Uninstall: It is recommended to Log out on the card first; then remove the bundle in Plugins. Uninstallation does not automatically delete the xai provider in llm-pi-ai; you can clean it up manually in Settings → Models or cordis.patch.yml when no longer in use.

Typical Usage

  1. Open Settings → Models, and click Log in with SuperGrok / X Premium on the Grok (xAI Subscription) card at the bottom.
  2. Open the xAI verification link provided by the card in a browser, enter the one-time device code, and confirm.
  3. Return to DSH; once the card shows logged in, it will sync the real-time model list.
  4. Select a Grok model from the model menu in the conversation input box.

Common card operations:

Action Function
Refresh Re-reads subscription usage and real-time models
Refresh and sync models Fetches /v1/models and capabilities for each model, writes to llm-pi-ai
Log out Deletes the llm-pi-ai/xai record in the credential store; does not affect the xAI account

If the model menu does not update after logging in, try switching pages or restarting DSH.

Use Cases & Notes

Who it is for: Developers who already have a SuperGrok / X Premium subscription, want to chat with Grok using the same subscription credentials in DSH, and want to view usage and real-time pricing in the settings page.

Permissions & Security: The plugin runs with the permissions of the current DSH process; you should read the repository source code and MIT license before installing. OAuth tokens are not returned via plugin logs or pages; /grok-auth/* requires a same-origin Origin. billing/settings are undocumented endpoints, and behavior may change.

Known Limitations (excerpted from README): xAI does not provide a public /v1/usage compatible with subscription OAuth; /v1/api-key returns 401 for subscription tokens. The model interface does not return “max output tokens,” and conservative defaults are used for unknown models. Status is experimental.

Ecosystem Note: SkillHub (plugins/TuDouPn/dsh-grok-xai) is a community plugin directory and has no official affiliation with DeepSeek or xAI; DSH itself adheres to “Everything is a plugin,” and this repo explicitly states it is not affiliated with xAI, DeepSeek, or Anysphere.

Conclusion

dsh-grok-xai consolidates SuperGrok / X Premium subscription login, real-time Grok model sync, and subscription usage display into the DSH model settings page. It is suitable for scenarios where you do not want to maintain a separate xAI API Key but still want to select Grok within the Harness. For a more complete interface table, reasoning effort comparison, troubleshooting, and roadmap, see the GitHub README.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye