Introduction

When using DeepSeek for conversations within DSH (DeepSeek Harness), the account balance and current session consumption are usually not displayed directly on the operation interface. dsh-deepseek-balance is a DSH plugin that persistently displays the official DeepSeek account balance and the current session’s consumption amount below the Web input box, refreshing every 15 seconds.

DSH’s plugin ecosystem emphasizes “everything is a plugin,” and the community directory is an independent site; this article only introduces this plugin based on verified information and does not write it as an official DeepSeek application.

What is this

Repository URL:

https://github.com/CN-Leo/dsh-deepseek-balance

One-sentence positioning: DeepSeek Account Balance Real-time Display Plugin (DeepSeek Harness / DSH).

The license in the verified materials is:

MIT

The version number in package.json of the verified materials is:

0.2.3

The two main problems it solves are:

  1. Quickly view the DeepSeek official account balance in DSH Web.
  2. Estimate and display how much has been spent on the current session based on DeepSeek’s official pricing rules.

Core Features

The following introduces the verified plugin capabilities.

The plugin will persistently display balance information below the DSH Web input box (conversation.composer.dock).

conversation.composer.dock

The display content includes the balance and the current session consumption. Example format is as follows:

DeepSeek 余额 ¥71.33 | 本会话 ¥4.85

The core capabilities are as follows:

  1. Automatically refresh balance and session consumption every 15 seconds.
  2. Calculate the current session consumption in real-time based on the latest DeepSeek official pricing.
  3. Retrieve balance data from the official interface:
GET https://api.deepseek.com/user/balance
  1. The API Key is parsed by the Host from the DSH credential database and does not enter the browser.
  2. Supports configuring DEEPSEEK_API_KEY via environment variables or $DSH_HOME/.credentials.yaml.
  3. Hovering over the balance bar allows viewing balance details, token usage by model, current period, and session consumption.
  4. Pricing is calculated per model (deepseek-v4-flash / deepseek-v4-pro) and distinguishes between peak and off-peak hours.

Installation and Enablement

The following introduces the installation steps.

If installing using the Git repository URL, the command in the verified materials is as follows, with the repository URL placeholder preserved:

dsh plugin add https://github.com/<你的用户名>/dsh-deepseek-balance

If the plugin source code is in a local directory, you can also use a local path to install:

dsh plugin add /path/to/dsh-deepseek-balance

After installation, dsh web needs to be restarted. The current process does not hot-load new plugins.

Restart dsh web after installation

Configuring DEEPSEEK_API_KEY is a required step. You can configure it via environment variables or write it to $DSH_HOME/.credentials.yaml:

DEEPSEEK_API_KEY: sk-xxxxxxxxxxxxxxxx

No need to restart the plugin after configuration. Credentials are parsed for every request.

The system side requires curl. Windows comes with curl.exe; on other platforms, curl must be in the PATH.

curl

Typical Usage

After installation and configuration, you can see the balance bar in the DSH Web session interface.

The balance bar is displayed below the session input box, for example:

DeepSeek 余额 ¥71.33 | 本会话 ¥4.85

When hovering over the balance bar, more detailed information can be viewed. The content mentioned in the verified materials includes:

各币种余额、账户可用状态、按模型分列 token 用量、当前时段、本次会话消费金额

The session consumption amount will be calculated per model based on the models actually used in the session. The verified pricing scope is deepseek-v4-flash / deepseek-v4-pro, distinguishing between peak and off-peak hours.

The following situations require attention:

  1. Non-DeepSeek models do not apply the DeepSeek price list and are not counted towards consumption.
  2. Cache writes are charged at the input price for cache misses.

Applicable Scenarios and Notes

This plugin is suitable for developers or intelligent agent workflow users who use DeepSeek accounts in DSH Web and wish to directly see the balance and current session consumption.

The following notes should be observed before use:

  1. The plugin parses DEEPSEEK_API_KEY on the Host side and runs related subprocesses with the current dsh process permissions. Before installation, you should check the repository source code, license, and dependencies.
  2. The API Key only exists in the curl subprocess arguments of the Host process; the browser side can only obtain the balance JSON.
  3. Host dependencies: credentials, subprocess, sandboxPolicy, webServer.
  4. Client dependencies: slots service, react.
  5. The system requires curl.

Uninstallation

If you no longer need this plugin, you can remove it using the following command:

dsh plugin remove dsh-deepseek-balance

Links

GitHub Repository:

https://github.com/CN-Leo/dsh-deepseek-balance

The directory page URL was not provided in the verified materials for this time; please refer to the actual DSH community directory site.