Introduction¶
In the DeepSeek Harness (DSH) Web GUI, a single session often contains multiple rounds of replies, cache reads and writes, and output tokens. If the price is adjusted later, recalculating historical costs using the current price would cause the cost of the same session to fluctuate constantly.
DSH Cost Meter addresses this issue by providing cost tracking capabilities: snapshot-anchored per-turn billing, account balance display, and cost estimation during the streaming process.
What is it¶
DSH Cost Meter is a cost tracking plugin for the DSH Web GUI. Its npm package name is @gamegeek-saikel/dsh-cost-meter, its GitHub repository is https://github.com/Saikel-Orado-Liu/dsh-cost-meter, and its license is MIT.
The problem it solves can be summarized as: ensuring that the cost of every completed round of replies is anchored to the price snapshot at the time of that usage event, so subsequent price changes will not overwrite the already recorded session row.
Core Features¶
The following are the verified plugin capabilities:
- Per-turn Cost: Provides snapshot-anchored per-turn cost, which is the cost per round based on a price snapshot anchor.
- Account Balance: Retrieves balance via
GET /user/balance, caches it for 60 seconds, and limits it to a single flight request. - Cost View Tab: Provides a cost view tab for viewing cost information.
- Per-Message Cost Chips: Provides per-message cost chips to display cost at the message level.
- Header Real-time Estimation: Provides a header pill with live streaming estimates; streaming estimates use the current price, and are replaced by precise anchored values after the step is completed.
- Peak/Off-peak Pricing: Supports peak/off-peak aware pricing.
- Subagent Cost Aggregation: Supports subagent cost aggregation.
- Pricebook Snapshots: Uses append-only pricebook snapshots to avoid re-calculating completed usage due to subsequent price changes.
- Interface Language: Provides a Simplified Chinese and English interface.
Installation and Enabling¶
Confirm that the DSH version falls within the plugin’s declared range before installation:
DSH >=0.1.1-rc.1 <0.2.0
Host requirements for Node:
Node ^22.19.0 || >=24.0.0
Use pnpm@11.7.0 for the development environment:
pnpm@11.7.0
Use the official DSH CLI to install the plugin to the web profile:
npx @deepseek-ai/dsh plugin --profile web add @gamegeek-saikel/dsh-cost-meter
After installation, start the DSH Web GUI:
npx @deepseek-ai/dsh web
Typical Usage¶
After installation, the plugin provides the following verified interface and behavior in the DSH Web GUI:
-
Composer Dock Readout: Displays anchored session spend and account balance, refreshing every minute.
-
Cost View Tab: Shows the total session cost, categorized totals, a list of subagents, and the anchored ledger for each round of replies.
-
Per-Message Cost Chips: Displays cost information on a per-message basis.
-
Header Pill: Displays anchored total or live estimate during streaming; click to enter the details panel.
If a manual refresh is required, call:
POST /cost-meter
The request body is:
{"action":"refresh"}
Note that the /cost-meter route only responds to loopback or declared trusted host requests, so it should only be used in a local or explicitly declared trusted host environment.
Use Cases and Notes¶
DSH Cost Meter is suitable for users who need to view session costs, account balances, and subagent cost aggregation within the DSH Web GUI. For scenarios where historical costs should not be overwritten by subsequent price changes, its snapshot-anchoring mechanism is particularly useful.
It is recommended to check the source code, license, and dependency scope before installation. The plugin runs within the DSH process and inherits the permissions of the current dsh process; therefore, install only from trusted sources and confirm that the MIT license and code behavior align with expectations.
Conclusion¶
The value of DSH Cost Meter lies in separating “the cost seen now” from “the cost billed at the time”: the streaming phase provides current price estimates, and after step settlement, it anchors to the price snapshot, while balance and cost views are centrally displayed within the DSH Web GUI.
GitHub repository: https://github.com/Saikel-Orado-Liu/dsh-cost-meter
npm package name: @gamegeek-saikel/dsh-cost-meter