Introduction¶
The plugin ecosystem of DeepSeek Harness supports extending the Web UI’s functionality through configuration. For developers who need to control costs precisely, monitor their account balance closely, and take advantage of off-peak discounts, manually checking pages or relying on temporary dynamic plugins is inefficient. The dsh-deepseek-cost-watch plugin integrates off-peak schedules, real-time account balance, and session cost estimation directly into the Harness Web UI, providing a way to track cost status without leaving the application.
Plugin Information¶
- Name:
webificio/dsh-deepseek-cost-watch - Author: Webificio
- Category: Web Tool
- License: MIT
Core Features¶
This plugin replaces two features that previously required dynamic generation through a single install package, providing the following capabilities:
- Off-peak status badge: Displays a floating card in the bottom-right corner of the interface. The card shows in real time whether the current period is off-peak or peak. Green indicates a 50% discount, while amber indicates peak time. The card includes a countdown showing the time until the next peak/off-peak transition. It also displays the fixed discount windows in both UTC and the local timezone, including a day-boundary indicator.
- Account balance display: Shows the remaining balance of the DeepSeek account. The balance data is fetched on the Host side, and the API Key is not exposed in the browser, ensuring security. Manual refresh is supported by clicking, and the system also automatically polls every 5 minutes (the Host side has a 60-second cache). If the balance is low, the amount is displayed in amber.
- Session cost estimation: Located above the chat editor. The estimate is calculated based on session history using the rates in effect when the requests occurred, rather than only the current rates. The displayed information includes estimated total cost, current balance, input/output token consumption, cache hit status, and model information.
Installation and Enablement¶
The plugin must be installed into the web profile using the dsh plugin command.
- Run the installation command in the terminal:
dsh plugin --profile web add github:Webificio/dsh-deepseek-cost-watch
- After installation, you must restart the
dsh webprocess for the configuration to take effect:
dsh web
- After restarting, refresh the browser page to see the off-peak card in the bottom-right corner and the cost row above the editor.
Usage Notes¶
- View off-peak status: The card is expanded by default and shows detailed schedule information. Press the keyboard
–key to collapse it into a pill shape (for example,PEAK · 18m 04s). Click the pill to expand it again. - Refresh balance: Click the balance row in the card to immediately fetch the latest balance from the Host side.
- View cost details: Click the cost row above the editor (shown by default as a colored dot and an amount) to expand detailed token consumption and rate calculation information.
Technical Details¶
- Runtime environment: The plugin consists of two parts: a Host side and a Browser side. The Host side is responsible for fetching the balance and aggregating session logs for cost calculation, while the Browser side is responsible for rendering the UI. Balance requests are sent only to
api.deepseek.com, and the API Key is stored only in the Host process. - Requirements: DeepSeek Harness version 0.1.5-rc or later is required, and
pnpmandgitmust be configured in the system PATH.
Cautions¶
- Not a billed amount: The cost estimates provided by the plugin are based on the official rate sheet but are not necessarily equal to the final billed amount.
- Dependency version: Ensure that the Harness version meets the requirements; otherwise, the plugin configuration may not be recognized.
Summary¶
dsh-deepseek-cost-watch is suitable for developers who need to monitor DeepSeek API consumption in real time during development and leverage off-peak discounts. By moving calculation logic to the Host side, it provides intuitive UI feedback while maintaining security.