Introduction¶
DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture, and its plugin ecosystem is independent of DeepSeek officially or High-Flyer Group. When developing or interacting with DSH, managing both DeepSeek and OpenRouter accounts simultaneously can lead to frequent manual balance checks, interrupting the workflow. This plugin aims to solve this pain point by providing a persistent dual-account balance chip in the conversation header of the Web interface.
What It Is¶
This is the client plugin dsh-account-balance, maintained by the developer 305037991x-pixel. It injects a card into the conversation header to display both DeepSeek and OpenRouter balances simultaneously. The plugin runs on the host side, does not depend on a specific version of the DSH core package, and supports automatic refreshing every 3 minutes.
Core Features¶
- Dual-source display: A single chip displays both DeepSeek and OpenRouter balances. The OpenRouter balance is calculated as
credit - used. - Detailed view: Hovering the mouse over the chip shows a tooltip with two sections:
- DeepSeek: total balance, credit, and bonus.
- OpenRouter: available balance, credit, and used.
- Fault tolerance: If one data source fails (for example, an OpenRouter API call fails), only that source displays an error marker, without affecting the display of the other source.
- Automatic refresh: Supports automatic refreshing every 3 minutes and provides a manual refresh button (refreshes both accounts).
- Smart caching: Balance data and timers use a module-level shared cache. Switching sessions does not trigger duplicate requests.
- Security: API keys are stored only in the host environment (
.credentials.yamlor environment variables) and are never exposed to the browser.
Installation and Enablement¶
Install the plugin via the command line:
dsh plugin --profile web add github:305037991x-pixel/dsh-account-balance
After installation, restart the dsh web service and perform a hard refresh to load the new plugin:
- Stop the currently running
dsh web. - Restart
dsh web. - Press
Ctrl + Shift + Rin the browser page to hard refresh.
If you are developing this plugin locally, you can use the install-into-dsh.ps1 script included in the package to register the local source code directory with link:. After modifying the source code, simply restart to make changes take effect; no reinstall is required.
Typical Usage¶
The plugin relies on the credential service provided by the host. Configure the following keys in $DSH_HOME/.credentials.yaml to display the corresponding balances (if missing, they are not displayed):
DEEPSEEK_API_KEY: sk-xxx
OPENROUTER1_API_KEY: sk-or-v1-xxx
After configuration, the balance chip will automatically appear in the conversation header.
Compatibility and Notes¶
- Decoupled from core version: All
@deepseek-ai/dsh-*core packages are declared as optionalpeerDependencies(range>=0.1.0-rc.6 <0.2.0). The plugin does not bundle copies of core packages; at runtime, it directly uses the core package running on the host. - Interface dependencies:
- Host side (
lib/index.js): Depends only oncredentialReffromdsh-credentialsandlaunchEnvironmentOffromdsh-launch-environment. - Browser side (
lib/client.js): Dependencies are provided by the host client module registry throughdsh.client.inject.
- Host side (
- Version-locking warning: Do not add core packages to
dependenciesand pin specific versions. If added, an old copy of the core package will appear inside the plugin directory. After the host upgrades its core version, this old package will shadow the host’s new package, causing the plugin load to fail withfailed to import. - License: MIT.
Summary¶
dsh-account-balance is a lightweight, non-invasive dual-account balance monitoring tool. Using DSH’s plugin mechanism, it provides a convenient balance lookup entry for the Web interface without modifying host core code. It is suitable for developers who need to manage both DeepSeek and OpenRouter balances.