
deepforce/dsh-balance
30Last commit Aug 15, 2026
dsh-balance DSH plugin
This plugin integrates two components: a slash command `/balance` that prints the full balance breakdown (topped-up, granted, total) in the session, and a web GUI readout in the composer-dock area showing a compact balance line with hover details, a top-up link, a refresh button, and an estimated session spend. The plugin also provides a daily-spend chart with historical data. All API calls are made from the host; the API key never leaves the host or appears in logs.
How to install the dsh-balance DSH plugin
dsh plugin --profile web add github:deepforce/dsh-balanceCopying does not run this command. Review the repository and version before installing the dsh-balance DSH plugin.
dsh-balance DSH plugin data source
dsh-balance DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-balance DSH plugin can do
- `/balance` slash command displays total, topped-up, and granted balance per currency in the session chat.
- Web GUI readout shows `Balance: ¥…` with hover details (topped-up/granted), a top-up link, manual refresh button, and estimated session cost.
- Daily-spend chart: hovering over the last-N-days summary shows an SVG bar chart with per-day spend, request count, and tokens.
- Session-cost estimate prices the session's cumulative token usage at DeepSeek's published per-million-token rates (peak/off-peak, model configurable).
- Bilingual readout follows the active DSH language (Chinese/English).
Where the dsh-balance DSH plugin fits
- Quickly check your DeepSeek account balance without leaving the chat interface.
- Monitor daily spending trends via the interactive bar chart to track usage over time.
- Estimate the cost of a conversation before sending messages, using the Session ≈ ¥… figure.
- Refresh balance on demand with a single click in the GUI readout.
- Easily navigate to the DeepSeek top-up page from the plugin's link.
Who the dsh-balance DSH plugin is for
- DeepSeek Harness users who need to manage their DeepSeek API account balance.
- Developers and power users who want to keep an eye on API costs directly from their workflow environment.
dsh-balance DSH plugin limitations
- Only works with DeepSeek API; requires a valid DeepSeek API key (set via environment variable or credential service).
- Session-cost estimate is approximate: it uses a fixed model (`estimateModel`) and ignores cache-write tokens; actual billing may differ.
- Tested only against DeepSeek Harness 0.1.0-rc.6 (web profile, Windows 11); compatibility with newer versions is not guaranteed.
- The daily-spend chart relies on persisted session history; if sessions are cleared, historical data may be lost.
dsh-balance DSH plugin: from the repository README
Quoted from the deepforce/dsh-balance README, the upstream source of the dsh-balance DSH plugin. Copyright remains with the original authors.
English | [中文](README.zh.md) A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) plugin that adds a `/balance` slash command and a composer-dock balance readout to the web GUI, querying the DeepSeek account balance live. It calls DeepSeek's official [Get User Balance](https://api-docs.deepseek.com/api/get-user-balance/) endpoint and returns the total, topped-up, and granted balance per currency. The API key is resolved through the credential seam (`ctx.credentials`) or the environment on every call — it is never written into configuration, into the returned text, or into the browser. ## Features - `/balance` — human slash command that prints the full balance breakdown in the session. - **Web GUI readout** — the conversation stats area (below the cache-hit figure) shows a compact `Balance: ¥…` line with hover details (topped-up / granted), a **Top up** link to the DeepSeek platform top-up page, a manual refresh button, and an estimated **Session ≈ ¥…** spend figure (hover shows the token buckets × unit prices). The readout copy is bilingual and follows the active dsh language (Chinese / English). The browser fetches the host's `/dsh-balance` route; th
Read the full READMERepository license: MIT
dsh-balance DSH plugin questions
How do I install dsh-balance?
Use the recommended command: `dsh plugin --profile web add github:deepforce/dsh-balance`. After installation, restart `dsh web` to ensure the client plugin table picks up the new entry. Alternatively, you can use the `--patch` overlay method with a YAML file as described in the README.
How do I use the /balance command?
Type `/balance` in the session composer (the input box where you type messages). The plugin will respond with a breakdown of your DeepSeek account balance, including total, topped-up, and granted amounts in CNY. The output appears in the chat session.
Where is the balance readout displayed in the web GUI?
The balance readout appears in the composer-dock area (the conversation stats area below the cache-hit figure). It shows a compact line like `Balance: ¥110.00 ⟳`. Hovering reveals the topped-up/granted split, and clicking the refresh button (⟳) updates the balance. The readout is bilingual and follows the active DSH language.
How do I configure the API key for dsh-balance?
The plugin resolves the API key through the DSH credential service first, then falls back to the environment variable specified by `apiKeyEnv` (default `DEEPSEEK_API_KEY`). Set the environment variable `DEEPSEEK_API_KEY` to your DeepSeek API key before starting DSH. The key is never hard-coded, printed, or sent to the browser.
What does the daily-spend chart show and how do I access it?
The daily-spend chart shows a bar chart of estimated spend for the last `usageDays` days (default 7). Hover over the `Last {days}d ≈ ¥…` summary in the GUI readout; a floating speech bubble appears with a titled SVG bar chart. Each bar shows date, amount, request count, and tokens on hover. Move the cursor away to close it.