DeepSeek Harness’s core philosophy is “everything is a plugin”. In practice, developers often need to track Token consumption and corresponding monetary cost. dsh-cost-stats is a client-side plugin that directly displays the USD cost of each dialogue turn, statistics charts, and an interactive spending timeline in the chat interface.
The plugin is maintained by thezavtrak-a11y and is designed to address the issue that DeepSeek Harness only passes Tokens instead of currency amounts. It calculates costs using a local rate table and integrates the results into the message action row, session summary, and standalone tab, without patching upstream logic.
Core Features¶
Per-turn USD Cost Chip¶
Every billable message displays a USD chip on the right side of the action row. The chip shows the total cost and breaks it down by function (tools, reasoning, reading), with icons used for differentiation. Clicking the chip reveals itemized details, including request/token counts, cost breakdown, and a token bucket table.
Interactive Spending Timeline¶
The timeline tool supports zooming, panning, and viewing cumulative costs. Idle compression is enabled by default; when a conversation pauses for more than 20 minutes, that interval is drawn as a hatched area to prevent inactive time from flattening the chart. Supported time ranges include 1 hour, 6 hours, 24 hours, 7 days, and full history.
Statistics Charts and KPIs¶
In the “Расход” tab, you can view cost KPIs, charts, rating, and the rate table. The charts include per-turn stacked tokens, cost distribution, time distribution, and more.
Session Cost Summary¶
Below the composer, you can view the total cost and remaining balance for the entire session.
Installation and Enablement¶
The plugin uses dsh.client and dsh.bundle.patch declarations, and installation is consistent with other DSH plugins.
# 从 checkout 安装或从已发布的副本安装
dsh plugin --profile <profile> add <checkout>
After installation, refresh the page to load the new plugin. Manual mounting requires cordis.patch.yml, and you must ensure Node version >= 22.
Typical Usage¶
- View Single-turn Cost: In a chat conversation, a USD chip appears on the right side of the action row for each turn. Click it to view detailed itemization.
- Analyze Session Spending: Switch to the “Расход” tab to view KPIs, charts, and model cost proportions.
- Analyze Traffic Trends: In the timeline tool, use the mouse wheel to zoom, drag to pan, or double-click to reset the view.
- Monitor Session Budget: Below the composer, view total session cost and remaining account balance.
Notes¶
- Local Rate Table: DSH only passes Tokens, so the plugin must rely on a local rate table to calculate accurate monetary costs.
- Fallback Handling: When precise billing is unavailable, data will be reconstructed from the request and marked with
≈; if a specific route is missing, the corresponding block will not be displayed. - License: The plugin uses the MIT license.
- Dependencies: Installation and runtime require Node.js >= 22.
Summary¶
dsh-cost-stats solves the difficulty developers face in intuitively perceiving single-turn and overall session spending by embedding cost data directly into the DeepSeek Harness user interface. It provides complete cost analysis capabilities from the micro level (single-turn chips) to the macro level (timeline and charts).
- Project Home: https://www.skillhub.cn/plugins/thezavtrak-a11y/dsh-cost-stats
- GitHub: https://github.com/thezavtrak-a11y/dsh-cost-stats