Introduction¶
When developing or debugging with DeepSeek Harness (DSH), monitoring the current session’s token consumption and estimated cost is a common requirement. The dsh-convo-cost plugin subscribes to the session event stream, calculates and displays usage and cost locally, and avoids repeatedly checking the official bill.
Plugin Overview¶
The plugin is maintained by user ljr282341583. Its core function is to track token usage and cost for the current conversation in real time. It displays a status line below the chat input box, showing “This conversation ¥x.xx · xx tok”, and supports hovering to view detailed call counts, input and output volumes, cost, and model details.
Core Features¶
- Real-time statistics: Subscribes to the session’s
assistant/messageevents and accumulates tokens locally. - Status line display: Shows the current conversation’s cost and token count below the input box.
- Hover details: Hovering displays input (including cache hits), output (including reasoning), call count, pricing mode, and the specific model.
- Automatic pricing: Based on the official DeepSeek price list, with support for switching between basic and peak/off-peak pricing.
- Model identification: Retrieves the model name from request headers; unknown models are counted as ¥0.
Pricing Logic¶
The plugin has been verified against the official DeepSeek price list and supports automatic pricing mode switching:
- Effective time: Effective from 2026-08-17 00:00 (Beijing Time).
- Basic price: Basic pricing is used before 08-17.
- Peak/off-peak pricing: After that, pricing switches automatically based on the time period.
- Peak hours (Beijing Time): 09:00-12:00 and 14:00-18:00 are billed at the peak price.
- Pricing basis: Follow the official bill. Plugin calculations do not include discounts, promotions, or platform markups.
Installation and Activation¶
- Install the plugin:
dsh plugin --profile web add dsh-convo-cost
- Restart
dsh web. After installation, ensure the plugin has been added todsh.profile.bundles.
Typical Usage¶
- After restarting
dsh web, the session status line automatically displays “This conversation ¥x.xx · xx tok”. - Run the test command to verify:
npm test
- Hover over the status line to view call count, input/output tokens, cost, and model details.
Notes¶
- Status line does not appear: You must restart
dsh webafter installation; make sure the plugin has been loaded correctly. - Always shows ¥0.00: The model name is not in the official price list (unknown model), or no
assistant/messageevent with usage has been generated. - Estimated amount: The displayed amount is an estimate and does not include discounts, promotions, or platform markups. Use the official bill as the source of truth.
- Hover details are empty: The projection must accumulate at least one
assistant/messageevent with usage; new conversations start at 0. - Price changes take effect: If the official price changes and you need it to take effect immediately, modify the
PRICINGtable andEFFECTIVE_ATinlib/index.js.
Conclusion¶
The plugin helps developers monitor costs intuitively through a simple status line and hover details. Project address: GitHub.