Introduction¶
When developing agents or scheduling tasks with DeepSeek Harness (DSH), API consumption is a core concern. Manually refreshing the webpage to check the balance is not only inefficient but can also cause you to miss important changes in billing. For this scenario, the following introduces the dsh-balance-mini plugin, which provides a lightweight balance monitoring solution for the DSH Web interface.
Positioning¶
dsh-balance-mini is a minimal balance monitor for DeepSeek Harness: a persistent balance badge, traffic-light color coding, multi-provider support, and peak/off-peak period indicators. The plugin is maintained by DaYanQAQ and is licensed under the MIT License.
Core Features¶
Persistent Balance Badge and Traffic-Light Indicators¶
The plugin provides a persistent balance badge in the lower-left corner, displaying the current balance and last update time in real time. It automatically adapts to the sidebar width. When the sidebar is collapsed, the badge shrinks into three small red/yellow/green lights for quick identification of the balance status:
* Red: balance is below CNY 10
* Yellow: balance is between CNY 10 and CNY 20
* Green: balance is above CNY 20
The color of the amount text follows the same rules.
Automatic Refresh and Manual Control¶
The plugin automatically queries the balance every 60 seconds. If you need the latest data immediately, you can manually refresh from the top-right corner of the panel.
Multi-Provider Support¶
The plugin supports three providers: DeepSeek, Kimi (Moonshot), and OpenRouter. It identifies configured API keys by reading the DSH credentials file, without requiring additional configuration.
Peak/Off-Peak Period Indicator¶
The plugin displays the current billing period based on DeepSeek’s official pricing:
* Peak hours: Monday to Friday, Beijing Time, 9:00–12:00 and 14:00–18:00
* Off-peak hours: all other times (including evenings, late night, lunch break, and the entire weekend). Off-peak pricing is half the peak price.
The panel displays a countdown to the next period switch.
Security and Language¶
- Local security boundary: the interface only accepts access from the loopback address (127.0.0.1); API keys are only sent to official endpoints, are not persisted to disk, and are not forwarded to any third party.
- Automatic Chinese/English switching: the interface language follows the browser settings.
Installation and Activation¶
Prerequisite: DeepSeek Harness (@deepseek-ai/dsh >= 0.1.0-rc.6).
- Run the installation command:
dsh plugin --profile web add dsh-balance-mini
- Restart the
dsh webservice. - Perform a hard refresh in the browser (Ctrl+Shift+R). The installation is successful when the balance badge appears in the lower-left corner.
Configuration and Usage¶
The plugin works out of the box with zero configuration; you only need to set the corresponding API key in the local credentials file.
Add the following content to ~/.dsh/.credentials.yaml (choose as needed):
refs:
DEEPSEEK_API_KEY: sk-xxxxxxxx # DeepSeek:platform.deepseek.com
MOONSHOT_API_KEY: sk-xxxxxxxx # Kimi:platform.moonshot.cn
OPENROUTER_API_KEY: sk-or-xxxx # OpenRouter:openrouter.ai
After adding or removing a key, reopen the panel to apply the change; no service restart is required.
Notes¶
- The plugin runs with the permissions of the current DSH process, and interface access is strictly limited to local use.
- When the panel is opened for the first time, a usage instruction popup appears. After clicking “Got it”, it will no longer be displayed.