When developing agents with DeepSeek Harness (DSH), monitoring API call quotas and balance is part of daily maintenance. The traditional approach often requires logging into a web console, which is not very intuitive. The dsh-deepseek-balance plugin solves this problem by integrating DeepSeek account balance directly into the DSH interface and providing an official top-up entry.
What Is This¶
stellight/dsh-deepseek-balance is a static dual-face plugin maintained by Stellight and open-sourced under the MIT license. It calls the official API to display account balance in real time within the page and provides a top-up entry.
Core Features¶
Real-time Balance
The plugin calls the official endpoint api.deepseek.com/user/balance and displays the available total balance, top-up balance, and gift balance (supports multi-currency CNY/USD).
Automatic Refresh
The balance refreshes automatically every 60 seconds and supports manually clicking “Refresh Now”. The interface includes a status light (green/yellow/red) and an “Updated at HH:MM:SS” timestamp.
Official Top-Up
Provides an “Official Top-Up ↗” button. Clicking it opens platform.deepseek.com/top_up in a new tab and provides an API Key creation entry.
Embedded UI
The card appears at the bottom of the left sidebar, above the Cordis Plugin option (sidebar.footer.action slot). It adapts to light/dark themes; when the sidebar is collapsed (rail), it displays an amount icon.
Key Management
Supports manually entering, replacing, or clearing the API Key. The interface only shows a masked value (sk-···xxxx).
Install and Enable¶
- Locate your DSH profile directory (default:
~/.dsh/profiles/web/). - Run the installation command in that directory:
npm install dsh-deepseek-balance
- Edit the profile’s
package.jsonand add the dependency and bundle entry:
{
"dependencies": {
"dsh-deepseek-balance": "1.1.1"
},
"dsh": {
"profile": {
"bundles": [
"dsh-deepseek-balance"
]
}
}
}
(The `cordis.patch.yml` inside the package is automatically applied as a bootstrap patch for the bundle on each startup; it is not consumed.)
- Restart DSH (run
dsh web). The card will automatically appear at the bottom of the left sidebar, without requiring extra approval or reinstalling each time.
Typical Usage¶
Key Retrieval Order
The plugin retrieves the API Key in the following order:
1. Session memory (the key entered by the user in the panel);
2. The process environment variable DEEPSEEK_API_KEY;
3. The DSH credential store ref DEEPSEEK_BALANCE_API_KEY (located in ~/.dsh/.credentials.yaml).
Applicable Scenarios and Notes¶
This plugin uses a static dual-face architecture with no build step. Communication between the client and the host uses same-origin HTTP routes (the page is served by dsh’s local web server), without relying on the dynamic-plugin-specific host.call mechanism.
Security Notes
The repository code does not contain any API key. The key is used only within the local process to call the official balance API; it is not persisted to disk and is not sent to third-party endpoints. Check the source code and license before installation.
Summary¶
This plugin gives DSH users the ability to directly manage DeepSeek account balance and top-up from the local interface, without frequently switching between web pages.