Introduction¶
When calling DeepSeek models within DSH, there are two common requirements: checking how much balance remains on the DeepSeek Open Platform corresponding to the current DEEPSEEK_API_KEY, and tracking how much has been spent in total across local DSH sessions. The common practice is usually to go to the DeepSeek Open Platform to check the balance, and then manually check logs or record usage.
dsh-deepseek-balance is a personal use plugin for DSH that places these two types of information in the bottom-left entry point of DSH, reducing the need to switch back and forth.
What is this¶
Bob-Bo1/dsh-deepseek-balance is a personal use plugin for DeepSeek Harness (DSH). It is maintained by Bob-Bo1 and is licensed under the MIT License.
It solves the problem of viewing the DeepSeek Open Platform API balance within the DSH web interface, and viewing consumption statistics for locally saved DSH sessions.
Core Features¶
The verified capabilities are introduced below:
- Provides an entry point at the bottom left of DSH
- View DeepSeek Open Platform API balance
- View total consumption of locally saved DSH sessions
- View today’s consumption
- View consumption separately for Flash and Pro
- Read
DEEPSEEK_API_KEYfrom DSH credentials - Request the DeepSeek official balance API
- Recalculate consumption based on model and token usage in DSH sessions
- Provide local routes
GET /api/deepseek-balanceandGET /api/deepseek-balance/usage
The balance comes from the DeepSeek account corresponding to the current DEEPSEEK_API_KEY; the consumption comes from local DSH session records. The statistical scope of the two is different.
Installation and Enablement¶
First, install the plugin. Execute:
npx @deepseek-ai/dsh plugin --profile web add github:Bob-Bo1/dsh-deepseek-balance
If prompted with Ok to proceed? (y) for the first run, type y and press Enter. After seeing Done, start DSH:
npx @deepseek-ai/dsh web
Then open:
http://127.0.0.1:3080
If DSH is already running, press Ctrl+C in the running window first, then restart after installing the plugin.
If Windows PowerShell cannot execute npx, change npx to npx.cmd in the command:
npx.cmd @deepseek-ai/dsh plugin --profile web add github:Bob-Bo1/dsh-deepseek-balance
Configuration and Viewing¶
The plugin reads the following from DSH credentials:
DEEPSEEK_API_KEY
Configuration steps:
- Open DSH’s model settings.
- Configure the DeepSeek official API Key.
- Click “DeepSeek Balance and Usage” in the bottom left corner.
After the above steps, the page will display the balance and local consumption statistics. The plugin will read DSH credentials and request the DeepSeek official balance API; the browser page receives the balance and statistical results.
If there is no entry point in the bottom left after installation, press Ctrl+C in the DSH running window and execute:
npx @deepseek-ai/dsh web
Finally, refresh the webpage.
Data Security¶
- API Key is stored in the user’s own DSH credential storage.
- API Key will not enter the browser page.
- API Key will not be uploaded to this project, nor sent to third-party servers.
- Balance requests are only sent to
https://api.deepseek.com/user/balance. - Consumption statistics are only read from locally saved DSH session logs.
- The plugin will not upload session contents.
Do not write the API Key into README, code, screenshots, Issues, or GitHub Actions configurations.
Scope and Limitations¶
Consumption is recalculated based on model and token usage in DSH sessions. The current version does not automatically obtain the following data:
- DSH usage records on other computers
- Usage records of clients other than DSH
- Historical requests without saved token usage
- Independent consumption records of other API keys
Therefore, the consumption amount on the page is suitable for reference on local DSH usage, and is not suitable for being directly treated as a cross-device, cross-client, or full account bill.
If you have multiple API keys, please select one as the main key currently used by DSH first. When multiple keys belong to the same DeepSeek account, the balance cannot be summed up; when they belong to different accounts, they also need to be checked separately to avoid mixing the amounts.
Prices may be adjusted according to official announcements from DeepSeek. After adjustment, you need to update the price constants in the plugin and release a new version.
Use Cases and Notes¶
Suitable for users using the DSH web interface who need to check the current DEEPSEEK_API_KEY balance and local session consumption.
Before installation, you should check the source code and license. This plugin runs with the permissions of the current dsh process and will read DSH credentials, request the DeepSeek official API, and read locally saved DSH session records. The project license is MIT License, see LICENSE for details.
Conclusion¶
The value of dsh-deepseek-balance lies in consolidating balance queries and local consumption statistics into the DSH left sidebar, making it suitable for daily checking of the current key’s balance and local DSH usage.
Project URL: Bob-Bo1/dsh-deepseek-balance.