
pangzi499/dsh-balance-stats
30Last commit Aug 14, 2026
dsh-balance-stats DSH plugin
Displays three key figures in the composer dock bar: balance, this session cost, and total spent percentage. Clicking the bar opens a scrollable details card showing balance composition, model-level spend, token usage, and historical billing summaries.
How to install the dsh-balance-stats DSH plugin
dsh plugin --profile web add https://github.com/pangzi499/dsh-balance-stats.gitCopying does not run this command. Review the repository and version before installing the dsh-balance-stats DSH plugin.
dsh-balance-stats DSH plugin data source
dsh-balance-stats DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-balance-stats DSH plugin can do
- Reads the official DeepSeek balance API to show available, topped-up, and granted balances.
- Estimates the active conversation cost in real time through the composer-scoped projection.
- Calculates total spent percentage using accounting-based data after a JSON invoice import, or falls back to Harness local estimate.
- Provides a details card with spend today, last 7/30 days, per-model spend, token usage, and update time.
- Supports JSON invoice import from the private get_all_invoice endpoint for accurate historical spend.
Where the dsh-balance-stats DSH plugin fits
- Monitor API balance and top-up status directly within DeepSeek Harness Web.
- Track real-time costs of the current conversation session.
- Analyze historical spending across models and time periods.
- Identify token usage patterns for capacity planning.
Who the dsh-balance-stats DSH plugin is for
- DeepSeek Harness Web users who want to manage API costs.
- Developers building applications on DeepSeek and needing cost visibility.
dsh-balance-stats DSH plugin limitations
- Harness local spend is an estimate, not an official DeepSeek invoice.
- Historical invoice summaries depend on the private get_all_invoice response format, which may change.
- Invoice summaries are stored in browser-localStorage and do not sync across browsers or devices.
- Balance, invoice, and estimated-price currencies must match.
- Upstream changes to DSH client slots or projection APIs may require plugin updates.
dsh-balance-stats DSH plugin: from the repository README
Quoted from the pangzi499/dsh-balance-stats README, the upstream source of the dsh-balance-stats DSH plugin. Copyright remains with the original authors.
**English** | [简体中文](README.zh-CN.md) `dsh-balance-stats` is a balance and usage statistics plugin for DeepSeek Harness Web. It displays three key figures in the `conversation.composer.dock` bar below the conversation composer: ```text Balance ¥40.22 | This session ¥0.15 | Total spent 42.5% ``` Click the bar to open an interactive, scrollable details card with balance composition, Harness local usage estimates, model-level spend, token usage, and historical billing summaries. ## Quick install Make sure Node.js `>=22.19.0` is installed and `pnpm --version` works, then run: ```sh npx @deepseek-ai/dsh plugin --profile web add https://github.com/pangzi499/dsh-balance-stats.git ``` Start or restart Harness Web, then hard-refresh the browser: ```sh npx @deepseek-ai/dsh web ``` ## Screenshots   > DeepSeek Harness is still in developer preview. The client APIs and mounting slot used by this plugin may change in upstream releases. ## Compatibility - Tested with DeepSeek Harness: `0.1.0-rc.6` - Node.js: `>=22.19.0` - pnpm:
Read the full READMERepository license: MIT
dsh-balance-stats DSH plugin questions
How do I install dsh-balance-stats?
Make sure Node.js >=22.19.0 and pnpm are installed. Then run 'npx @deepseek-ai/dsh plugin --profile web add https://github.com/pangzi499/dsh-balance-stats.git' and restart the Harness Web profile with 'npx @deepseek-ai/dsh web'. Press Command+Shift+R to hard-refresh the browser.
How do I import historical invoices to get accurate total spend?
Sign in to platform.deepseek.com, open browser developer tools, copy the JSON response from 'https://platform.deepseek.com/auth-api/v0/users/get_all_invoice'. Click the statistics bar in the composer, paste the JSON into the field at the top of the details card, and click Import. Only successful top-up orders and valid grant orders are counted.
Is my API key or DeepSeek Platform cookie exposed?
No. The plugin reads the API key from the Harness credential 'DEEPSEEK_API_KEY' and never sends it to the browser. It does not request get_all_invoice or store cookies. Pasted invoice JSON is only parsed in memory and cleared after import.
How do I update the plugin to the latest version?
Run 'npx @deepseek-ai/dsh plugin --profile web update dsh-balance-stats' to update from the GitHub default branch. For local or tarball installations, run the add command again with the new path, then restart 'dsh web'.
Why does the total spent percentage differ from my actual DeepSeek invoice?
The plugin uses a local estimate based on Harness conversation logs and model prices, which may not include calls made outside Harness or deleted logs. For more accurate accounting, import a JSON invoice from the platform's get_all_invoice endpoint to calculate spend based on actual top-ups.