Introduction

The plugin ecosystem of DeepSeek Harness (DSH) allows extending Web UI functionality. Developers often need to clearly view account balances and the current pricing period to control costs. The dsh-balance-usage plugin displays this information directly in the sidebar and estimates the cost of each conversation turn based on the official pricing rules.

What Is This

This is an open-source plugin maintained by LZ-jun, licensed under MIT. It relies on no third-party services and obtains data only through the DSH official account service and local session logs. It displays the balance and off-peak/peak status at the bottom-left of the sidebar and estimates the cost for each session and each turn in real time.

Core Features

The plugin displays the account balance at the bottom-left of the sidebar. When the sidebar is expanded, it shows a wallet icon, a balance amount capsule, and the period status (off-peak/peak). When the sidebar is collapsed (56px rail), it shows the amount capsule in compact mode, with the dot color still indicating off-peak/peak.
* Balance Status Coloring:
* Sufficient: green
* Low (default threshold: below 10 yuan): amber
* Zero: red
* Period Determination: A green dot indicates an off-peak period, and an amber dot indicates a peak period. The hover tooltip shows the balance, current period, and time remaining until the next switch.

Expanded Panel Details

Clicking the balance entry in the sidebar opens an upward panel containing the following information:
* Account Balance: Shows the total amount, recharge/gift breakdown, and balance source. Clicking the balance navigates directly to the official account page or recharge page.
* Current Pricing Period: Shows an off-peak/peak capsule, the current Beijing time, and a real-time countdown to the next switch.
* Peak Period (Peak Pricing): Lists Monday to Friday 09:00–12:00 and 14:00–18:00 (Beijing time), and notes that peak price = off-peak price × 2. Weekends and statutory holidays are priced at off-peak rates all day.
* Recent Usage Statistics: Provides estimated Token costs and request counts for today, the last 7 days, and the last N days; includes a daily Token bar chart for the last 14 days; and includes a detailed table split by model. Hovering over the bar chart shows details for that day.
* Interaction and Refresh: The panel is rendered via React Portal and supports closing by clicking outside or pressing Esc. It also supports an auto-refresh interval setting (default 60 seconds) and appearance theme switching (follow system/dark/light).

Session and Single-Turn Cost Estimation

The plugin estimates costs based on official peak/off-peak prices below the input box and next to each turn’s usage:
* Current Session Cost: Displays a capsule saying “Current session cost ≈ ¥x” in the dock area below the input box. Clicking it opens an upward panel showing peak cost, off-peak cost, request count, cache hit rate, and model information.
* Current Turn Cost: Displays a “Current turn cost ≈ ¥x” trigger on the right side of each turn’s usage line. Clicking it shows the detailed cost breakdown for that turn.

Pricing Rules and Data Sources

  • Pricing Rules: Follows the DeepSeek official pricing documentation. Peak periods are Monday to Friday 09:00–12:00 and 14:00–18:00 (Beijing time), with prices doubled. Weekends and statutory holidays are priced at off-peak rates all day.
  • Holiday Table: Includes the built-in statutory holiday table for 2026.
  • Evaluation Time: Peak/off-peak assignment is determined by the request initiation time (step/start event time); if unavailable, it falls back to the message completion time.
  • Data Sources: Uses only the DSH official account service and local session logs, with no third-party services.

Pricing Table

The plugin includes the official off-peak pricing table (yuan / 1M tokens). Peak period prices are calculated as ×2.

Model Input (cache miss) Input (cache hit) Output
deepseek-flash 1 0.02 4
deepseek-v4-pro 4.5 0.15 13.5
deepseek-chat (legacy) 2 0.5 3
deepseek-reasoner (legacy) 4 1 16

Install and Enable

This plugin is a standard DSH bundle package (package.json includes dsh.bundle.patch and dsh.client). After installation, it is automatically mounted by the profile’s bundle stack, with no need to manually modify configuration files.

Typical Usage

  • Click the balance entry in the sidebar to view the balance, countdown, schedule, and usage statistics.
  • Click the “Current session cost” capsule below the input box to view the breakdown details of total session cost.
  • Click the “Current turn cost” trigger on the right side of each usage line to view the cost of that turn.

Notes

  • Pricing follows official rules. Local estimates are based on the official price table and are not official billing.
  • It does not support precise boundary determination for cross-period requests; it is determined by request initiation time (step/start).
  • The plugin runs with the current DSH process permissions. Before installation, check the source code and license.

Conclusion

By providing intuitive display in both the sidebar and the input box, this plugin addresses developers’ need to monitor DeepSeek account balances and real-time costs. More details can be found on the plugin directory page or the GitHub repository.