Introduction¶
DeepSeek Harness (DSH) records the token usage of every model request within the session: Composer has a counting capsule and cache hit rate, and the Statistics page can also break it down by step. These numbers can explain “how many tokens were used,” but they cannot answer “how much this conversation will roughly cost,” nor will they hint that a request sent at 14:05 will be billed at peak unit prices.
To estimate manually, one usually has to open the vendor’s price list, check Beijing time to judge peak vs. off-peak hours, and calculate based on the cache hit/miss and output volume for each request. dsh-session-cost is a client plugin for DSH that converts existing usage records in the session into RMB, displaying them in a fixed-width card in the top right of the chat area: accumulated amount, bucket details, peak/off-peak ratio, and the currently active price table. This article introduces its positioning, capabilities, and installation methods; the factual basis is the project’s GitHub README and package.json.
What is it¶
dsh-session-cost is released by community maintainer menzi11, license MIT, current package version 1.0.0, categorized under model inference related capabilities. It is a client plugin for DeepSeek Harness: no build steps, no runtime dependencies, and no extra internet connection required after installation to calculate prices in the browser. The plugin overlays “amount” next to the conversation instead of replacing Harness’s built-in token statistics. The card is clearly labeled as an estimate, not an official bill.
Core Features¶
Cost and Bucket Ledger¶
The card reads the session events currently loaded by the client, extracting usage from each assistant/message’s data.usage (in streaming scenarios, falling back to the last usage block) and each assistant/attempt. Usage is keyed by turn:step, and retries overwrite old samples of the same step to avoid double billing. The model name is primarily taken from the message’s source.model, otherwise the last request/header is used.
Each bucket (input cache miss, input cache hit, cache write, output) displays the token count and the actual amount charged to that bucket; the bottom price table is consistent with the bucket columns, avoiding “one price on the table and another in the bill.”
Peak/Valley Split and Current Tier¶
Peak hours are Monday to Friday 09:00–12:00 and 14:00–18:00 (Asia/Shanghai); nights and weekends are charged at off-peak rates. A list of statutory holidays is not built-in, but weekends are handled; the settlement time determines the tier, so a single request crossing a boundary may result in a tier deviation.
The card uses segmented bars to show the peak/off-peak amount ratio, labeled “peak · n requests” and “off-peak · m requests”. Whether it is peak or off-peak is shown via a badge, accompanied by a countdown explaining when it switches—helpful for deciding whether to start a long-running task immediately or wait until after 18:00.
Unit Prices and Model Mapping¶
Prices are constants written in client.js; vendor price changes require code modification and page refresh, with no configuration page. Off-peak price (CNY / 1M tokens), peak is 2× off-peak:
| Model | Input (cache hit) | Input (cache miss) | Output |
|---|---|---|---|
deepseek-flash |
0.02 | 1 | 4 |
deepseek-v4-pro |
0.15 | 4.5 | 13.5 |
deepseek-v4-flash and deepseek-v4-flash-vision-exp follow the Flash price list; other unrecognized model names are charged at Flash rates and labeled as hypothetical.
The interface displays peak and off-peak unit prices side-by-side (cache hit, cache miss, output), highlighting the currently active column for easy comparison of the 2× relationship and the price difference between cache hit and miss (README uses Flash as an example, explaining hit is about 1/50 of miss). Cache hit rate is displayed alongside the amount to explain situations like “not many tokens but quite a lot of money.”
Relationship with Harness Built-in Statistics¶
Harness is still responsible for collecting usage; this plugin only handles client-side pricing and display. The card’s pricing range is the history loaded in the current window; extremely long sessions will show “loaded history” and request count, with the total being a lower bound rather than all logs.
The card is fixed in the top right corner of the page, about 302px wide, and does not yield to the right sidebar. Before installation, you can double-click preview.html in the repository root to preview the style; preview.html?demo=mixed can demonstrate both peak and off-peak data segments simultaneously.
Installation and Enablement¶
Requires DeepSeek Harness 0.2.2 or higher (README states built and tested against 0.2.2-rc.3), works on both desktop and web clients.
The plugin runs with DSH process/page permissions; browsing client.js and the license is recommended before installation. README provides three entry points, choose any one.
1. Local Directory (Safest path when Market experimental features are unavailable)
After obtaining the plugin directory, within the app: Settings → Plugins → Add plugin, select that directory; Ctrl+R to refresh once, and the card appears in the top right of the chat area.
When installing via Agent, you can pass the absolute path of the directory to the plugin manager:
plugin_manager install_bundle target=<absolute path to the bundle directory>
README also explains you can get the repository first and then install as a bundle; refer to your environment’s plugin documentation for specific acquisition methods.
2. Market Source (Partial build support)
In Settings → Plugins → Market sources add:
https://raw.githubusercontent.com/menzi11/dsh-session-cost/main/market.json
The index contains commit-fixed installation parameters; if the current build does not support Market, the local directory method should still be used.
Typical Usage¶
After installation and refresh, no extra configuration is needed: open a new session or continue an existing one, and every time a model request is completed, the card updates the total amount and peak/valley bars with the usage.
When developing or contributing pricing logic, you can run:
node test/cost-helpers.test.mjs
Tests read logic from the pure-helpers area of the published client.js, consistent with the online bundle. For more detailed data paths and readout explanations, see docs/DETAIL.md in the repository.
Applicable Scenarios and Notes¶
Suitable for: Wanting to stay in the conversation to observe costs while an Agent runs a task for a long time; needing to compare how much was spent in peak vs. off-peak hours in the same session; wanting to correlate cache hit rates to understand the bill, rather than just having token counts.
Notes:
- It is only an estimate and does not constitute an invoice; prices are hardcoded, and changes require following the upstream README or modifying
client.jsyourself. - Does not include a statutory holiday calendar; a single request crossing peak/valley boundaries may be billed at the wrong tier.
- Only prices events loaded by the client; early messages not loaded are not included in the current total.
- The community plugin directory SkillHub entry and GitHub repository are maintained by the community and have no official affiliation with DeepSeek / Huanfang; the DSH ecosystem follows “Everything is a plugin,” so please verify the installation source yourself.
Conclusion¶
dsh-session-cost converts existing usage in the session into RMB, displays peak/off-peak split and unit price basis next to the conversation, filling in the “how much money was spent” layer that the default Harness UI does not cover. When you need installation instructions and price lists, you can refer to the GitHub repository and SkillHub directory page.