Preface¶
DeepSeek Harness (command name dsh) is an agent runtime open-sourced by DeepSeek AI, currently in developer preview. Its core philosophy is “Everything is a plugin”: models, tools, skills, sessions, sandboxes and UIs can all be replaced or combined via plugins. There is also an independent community plugin directory site deepseek-harness-plugin.com, which is not officially affiliated with DeepSeek / FangTian, and collects community repositories tagged with the dsh-plugin topic.
When using the DeepSeek model via the web interface daily, you often need to open another platform page to check your balance. Starting from 2026-08-17, the official API introduced peak-valley pricing according to Beijing Time: prices during peak hours (9:00–12:00, 14:00–18:00) are twice those during off-peak hours. If a session is still in progress but the billing tier has already switched, you can only check your statement afterwards without any prompts in the interface.
The dsh-balance maintained by crazywoola integrates this functionality into Harness’s own settings page and below the chat box: it uses the locally saved API Key to query the official balance and currently available models. The key is only used on the Host side and will not be sent to the browser.
This article is collated after cross-checking with the plugin directory page, GitHub repository README / package.json / source code, npm package page, and DeepSeek’s official balance API and pricing documentation. There are similarly named repositories on GitHub such as deepforce/dsh-balance and LemCAE/dsh-balance, with different functions and installation commands; this article only covers crazywoola/dsh-balance.
What is this¶
dsh-balance is a “tool and capability” plugin for DeepSeek Harness Web UI, maintained by crazywoola, with the repository address crazywoola/dsh-balance. The npm package name is @pinkbanana/dsh-balance, and the current version is 0.4.1 (released on 2026-08-17). It is licensed under MIT, primarily written in TypeScript, and requires Node.js ≥ 20. The GitHub repository was created on 2026-08-14. As of 2026-08-17, GitHub shows 19 stars; the directory page still showed 14 stars at that time, please refer to the repository page for the latest star count.
The short description on the directory page is “DeepSeek balance plugin for settings page”. The repository README provides a more complete explanation: query API balance and currently available models; the API Key is only used by the local Host and will not be sent to the browser. The dsh.client.platform field in package.json is set to web, and the client will inject slots for the settings page and below the session input box.
It solves a specific problem: you can view your total balance, top-up balance, and bonus balance, as well as which models your current key can access without leaving Harness to open the DeepSeek platform. A summary bar is also added below the chat box with an orange indicator light to remind you during peak hours.
Core Features¶
Balance and Models in the Settings Page¶
After installation, a “DeepSeek Balance” entry will appear in the settings sidebar. In the source code, it is hooked into the settings.section slot with an order of 21, and the README states that this entry is located below “Agent Presets”. The page is divided into two sections:
- DeepSeek API Balance: Displays total balance, top-up balance, and bonus balance by currency, as well as whether the account has available balance. The data comes from the official
GET /user/balanceAPI. According to the DeepSeek documentation, this interface returnsis_available, andcurrency(CNY/USD),total_balance,granted_balance, andtopped_up_balanceinbalance_infos. - DeepSeek Available Models: Lists the model IDs and providers accessible with the current API Key. The data comes from the official
GET /modelsAPI.
Both sections have a manual refresh button. The Host caches results by default for 30 seconds; when refreshing, the client will add the ?refresh=1 parameter to skip the cache and query again. The page will display the update time, with a “cached” label when the cache is hit.
Balance Summary Below the Chat Box¶
The client also injects a compact summary into the conversation.composer.dock slot, displayed below the input box of existing sessions. The summary concatenates total balances by currency, for example CNY … · USD …. In the source code, this summary automatically refreshes every 60 seconds (using the cache, so it will not call DeepSeek every time).
Starting from 00:00 Beijing Time on 2026-08-17, the official peak-valley pricing took effect. The plugin changes the indicator light of this summary to orange during peak hours and marks “Peak Hours” or “Off-Peak Hours”. The source code defines the peak windows as left-closed and right-open intervals: Beijing Time [09:00, 12:00) and [14:00, 18:00), with the rest being off-peak hours; the current time period is recalculated every 30 seconds, and the next switch time is prompted. The official pricing page states that “peak hours are 9:00 - 12:00 and 14:00 - 18:00 Beijing Time, and off-peak hour prices are half of peak hour prices”, which matches the window used by the plugin.
This function only provides tier reminders, it does not estimate the cost of the current session, nor does it modify model routing.
API Key Stays on the Host, Browser Only Receives Results¶
The plugin is split into two parts: Host and Web client:
- The Host injects
webServerandcredentials, and registers two local routes:/dsh-balance/api/balanceand/dsh-balance/api/models. When querying, it parsesDEEPSEEK_API_KEYvia the credential service (configurable via theapiKeyRefoption) and callshttps://api.deepseek.comusing a Bearer token. The default timeout is 10 seconds. - The browser only requests the above same-origin routes and receives JSON with the API Key removed. Both the README and the settings page copy clearly state that the API Key will not be sent to the browser.
In the default configuration, allowRemote is set to false: access to these two routes from non-local loopback addresses will return 403. baseUrl must be HTTPS; only HTTP requests pointing to localhost / 127.0.0.1 / ::1 are accepted for local testing purposes.
When no API Key is configured, the Host returns 401, and the interface prompts you to save your DeepSeek API Key in “Settings → Models”. Invalid keys, rate limits, timeouts, and upstream service unavailability will all be mapped to corresponding error messages on the interface, without returning upstream error details or credentials in the response.
Interface Text Follows System Language¶
The interface text has built-in Simplified Chinese and English, and is registered to Harness’s locale namespace dsh-balance, switching automatically with the system language. The navigation name is “DeepSeek 余额” in Chinese and “DeepSeek Balance” in English.
Installation and Activation¶
The installation command given on the directory page is:
dsh plugin add github:crazywoola/dsh-balance
For reproducible installations, the directory page requires pinning the commit hash:
dsh plugin add github:crazywoola/dsh-balance#commit
Replace commit with the actual commit hash from the repository. The plugin runs with the permissions of the current dsh process, and may execute code during installation; please check the source code repository and license before installing.
This plugin declares a web client, and the repository README recommends installing it to the web profile and installing the current version from npm:
dsh plugin --profile web add @pinkbanana/dsh-balance@latest
dsh --profile web
dsh --profile web will start the web interface, and the official repository states that the default address is http://127.0.0.1:3080. After installation, open the Web UI and go to “Settings → DeepSeek Balance”. The API Key can be saved in “Settings → Models”, or provided via the DEEPSEEK_API_KEY environment variable.
The two installation paths point to the same repository: the GitHub source is crazywoola/dsh-balance, and the npm package name is @pinkbanana/dsh-balance when published. Do not change github:crazywoola/dsh-balance on the directory page to other similarly named repositories.
Typical Usage¶
- Confirm that you can open the DeepSeek Harness Web UI locally, and have saved a valid DeepSeek API Key in “Settings → Models”, or exported the
DEEPSEEK_API_KEYenvironment variable. - Install the plugin according to the previous section and start it with the web profile.
- Open “Settings → DeepSeek Balance”. You will see “Querying…” on your first visit, followed by the total balance, top-up balance, bonus balance, and the list of models available with your current key.
- Click “Refresh Balance” or “Refresh Models” if you need the latest numbers. Repeated queries within 30 seconds will hit the Host cache by default.
- Return to an existing session, and a “DeepSeek Balance” summary should appear below the input box. The indicator light will be orange during peak hours, prompting when you will return to off-peak pricing; during off-peak hours, it will prompt the next time peak pricing will start.
You can also modify these configurations on the Host side (all from the Config interface in the repository’s src/index.ts, not verbal agreements in documentation):
| Config Option | Default Value | Meaning |
|---|---|---|
apiKeyRef |
DEEPSEEK_API_KEY |
Key reference name in the credential service |
baseUrl |
https://api.deepseek.com |
DeepSeek API root address |
timeoutMs |
10000 |
Upstream request timeout, range 1–60000 |
cacheMs |
30000 |
Cache time for balance and model lists, range 0–300000 |
allowRemote |
false |
Whether to allow non-local access to the query routes |
Keep the defaults unless you have special needs. Especially do not enable allowRemote without understanding the exposed attack surface.
Applicable Scenarios and Notes¶
It is suitable for developers who already use the official DeepSeek API in the DeepSeek Harness Web UI and want to keep balance and model list checks within the local interface. During the daytime when peak/off-peak switching happens frequently, the orange indicator light below the chat box is more timely than checking your statement afterwards.
You should be aware of these limitations in advance:
- Only covers the Web UI.
package.jsonmarks the client platform asweb, so the settings page and input box summary will not appear in the terminal TUI or other profiles. - Not a billing or session cost panel. It queries account balance and the
/modelslist, it does not count tokens for the current session or estimate costs based on unit pricing. Other similarly named community plugins may include/balanceslash commands or session fees, which are not this plugin. - Depends on saved official API Key. Without
DEEPSEEK_API_KEYor with an invalid key, the interface will only prompt you to save the key in “Model Settings”, it will not log you into the DeepSeek platform for you. - Only serves local traffic by default. The Host routes reject non-loopback requests. If you expose Harness to a local area network or the public internet, do not expect browsers on other machines to directly query the balance.
- Peak/Off-Peak reminders follow the official window. The reserve the right to adjust pricing. The plugin hardcodes the effective start time as 2026-08-17 00:00 Beijing Time; if the official adjusts the time window later, you will need to check if the repository has updated
src/client/pricing.ts. - The plugin runs with the permissions of the current dsh process. It may execute code during installation. Check the GitHub source code and MIT license before installing; use the
#commitpinning method from the directory page for production environments. DeepSeek Harness is still in developer preview, and the official README notes that there may be breaking changes.
Summary¶
dsh-balance connects the official GET /user/balance and GET /models APIs to DeepSeek Harness’s settings page, and adds a balance summary bar below the chat box. The API Key is only used on the local Host; starting from 2026-08-17, the summary indicator light turns orange during peak hours. It does not replace the platform billing statement or estimate single-session costs, but it reduces the need to switch back and forth between windows to check remaining balance and current pricing tier.
Directory page: https://deepseek-harness-plugin.com/zh-CN/plugins/dsh-balance/
GitHub: https://github.com/crazywoola/dsh-balance