Preface¶
When developing agents with DeepSeek Harness (dsh), checking the API account balance usually requires opening a separate console or billing page. Frequent window switching during development not only breaks workflow but also makes it difficult to intuitively judge “how much has been spent today.” dsh-balance-monitor is a dsh plugin designed for the web client: it places the DeepSeek account balance, a remaining balance progress bar, and today’s spending directly at the bottom of the sidebar, above the settings button. Below, we introduce its positioning, capabilities, and installation method.
What Is This¶
dsh-balance-monitor is published by community maintainer jelly-000 and categorized as a client-side plugin. It registers a minimalist card at the bottom of the dsh sidebar, displaying the DeepSeek API account balance in real time, a thin progress bar for the remaining balance ratio, and the amount spent today. The style uses official design tokens, and both expanded and collapsed forms are consistent with the dsh interface.
The current version of the plugin is 0.1.2, released under the MIT license. GitHub repository: jelly-000/dsh-balance-monitor; Community directory page: SkillHub entry.
Core Features¶
The README lists the following capabilities, all implemented through collaboration between the server and browser halves:
| Feature | Implementation |
|---|---|
| Real-time balance | Server calls GET https://api.deepseek.com/user/balance using DEEPSEEK_API_KEY from $DSH_HOME/.credentials.yaml (environment variables take precedence) |
| Today’s spending | The balance on the first successful query of the day is recorded as the baseline, persisted in $DSH_HOME/storages/balance-monitor.json; spending = max(0, baseline - current), top-ups won’t make the number negative |
| Progress bar | Current balance ÷ daily baseline, with a gradient from blue → amber → red across three levels |
| Location | Registered in the official sidebar.footer.action slot, positioned above settings |
| Collapsed state | When collapsed, it becomes a 36px circle, displaying a compact amount with a tooltip |
| Robustness | Polls every 60 seconds, refreshes when switching back to the tab; on upstream failure, retains the last data and marks it as stale (faded) without flashing errors |
Installation and Enabling¶
The browser-side bundle is a hand-written classic script with no build steps. Git installation requires no prepare script.
Install from GitHub:
dsh plugin --profile web add "github:jelly-000/dsh-balance-monitor#main"
Or from npm (after publication):
dsh plugin --profile web add dsh-balance-monitor
After installation, restart the Web UI:
dsh --profile web
The card will appear at the bottom of the expanded sidebar, above the settings button.
Typical Usage¶
After installing and restarting the Web UI, no additional configuration is needed—provided a valid DEEPSEEK_API_KEY is configured in $DSH_HOME/.credentials.yaml (or the corresponding environment variable is set).
Daily usage flow:
- Start
dsh --profile web, expand the sidebar, and view the current balance and today’s spending at the bottom. - When the sidebar is collapsed, the card becomes a 36px circle; hover to see the tooltip.
- The plugin polls automatically every 60 seconds; it refreshes immediately when switching back to dsh from another tab.
State file example ($DSH_HOME/storages/balance-monitor.json):
{
"date": "2026-08-14",
"dayStart": 100.0,
"lastTotal": 99.5,
"lastCurrency": "CNY",
"updatedAt": 1755200000000
}
How It Works and Security¶
A single plugin line serves two roles (dsh.bundle patch + dsh.client browser registry declaration):
- Server half (
lib/index.js) — Registers a/balanceRPC channel onctx.connection(loopback trust perimeter). Each call reads the API key, queries the balance API, calculates the daily baseline, and returns{ ok, value }. - Browser half (
lib/client.js) — Zero-dependency classic-script bundle, registers thesidebar.footer.actionentry, handles card rendering and polling.
Security-wise: The API key never leaves the server; the browser half can only see the balance number via the RPC channel; the channel uses a loopback trust policy; there is no telemetry, and network requests only point to the official balance endpoint.
Use Cases and Considerations¶
Suitable for users who frequently develop and debug agents within the dsh Web UI and want to monitor account balance and daily consumption within the same interface, reducing the need to switch to billing pages.
Please note the following before use:
- The plugin runs with the current dsh process permissions; you should review the source code and MIT license yourself before installation.
- Today’s spending is calculated using the balance from the first successful query of the day as the baseline; the baseline resets after midnight.
- When the upstream API is temporarily unavailable, the interface retains the last data and marks it as stale rather than displaying an error.
- SkillHub is an independent community directory and has no official affiliation with DeepSeek / High-Flyer; the plugin is not an official release.
Conclusion¶
dsh-balance-monitor consolidates the DeepSeek balance, remaining balance progress bar, and today’s spending into the bottom of the dsh sidebar. It involves minimal changes and integrates in a way consistent with official slot conventions. If you use the dsh web client for daily development, you can try it out with the commands above.
- Community directory: https://www.skillhub.cn/plugins/jelly-000/dsh-balance-monitor
- GitHub: https://github.com/jelly-000/dsh-balance-monitor