Foreword¶
DeepSeek Harness (DSH) adopts a plugin-based architecture, allowing developers to flexibly extend functionality as needed. When debugging or deploying agents locally, real-time visibility into actual DeepSeek API token consumption and cost control is a key requirement. lstalu/dsh-quota-meter-plus is an enhanced DSH session quota monitoring plugin, aiming to address the lack of intuitive billing feedback and budget control.
Core Features¶
The plugin primarily provides the following capabilities:
- Actual token billing: Accrues costs by model and a configurable price sheet, supporting cache-hit, cache-miss, and output-tiered billing.
- Real-time progress bar: Displays a consumption progress bar above the input box, with a pulsing effect on the left when a request is issued and a cost badge popping up at the moment of deduction.
- Quota-exhaustion interception: Automatically intercepts new model calls when the budget limit is reached.
- Peak/off-peak pricing: Supports adjusting prices by time period (peak/off-peak) and custom time zones.
- Weekend discount: Supports billing at off-peak prices for Saturday and Sunday all day.
- Session-independent accounting: Accounting is tracked per session, sub-agent consumption is automatically merged into the parent session quota, and the quota bar displays the actual total spend.
- Balance calibration capsule: A floating panel in the top-right corner that shows the official balance, measured consumption, and the current session’s spent/remaining amount.
Installation and Activation¶
Any machine with DSH installed can be installed using the following command. The client side (progress bar/popover UI) takes effect after refreshing the browser, while the host side (accounting/interception) requires restarting the dsh web process.
dsh plugin --profile web add github:Lstalu/dsh-quota-meter-plus
Usage and Configuration¶
After installation, the plugin displays a consumption progress bar above the input box and a balance calibration capsule in the top-right corner. Click the refresh button inside the capsule to manually update the data. The API Key is also saved through the capsule and persisted to ~/.dsh/storages/quota-meter/config. (local machine only).
Notes¶
- Upgrade note: The default price sheet is updated with each version, but a local
prices.json(if it exists) overrides the defaults. After upgrading to a version with new prices, click “Reset” in the price popover or delete the configuration file to update the default prices. - Same-origin protection: Requests with an Origin header require the host to exactly match the request Host header; cross-origin requests always return 403.
- Pricing basis: The official 2026-08-21 page uses USD prices; this document converts them using the same day’s RMB-to-USD central parity rate of 6.78.