Introduction¶
When using DeepSeek Harness Web for sessions, each model invocation comes with token usage, but this usage data is scattered in the responses, making it difficult to review by session, model, or day.
dsh-cost-tracker is a DSH client plugin designed to record daily LLM call costs and supports multi-dimensional views by session, model, and day.
What is this¶
- Plugin Name:
dsh-cost-tracker - Maintainer:
lyfZhixing - Category: Client
- License: MIT
It solves the problem of: after installation, recording new model call usage in DeepSeek Harness Web, estimating costs based on the pricing table, and viewing an overview, by model, by session, recent calls, and price settings in the panel.
Core Features¶
Below are the verified capabilities.
-
Automatically record usage for each model call: input (miss), cache hit, output, and inference tokens.
-
Estimate costs based on the pricing table, in units of: CNY / 1 million tokens.
-
Support peak hour multipliers: By default, Beijing time 9-12 and 14-18 are 2x; weekends are calculated at valley prices all day.
-
Provide three entry points for viewing:
- Sidebar “¥ Cost Statistics” button
- “¥ Cost” in the session title bar on the right
- Current session cost readout below the input box
-
The panel includes: Overview, By Model, By Session, Recent Calls, Price Settings.
-
After price changes, historical records are recalculated based on the new price.
-
Only reads existing usage data from the API response for local calculation; does not call the model.
Installation and Enablement¶
First, execute the recommended installation command:
dsh plugin --profile web add dsh-cost-tracker
This command adds dsh-cost-tracker to the DSH Web plugin directory.
After installation, restart dsh web, then refresh the page. You will see “¥ Cost Statistics” at the bottom of the sidebar.
If installing from a domestic mirror results in a 404, you can temporarily execute:
dsh plugin --profile web add dsh-cost-tracker --registry=https://registry.npmjs.org/
Data is saved locally:
~/.dsh/cost-tracker.json
Uninstalling the plugin will not delete this data file.
Typical Usage¶
-
Open any session and use it normally; every model response will be automatically recorded.
-
Click the “¥ Cost Statistics” at the bottom of the sidebar to view Today, Last 7 Days, Cumulative, By Model, By Session, and Recent Calls.
-
Modify peak hours, default price, or model-specific prices on the “Price Settings” page.
-
After saving, historical records will be recalculated with the new prices.
Applicable Scenarios and Notes¶
Suitable for users who need to view costs in local DSH Web, especially those who wish to view LLM call costs by session, model, and day.
Notes before use:
- The plugin only records model calls generated after installation; historical calls cannot be traced back.
- The default price is an estimate and needs to be modified on the “Price Settings” page according to actual billing standards.
- The plugin contains no API keys or credentials and does not perform network reporting.
- The plugin runs with the current
dshprocess permissions; you should check the source code and license before installing. - License: MIT.
- The client has no TypeScript, no bundling, no external runtime dependencies, and must be written in the following format:
window.__ModuleLoader__.load({ id, factory })
- Changes to the host require restarting
dsh web; changes to the client take effect immediately by refreshing the page.
Conclusion¶
The value of dsh-cost-tracker lies in converting existing usage data into viewable cost statistics and performing calculations only locally.
- GitHub Link: https://github.com/lyfZhixing/dsh-cost-tracker
- Community Directory: This article has verified information but does not list the directory page URL. You can search for
dsh-cost-trackerin the DSH Community Directory.