dsh-account-balance: Display DeepSeek account balance and model spending below the composer.

Preface

After running DeepSeek Harness for a while, a common issue arises: not knowing how much money is left in your account, or where the last few sessions actually spent their money. The bill requires scrolling through the Platform usage page one by one, or is simply ignored. dsh-account-balance moves this information next to the input box: the logged-in account’s balance is visible on hover, and clicking expands an estimate of spending by model for today, the last 7 days, and the last 30 days.

It is maintained by octisfall, is MIT-licensed, and targets DeepSeek Harness 0.2.x clients. The plugin itself is a pure npm package (dsh-account-balance@0.1.1) with no build steps.

I. Positioning and Maintainer

In a nutshell: add a read-only widget to the composer dock to display the current DeepSeek account balance, as well as the cost of local sessions calculated by model.

Whether it is worth using depends on your usage habits. If you just occasionally ask a few questions and check the bill on your desktop, the native Platform page is sufficient. If you work long-term in the terminal DSH, run many sessions, and switch models frequently, and don’t want to switch away every time to check the bill, this widget saves the cost of switching back and forth.

The community directory page shows 0 stars, indicating an early-stage plugin. The README is quite complete, but it is still recommended to run it yourself before deployment.

II. Core Features

The capabilities introduced below are all taken from the plugin’s README.

Balance

  • Displays the balance of the logged-in DeepSeek account, refreshing on mount, window focus regain, and every two minutes.
  • Shows the breakdown between top-up amount and bonus credit on hover.
  • Displays Balance — and gives a reason when login status is abnormal, wallet reading fails, or usage routing is unavailable, instead of silently showing nothing.

Spending by Model

Clicking the widget opens a panel showing daily, last 7-day, and last 30-day spending by model, with a button to open the Platform usage page. The total in the panel serves as a verification entry for the main bill.

Data Source

The balance uses Harness’s existing account Remote namespace (getBalance), and usage links are obtained via getState. Model-specific spending comes from routes registered by the plugin itself. All content displayed by the Client passes through Harness itself; there is no independent service, and no polling of Platform.

Text follows the Client’s locale service (Chinese/English), colors follow --dsw-alias-* theme tokens, so the widget follows the app’s theme and language.

III. Installation and Enabling

The official website provides two installation methods. The GUI goes via Settings → Plugins → Add; the CLI uses the plugin subcommand, which forwards to pnpm within the profile directory:

dsh plugin --profile <profile> add github:octisfall/dsh-account-balance

Replace <profile> with the actual profile name. The package declares a Cordis bundle patch and a web Client entry, so it will appear in the plugin list for that profile and start rendering after the page loads.

Before installing, confirm if the rates in prices.json need updating. The package pre-sets the prices published by the DeepSeek API for deepseek-flash and deepseek-v4-pro, in USD per million tokens. Simply modifying this file takes effect; the next time the panel is read, it automatically picks up the new rates without needing code changes.

IV. Internal Structure

The plugin is divided into Host and Client parts, which is the standard split for DSH bundles.

Side File Purpose
Host index.js Registers a read-only route GET /plugin/account-balance/usage. Collapses local recent session logs via ctx.sessionQuery, assigns each assistant/message to the model that was active at that step, prices it, and caches the result for 60 seconds.
Client client.js Registers a conversation.composer.dock entry, reads the balance via getBalance from the account namespace, and pulls the Host route above when the panel opens.

To verify if the Host part is working properly, you don’t need to open the UI; just use curl:

curl http://127.0.0.1:<port>/plugin/account-balance/usage

<port> is the port the current DSH process is listening on.

V. What That Amount Actually Is

This point deserves special mention because it determines what this widget can be used for.

Session logs store token counts, not invoices. The amount in the panel is an estimate: local session token counts multiplied by the rates in prices.json. Specific rules:

  • Peak/Valley pricing is determined by event time per step: Monday to Friday UTC 01:00–04:00 and 06:00–10:00 are charged at peak rates, the rest at half price. Chinese public holidays are not tracked; weekdays during holidays are charged at regular weekday rates.
  • Cache reads, cache writes, and new inputs are counted separately and billed at corresponding rates; cache writes are billed at the cache miss price.
  • When an unknown model is encountered, only the token count is shown, and the amount column shows —. The total for that period is not priced, rather than being quietly calculated at some default price.

The authoritative data is always on the Platform usage page linked in the panel. This widget is sufficient for making magnitude judgments between sessions (e.g., “Is the last three days mainly burning on v4-pro?”), but not sufficient for precise reconciliation.

VI. Privacy and Execution Boundaries

  • The route only reads token counts from locally existing session logs and uploads nothing.
  • The route runs on the local Harness HTTP server, located outside the /api bridge like other plugin routes, so it does not carry browser session authentication. Ensure the server binds to loopback; this is also the DSH default. It only exposes aggregated token counts and amounts, without prompts, messages, file paths, or credentials.
  • The plugin never reads or saves account tokens; the balance comes from Harness’s already-held account namespace.

It needs to be made clear here: the plugin runs under the permissions of the current DSH process and can read local session logs. You should check the source code and license before installing.

VII. Compatibility

The plugin claims to be built and verified on DeepSeek Harness 0.2.1-rc.5. It depends on interfaces like conversation.composer.dock, account Remote namespace, sessionQuery, and webServer. Once Harness renames or removes any of these, modifications will be needed here. The current badge is marked dsh-0.2.x.

VIII. Who Is It For

Suitable for people who work long-term in the DSH client and want to see the balance and model-specific spending next to the input box anytime, as well as those who want to confirm the impact of peak/valley billing on the bill.

Not suitable for scenarios requiring precise reconciliation, nor for using DSH exposed on non-loopback interfaces.

Conclusion

The value of this plugin lies in putting a number that normally requires switching to a browser into your workflow’s field of view, at the cost of the amount being an estimate based on local logs. It is in an early stage and relies heavily on internal DSH interfaces, so changes follow Harness versions.

Before installing, it is recommended to read index.js, client.js, and prices.json thoroughly. The directory page is at https://www.skillhub.cn/plugins/octisfall/dsh-account-balance, and the source code is at https://github.com/octisfall/dsh-account-balance (MIT License).

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye