Introduction¶
DeepSeek Harness (DSH) uses a plugin-based architecture, allowing developers to extend functionality as needed. For developers who need to check API consumption frequently, existing monitoring solutions often require browser permissions or have complex configuration. The dsh-balance-status plugin solves this problem by integrating DeepSeek account balance and usage information directly into the bottom status line of the DSH Web interface. It requires no extra pop-up windows or complex configuration, providing lightweight monitoring.
What Is This¶
This is a lightweight plugin maintained by yknBugs for querying DeepSeek account balances. It appends balance information to the bottom status line of the DSH Web interface and provides a detail panel that opens on left-click, allowing users to intuitively view the balance, top-ups, bonus credits, and usage consumed by the current conversation and process. The plugin uses balance-delta accounting and does not rely on a pricing table.
Core Features¶
- Status line integration: Appends a balance display after the DSH default status line (for example,
x rounds xx steps · xx tok/s xx M tok · cache hit xx%). - Usage detail panel: Left-click the balance to open a detail panel containing the balance, top-ups, bonus credits, current conversation used, and current process used.
- Force refresh: Clicking the balance can force an immediate data refresh, bypassing the cache.
- Auto-refresh policy: Refreshes automatically every 5 minutes by default, aligning with the latency of the DeepSeek balance API.
- Balance-delta accounting: Does not depend on external pricing tables; calculates usage based on balance differences, so price adjustments do not affect the calculation result.
- Unconfigured state: When no API Key is configured, the status line displays “Balance Unconfigured”.
Installation and Activation¶
The plugin can be installed from a local tarball or a GitHub repository.
Local Tarball Installation (Recommended)¶
Installing by directly copying the source directory can cause the plugin to stop working. It is recommended to package it before installing.
# 1) 在插件目录执行打包命令
cd <插件目录>
pnpm pack
# 2) 安装打包后的 tarball 文件
dsh plugin --profile web add file:<插件目录>\dsh-balance-status-1.0.2.tgz
After installation, restart the dsh web process.
Install from a GitHub Repository¶
If pnpm reports that build scripts are blocked, add this package name to allowBuilds in pnpm-workspace.yaml.
dsh plugin --profile web add github:<用户名>/<仓库名>
Configuration and Usage¶
- Configure credentials: Set
DEEPSEEK_API_KEYon the DSH credentials page. This is required to query the balance. - Configure Base URL (optional): If you need to route through an internal gateway, configure
DEEPSEEK_BASE_URL. The plugin automatically follows thebaseURLofllm-deepseekin DSH settings. - View and refresh:
- Refresh the browser page; the status line should end with
Balance ¥xx.xx. - Left-click the balance: Forces an immediate refresh and opens the detail panel.
- Close the panel: Click a blank area or press Esc.
- Auto-refresh: Refreshes automatically every 5 minutes by default. Clicking can interrupt it and force a refresh.
- Refresh the browser page; the status line should end with
Implementation Details and Limitations¶
- Security mechanism: API keys do not enter the browser, and the balance query endpoint is accessed locally only. It is recommended to bind DSH to
127.0.0.1. - Data persistence: The “current conversation used” and “current process used” data are stored in the host process memory, and the data will be lost after the process is restarted.
- Display precision: The balance endpoint has a granularity of ¥0.01, so small amounts of consumption may not be reflected.
- Session consumption: When multiple conversations are running simultaneously, sessions may include each other’s consumption. This is an inherent limitation of balance-delta accounting.
- Feature scope: It does not support image generation, animations, or session history.
- DSH version compatibility: Requires DSH version 0.1.7-rc.2 (compatible with 0.1.5-rc.x).
License and Ecosystem¶
This plugin is released under the MIT License. Its balance endpoint and accounting approach reference the open-source project DeepSeek-Balance-Whale-Widget. The DSH plugin ecosystem is independent from DeepSeek’s official ecosystem and aims to build a flexible extension system.
- GitHub repository: https://github.com/yknBugs/dsh-balance-status
- DSH ecosystem directory: https://www.skillhub.cn/plugins/yknBugs/dsh-balance-status