Preface¶
DeepSeek Harness (DSH) displays token usage at the bottom of the conversation, but when billed by token, looking at the numbers alone often makes it hard to immediately correlate “how much this specific round or session cost.” In long sessions, costs quietly accumulate, making it difficult to review past rounds; running out of account balance or exceeding the budget is often only realized after the charges are applied. The community plugin dsh-plugin-turn-cost (maintainer jerodji) displays the estimated cost for the current turn and the cumulative session cost at the end of each dialogue turn. It supports session budgets, balance threshold alerts, comprehensive session billing statistics, and Excel export, with RMB and USD priced according to their respective official price lists. This article introduces its positioning, capabilities, and installation usage; all amounts are estimates for reference only, please refer to DeepSeek’s official bill, the plugin does not participate in actual billing.
What is it¶
dsh-plugin-turn-cost is a client-side plugin for the DSH Web interface (requires >= 0.2.2-alpha.3 in package.json engines.dsh). It adds a display of “Turn / Session” costs below the token usage at the bottom of each dialogue turn; costs are calculated based on token usage in the session logs, built-in official price lists (RMB / USD sets), built-in statutory holiday tables for 2025–2027, and approximate exchange rates used solely for display (1 USD ≈ ¥7.1, only for certain third-party model conversion scenarios). Data is stored in local localStorage and is not uploaded to the server.
It is categorized as admin-security in the SkillHub Plugin Directory; source code and documentation can be found in the GitHub Repository (current package.json version 1.6.8, license MIT).
Core Features¶
Turn and Session Costs¶
After a dialogue ends, information similar to the following appears at the bottom: model name and reasoning tier, peak/valley markers (only for DeepSeek peak/valley pricing models), the current turn amount, and the cumulative session amount.
Usage 19.2k
DeepSeek-V4.1-Flash High (谷) Turn ¥0.189 Session ¥1.048
Clicking “Turn” expands the detailed cost breakdown for a single dialogue (turn ID, model, billing period, token statistics, and itemized amounts); clicking “Session” allows viewing cumulative tokens up to that turn, the statistical scope, and the session ID. The amounts for historical turns are fixed; subsequent dialogue will not rewrite previous numbers.
Sub-agents and Peak/Valley¶
In collaborative sessions, “Turn” automatically includes the costs of sub-agents attributed to that turn, with a “Sub-agent (N)” segment in the details; “Session” summarizes the cumulative sub-agent costs within that session (merged if the same sub-agent spans multiple turns), and is still an estimate. DeepSeek models determine peak (Beijing Time weekdays 09:00–12:00, 14:00–18:00) or valley (50% off) pricing based on the end time of the turn, displaying (峰) / (谷) after the model name.
Budget and Balance Alerts¶
In the input box toolbar (to the left of the model selector), there is a “¥ Budget N” button: allows viewing the used/current budget for the session and adjusting it, as well as viewing account balance, bonus balance, and the remaining total. When the session cumulative reaches the budget, the text turns orange as a reminder, without interrupting the dialogue. In Settings → “Billing Detail Statistics” → “Balance Alerts”, thresholds can be set separately for RMB and USD; alerts are triggered when below the threshold, supporting “Remind Later” and “Don’t Remind Again”.
Billing Detail Statistics and Excel Export¶
The dedicated settings page lists costs for each session (including the total of all sub-agent sessions, sub-agent sessions are not listed individually). Supports grouping by Workspace Directory / Workspace Tree / Single List, sorting by name or time, and filtering by Today / 7 Days / 1 Month / 3 Months / 6 Months / 1 Year; “Currency” can be switched between RMB and USD. After selecting sessions or groups, export to Excel; if nothing is selected, the export will prompt “Currently nothing is selected”. On the same page, “Display Items” allows toggling the footer display of “Turn”, “Session”, and “Budget”.
Pricing Details (Summary)¶
- DeepSeek Models: Estimated based on official pricing; official tables for RMB and USD are used separately without currency conversion.
- Third-party Models: Priced based on DSH’s built-in offline model directory (USD / million tokens); in RMB mode, some are approximated by ¥7.10 and marked with
≈. - Domestic Models (Zhipu GLM, Kimi, Qwen, Doubao / Seed, etc.): In RMB mode, use each vendor’s official RMB pricing (
prices/cny-models.json); in USD mode, use the built-in USD pricing tables, which are independent. - For subscription package usage, it displays “Consumed Subscription Quota” and is not included in the total monetary amount; web search / web scraping is billed by successful requests (only in the new Search/Fetch API, and only counted for DeepSeek models).
For more complete statistical rules, see the “Statistical Explanation” section in the repository README.
Installation and Enablement¶
The installation method provided in the README is: use DSH’s plugin_manager to install the repository URL, and after installation, force refresh the page (e.g., ⌘⇧R).
https://github.com/jerodji/dsh-plugin-turn-cost
Requires DSH >= 0.2.2-alpha.3; the README notes that version 0.2.2-rc.1 was fully functional in local testing, but versions lower than 0.2.2-alpha.3 cannot be installed due to dependencies on the settings page slot. You can also clone first and then install the local directory (this article does not cover the details of the clone step, please refer to the official README).
Typical Usage¶
- View Costs: After each turn ends, check the bottom “Turn / Session”; click the amount to see details, click blank space or press Esc to close.
- Set Budget: Click the “Budget” button in the toolbar, enter the amount and confirm; when exceeding the budget, the button text turns orange.
- Set Balance Alerts: Settings → “Billing Detail Statistics” → “Balance Alerts”, fill in RMB and USD thresholds.
- Summarize and Export: Settings → “Billing Detail Statistics” → “Session Billing Statistics”, select grouping, sorting, time range, and currency, check items and click “Export to Excel”.
- Control Display: On the same page, “Display Items” allows toggling the display of “Turn”, “Session”, and “Budget”.
When not loading older dialogue records, the plugin can still display correct numbers for the most recent turns based on local records; session names will sync after renaming.
Applicable Scenarios and Notes¶
Suitable for users who do agent development, run multiple sessions in parallel in DSH for a long time, or need to control costs or handle bookkeeping and reimbursement. The plugin runs on the browser side with the current DSH process permissions. It is recommended to read the repository source code and the MIT license before installation to confirm it meets your expectations for using local data and account interfaces.
Limitations include: only statistics token and estimated fees related to online tools; the balance comes from the DSH account interface; the interface is designed for DSH Web, and different versions of the UI structure may affect the display location; sub-agents and peak/valley pricing are approximate attributions; actual billing is subject to the official bill.
The DSH ecosystem advocates “everything is a plugin”; community directories like SkillHub are independent sites and have no official affiliation with DeepSeek / Huanfang.
Conclusion¶
dsh-plugin-turn-cost extends “how many tokens were used” to “how much each turn or session roughly cost,” adding budget, balance alerts, and session-level Excel export to facilitate daily cost control and review. To view the directory and installation instructions, visit the SkillHub Plugin Page; for development and issue feedback, see GitHub: jerodji/dsh-plugin-turn-cost.