Introduction¶
The plugin ecosystem of DeepSeek Harness (DSH) allows users to extend functionality based on their needs. When using multi-provider configurations, quickly checking the balance status associated with the current model is a frequent requirement. dsh-balance-chip aims to address this issue by providing a visual balance ring in the input toolbar, enabling developers to keep track of quota status without switching pages or manually querying.
What It Is¶
dsh-balance-chip is a client-side plugin for DeepSeek Harness, maintained by developer O1dZ and licensed under the MIT License. It displays balances through a ring, tooltips, and a solid-color details panel. The ring is positioned to the left of the model selector. The plugin refreshes automatically based on the model selection in the current session, updates the data once every 60 seconds, and can read balances without requiring manual credential input.
Core Features¶
- Persistent loading and state management: As a standard persistent plugin package, it is loaded at startup using a bundle patch. Restarting Harness does not require recreating dynamic scripts, and the previous selection is automatically cleared after switching models, avoiding data confusion.
- Balance display and refreshing: It displays the current provider, model, balance details returned by the API, update time, and a manual refresh button. Late-arriving query requests do not overwrite newer provider data. If a refresh fails, the last balance is retained and marked as stale.
- Theme adaptation and interaction: The ring, tooltips, and details panel automatically follow light and dark themes. The details panel can be closed by pressing the
Esckey or clicking outside the panel. - Fault tolerance: Amount, currency, and raw quota are displayed separately. The plugin does not treat missing credentials, insufficient permissions, timeouts, unsupported endpoints, or abnormal responses as a zero balance, ensuring data accuracy.
- Automatic configuration resolution: Automatically uses the enabled configuration of the selected provider, so users do not need to manually enter the Key again.
Installation and Activation¶
This project has not been published to npm and must be installed from a source package. The following uses the Windows desktop profile as an example; replace the relevant paths on other systems. Before installing, make sure Harness is closed and that Git and pnpm are available.
- Clone the repository
In any working directory, run:
git clone https://github.com/O1dZ/dsh-balance-chip.git
- Add to the Profile
Stay in that directory and run the installation command (without running dependency installation scripts):
pnpm --dir "$env:USERPROFILE\.dsh\profiles\desktop" add --ignore-scripts ("file:" + (Resolve-Path '.\dsh-balance-chip').Path.Replace('\', '/'))
-
Configure the Bundle
Open thepackage.jsonfile in that profile directory, appenddsh-balance-chipto thedsh.profile.bundlesarray, and preserve the existing bundles. -
Start Harness
After fully starting Harness, open a session and select the configured provider model. After the first installation or a host code update, Harness must be fully restarted; refreshing the web page cannot replace modules that are already loaded.
Typical Usage¶
- Check balance: Hover the mouse over the ring on the left side of the input toolbar to view a concise balance; click the ring to expand a solid-color details panel.
- Automatic refreshing: When switching models, the ring immediately refreshes to show the balance for the new model; in non-switching states, it updates automatically once every 60 seconds.
- Manual refreshing: Click the refresh button in the details panel to force an update.
Applicable Scenarios and Caveats¶
- Compatible version: Targeted at Harness 0.2.0-rc.2. Other versions and operating systems have not been verified.
- Supported scope: Supports DeepSeek API (including custom route names), DeepSeek Account, Moonshot (China/International), SiliconFlow (China/International), OpenRouter, and custom compatible gateways. Standard OpenAI, Anthropic, and Google model keys, as well as OAuth subscription quotas, are not supported.
- Security and privacy: Balance requests are executed only on the host side. Keys are resolved from the Harness credential service, and endpoints, credential values, and raw error text do not enter the client. Only GET requests are used, requests are same-origin, redirects are forbidden, and plain HTTP to non-local hosts is not used.
- Display note: The CNY ring uses ¥50 as a visual reference, and the USD ring uses $10 as a visual reference; this does not represent the account’s balance limit.
- Privacy protection: Do not submit Keys, session Cookies, OAuth tokens, real profiles, or account information in Issues, PRs, screenshots, or logs.
Summary¶
dsh-balance-chip provides intuitive multi-provider balance management in DeepSeek Harness through a local client plugin. It follows DSH’s plugin architecture, uses host-side permissions to securely fetch data, and is suitable for advanced users who frequently switch models and monitor their quotas. For more details, see the plugin directory or the source repository.