dsh-coding-plan-quota: View Coding Plan quota at a glance next to the DSH input box

Preface

When developing agents with DeepSeek Harness (DSH), models are often tied to various Coding Plans or API subscription plans: some meter usage by 5-hour, weekly, or monthly windows, while others only report account balance. Quotas are scattered across various vendor consoles or CLIs, making it difficult to know “how much is left and when the window resets” when selecting models in Composer. This article introduces the community client plugin dsh-coding-plan-quota (maintainer sxwer001), which places a quota ring to the left of the input box tool row and model selector in DSH. Only one configured source is shown at a time; clicking can switch time windows or refresh, it is colored by occupancy ratio, and hovering reveals details and source switching.

What Is This

dsh-coding-plan-quota is a Web client plugin for DSH (dsh.client.platform: web). The current npm package version is 0.2.1, licensed under MIT. It fetches usage or balance from each vendor on the host side, renders the ring and cards on the browser side, and stores the selected source and time window in localStorage. The plugin is categorized as Usage & Billing in the plugin marketplace and is listed as a client plugin in the SkillHub directory.

Core Features

Ring and Window Switching

The ring reads the coding plan usage windows or account balance of the currently selected source.

  • Click the ring: for sources with 5-hour / weekly / monthly windows, cycles 5 hours → weekly → monthly; for pure balance-type sources, performs a refresh.
  • Coloring (default thresholds): used ratio green <50% → blue <75% → orange <90% → red ≥90%.
  • Hover: displays used percentage, countdown until reset, and progress bars for each window.

Source Selection and Fault Tolerance

The card title row follows the format Quota Source · <Name> ›; clicking it switches the source. The selection page only lists sources that can currently fetch data successfully; others can be expanded after the toggle. If a collection fails, the last successful value is retained and marked as stale to avoid an empty interface.

Supported Sources (15)

The sources and credentials listed in the README are as follows (the interface will prompt which one is needed when credentials are missing):

Source id Credentials / Notes
OpenCode Go opencode-go OPENCODE_GO_API_KEY; 5h / weekly / monthly
Zhipu GLM glm ZHIPU_API_KEY; 5h / weekly; region: cn uses open.bigmodel.cn
Kimi kimi KIMI_API_KEY
MiniMax minimax MINIMAX_COOKIE (browser session cookie, not API key)
Volcano Ark ark ARK_API_KEY; requires configuring endpoint manually
Claude Subscription claude CLAUDE_CODE_OAUTH_TOKEN
Codex / ChatGPT codex CHATGPT_ACCESS_TOKEN + CHATGPT_ACCOUNT_ID
Gemini CLI gemini GEMINI_ACCESS_TOKEN
GitHub Copilot copilot COPILOT_API_TOKEN
DeepSeek Balance deepseek DEEPSEEK_API_KEY
Moonshot Balance moonshot MOONSHOT_API_KEY
OpenRouter Balance openrouter OPENROUTER_API_KEY
SiliconFlow Balance siliconflow SILICONFLOW_API_KEY
StepFun Balance stepfun STEPFUN_API_KEY
Novita Balance novita NOVITA_API_KEY

If a vendor reports a percentage as remaining, the plugin converts it inversely to used; when multiple windows are reported per model (e.g., GLM, Gemini), the worst window is displayed.

Installation and Activation

Install from the DSH plugin marketplace (Usage & Billing), or run in the terminal (choose one):

dsh plugin --profile web add dsh-coding-plan-quota                  # npm
dsh plugin --profile web add github:sxwer001/dsh-coding-plan-quota  # GitHub

Restart DSH after installation. The plugin runs with the permissions of the current DSH process; it is recommended to review the source code and MIT license on the GitHub repository before installation.

Configuration and Credentials

Configuration is merged via apply(ctx, config) in the Cordis patch. Common keys and default values:

Key Default Description
cacheMs 60000 Host-side cache duration for each source
timeoutMs 12000 Upstream request timeout
thresholds [50, 75, 90] Ring color boundaries
defaultProvider "opencode-go" Default source when none is selected
hideUnconfigured false Whether to hide sources without credentials
insecureTls false Whether to skip TLS certificate verification
providers {} Per-id single source overrides

A single source can set enabled, endpoint, apiKey, apiKeyEnv, region, insecureTls, etc. Volcano Ark requires filling in the quota URL via providers.ark.endpoint.

Example (from the README):

- insert:
    - id: coding-plan-quota
      name: dsh-coding-plan-quota
      config:
        thresholds: [50, 75, 90]
        defaultProvider: opencode-go
        providers:
          ark:
            endpoint: "https://<your-ark-quota-url>"

Credential resolution order (first match wins): providers.<id>.apiKey → apiKeyEnv or built-in environment variable name → DSH credentials service → $DSH_HOME/.credentials.yaml → some vendor CLI credential files. Credentials are only read on the host side and never sent to the browser.

The browser side fetches data via the same-origin route /plugins/dsh-coding-plan-quota/usage.json, supporting ?refresh=1, ?provider=<id>, ?debug=1.

Typical Usage and Development Notes

  1. Configure the corresponding environment variables or DSH credentials for the sources to be monitored. After restarting DSH, the ring should appear to the left of the model selector.
  2. Click the ring to switch between 5-hour / weekly / monthly views (refresh for balance-type sources); click the source row on the card to switch vendors.
  3. Changes to lib/host.js require a DSH restart; changes to lib/client.js only need a page refresh. The repository provides node scripts/verify.mjs for end-to-end checks.

The card text switches with DSH’s current UI language (Chinese / English); the plugin itself has no independent language setting.

Use Cases and Caveats

This plugin is suitable for developers who use coding plans such as OpenCode Go, GLM, Claude/Codex/Gemini/Copilot in DSH Web simultaneously, or who need to monitor multiple API balances. Note that: chatgpt.com, cloudcode-pa.googleapis.com, etc. may be unreachable in some networks; if Copilot is intercepted by a TLS proxy, you can set insecureTls: true. MiniMax must use browser cookies rather than an API key.

The DSH ecosystem advocates “everything is a plugin”; the SkillHub directory page is a community index and has no official affiliation with DeepSeek / 幻方.

Conclusion

dsh-coding-plan-quota consolidates plan windows and balances scattered across multiple places into a single ring in Composer’s tool row, reducing the discontinuity of “not knowing how much quota remains” before selecting a model. To learn more, visit the directory page skillhub.cn/plugins/sxwer001/dsh-coding-plan-quota and the source code github.com/sxwer001/dsh-coding-plan-quota.

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

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

Xiaoye