DeepSeek Harness (DSH) adopts the “everything is a plugin” philosophy. During use, developers often need to check account balances or detailed API usage. The default WebUI only displays the current context token next to the Send button, making it impossible to directly retrieve account balances and spending details. The following introduces the dsh-api-balance plugin, which adds a “Usage / Balance” tab toggle to the usage circle popup panel in the WebUI, used to display account-related information.
What Is This¶
dsh-api-balance is an API usage and balance plugin for DeepSeek Harness. The plugin was developed by the maintainer “Huli.” Because the maintainer has retinitis pigmentosa (cone-rod dystrophy type 15) and has a Grade 1 visual disability, they are currently unable to independently complete the npm package publishing process; therefore, no npm package is provided for now. Users need to install it from the GitHub source or via declarative configuration.
Core Features¶
- Balance / Usage panel: Switch between the “Usage” and “Balance” tabs in the usage circle popup panel in the WebUI.
- Account balance: Query the current account balance through the official DeepSeek API (
GET /user/balance). - Usage details: Display consumption data for the current day, the current month, and the last 30 days, including amounts, token counts, and per-model breakdowns, with charts.
- Automatic platform token retrieval: By default, it automatically scans the local browser login state to obtain the token; manual connection is supported as a fallback.
- Voice announcements: Integrates voice packs and TTS (built into the browser or a custom API), supports peak/off-peak billing notifications, and automatically matches the voice to the interface language.
- UI enhancements: Provides a red peak-hour indicator, improved scrolling in question windows, and other minor adjustments.
Installation and Enablement¶
Install from GitHub Source¶
Run the following command in a terminal to install the plugin from the GitHub source:
dsh plugin --profile web add github:Kihara777/dsh-api-balance
After installation, the dsh.bundle inside the plugin package points to cordis.patch.yml, and once activated, it takes effect as a layer for the profile.
If you want to uninstall it, you can run:
dsh plugin --profile web remove @kihara777/dsh-api-balance
Declarative Installation (NixOS)¶
NixOS users can use the nixkits.dsh module from NixKits for declarative installation. This approach locks versions with Nix, follows system generation updates, and provides reproducibility. The configuration example is as follows:
{
nixkits.dsh.plugins.packages = [{
package = pkgs.dsh-api-balance;
id = "api-balance";
name = "@kihara777/dsh-api-balance";
}];
}
Typical Usage¶
After installation, in the DeepSeek Harness WebUI, the usage circle to the left of the Send button will display the current context usage. Click the circle, and in the popup panel, switch to the “Balance” tab to view the account balance and spending details.
Use Cases and Notes¶
- Use cases: DeepSeek Harness users who need to manage API accounts in detail, monitor token consumption, and track balances.
- Note: The plugin runs with the permissions of the current DSH process. Before installing, it is recommended to review the source code and license (MIT). Due to the maintainer’s visual limitations, no npm package is currently available; please install it from source or via a Nix configuration.
The plugin solves the lack of account monitoring by adding a tab toggle next to the existing usage display in the WebUI. For more details, see the GitHub repository.