DeepSeek Harness (DSH) is a client tool for agent development. However, in real-world usage, developers often find it difficult to monitor precise account balance changes and detailed cost consumption for each request in real time. Official billing data is usually delayed and does not provide itemized request-level analysis.

dsh-balance-stats is a client plugin for DSH. It reads local session logs, applies built-in official pricing rules, and calculates and displays real-time balance, estimated remaining runtime, and detailed cost breakdowns. The plugin is open-sourced under the MIT License. API keys are stored locally only and are inaccessible from the browser, ensuring safe usage.

Features

This plugin provides the following capabilities:

  • KPI dashboard: Displays balance, estimated runtime, and consumption for today, this month, and the current session in a floating capsule at the top-right corner and at the top of the settings page.
  • Budget control: Supports setting a daily budget limit. When today’s consumption exceeds the threshold, color changes (yellow/red) provide alerts.
  • Cache hit rate health warnings: Automatically shows a warning dialog when the cache hit rate is below 50%, prompting users to optimize their caching strategy.
  • Step-by-step cost breakdown: Lists the calculation process for each cost item, reconciles with official billing data, and includes breakdown statistics for input, output, and cache hits/misses.
  • Official pricing and deduction rules: Includes built-in official pricing tables, off-peak and on-peak pricing rules, and a direct link to the official pricing page.
  • Session filtering: Supports filtering by workspace, time range (all/today/yesterday/this week/this month), and title or ID.
  • Complete historical session statistics: Old sessions persisted on disk are also included in statistics, not just recently opened sessions.
  • Difference explanation: Explains the source of the minor discrepancy between local statistics and official billing, which is mainly caused by title generation and web search.
  • Six advanced capabilities: Includes off-peak cost-saving suggestions, top highest-cost requests, workspace cost rankings, billing reconciliation, pricing snapshot self-checks, and real-time spending for the current session.

Installation

Make sure DSH is installed and environment variables are configured. Run the following command in your terminal to install the plugin:

dsh plugin --profile web add "C:\dsh-plugins\dsh-balance-stats"

After installation is complete, restart dsh web and refresh the browser to use it.

Typical Usage

  1. View core metrics: Check the four large number cards at the top of “Balance & Consumption” on the settings page, or click the floating capsule at the top right to view estimated runtime, today’s, this month’s, and current session spending.
  2. Set a budget: Configure the daily budget limit in settings and monitor the progress bar changes.
  3. Filter sessions: Use the workspace dropdown menu, time filters, and title or ID search to quickly locate the consumption of a specific session.

Notes

  • Data differences: Because the plugin cannot track calls to “title generation” and “web search,” which are not recorded in local logs, local statistics usually differ from official billing by a small amount.
  • Startup time: The first time the panel is opened, it may take a few seconds to scan historical sessions.
  • Time determination: Off-peak and on-peak period classification is based on locally recorded event timestamps and may have minor second-level differences compared with official billing allocation.

Conclusion

dsh-balance-stats helps developers more precisely control spending on DeepSeek accounts through local calculations and real-time monitoring. The plugin maintainer provides a GitHub repository and a SkillHub catalog page for further reference.