Introduction¶
DeepSeek Harness (DSH) adopts a plugin-based architecture and provides extension capabilities for developers. When developing or testing with multi-provider models, monitoring API balances is a common need. dsh-balance-mini is designed specifically to address the pain point of “checking the balance at any time,” providing persistent display and status indication without occupying additional interface space.
Plugin Introduction¶
dsh-balance-mini is a client plugin for DeepSeek Harness, developed by DaYanQAQ and licensed under MIT. It displays real-time balance status through a persistent badge in the bottom-left corner and traffic-light colors, and supports multi-provider and peak/off-peak time slot recognition.
Core Features¶
- Persistent Balance Badge: Displays the balance in the bottom-left corner of the DSH Web interface (format: Balance: ¥xx.xx · Updated at HH:MM). The badge smoothly adapts to sidebar width.
- Traffic-light Indicator: When the sidebar is collapsed, the badge shrinks into a round indicator. The color stays in sync with the amount text color: red (less than 10 yuan), yellow (10 to 20 yuan), green (20 yuan or more).
- Auto Refresh: Automatically queries the balance every 60 seconds; the top-right corner of the panel provides a manual refresh entry.
- Multi-provider Support: Supports DeepSeek, Kimi, and OpenRouter. The plugin automatically reads the configured API Keys from the DSH configuration file; the balance of any configured provider is available.
- Peak/Off-peak Indication: Based on DeepSeek official pricing, distinguishes peak hours (Monday to Friday 9:00–12:00, 14:00–18:00) and off-peak hours (other times). Off-peak price is half of peak price, and it displays a countdown to the next time slot switch.
- Automatic Chinese/English Switching: UI language follows browser settings.
- Security Boundaries: The API only accepts loopback address (127.0.0.1) access; API Keys are only read into local process memory, not written to disk, and not forwarded to third parties.
Installation and Activation¶
Requires DeepSeek Harness version @deepseek-ai/dsh >= 0.1.0-rc.6.
- In the terminal, run the installation command:
dsh plugin --profile web add dsh-balance-mini
- Restart
dsh webprocess and hard-refresh the page in the browser (typicallyCtrl+Shift+R). - If the balance badge appears in the bottom-left corner, installation is successful.
Configuration¶
This plugin is zero-configuration. It obtains the API Key by reading the DSH credentials file:
- Path:
~/.dsh/.credentials.yaml - Logic: For whichever provider’s Key is configured in Harness Settings-Models, the plugin automatically becomes available.
Configuration example:
refs:
DEEPSEEK_API_KEY: sk-xxxxxxxx # DeepSeek
MOONSHOT_API_KEY: sk-xxxxxxxx # Kimi
OPENROUTER_API_KEY: sk-or-xxxx # OpenRouter
After adding or removing a Key, reopen the balance panel to take effect.
Typical Usage¶
- View Details: Click the balance badge in the bottom-left corner to expand the details panel.
- Handling Unconfigured Providers: If a provider without an API Key is selected in the panel, a prompt is shown, and the balance is displayed as ¥0.00.
Notes¶
- The plugin runs based on the current dsh process permissions; API Keys are only processed in memory.
- Currently supported providers are DeepSeek, Kimi, and OpenRouter. Z.ai (Zhipu) and others are not yet integrated due to no public balance query API or incompatible API semantics.
Conclusion¶
dsh-balance-mini solves the daily need of DSH users to monitor balances in a minimal way. It is suitable for developers who frequently switch providers and pay attention to billing time slots.