Preface¶
When running long sessions in DeepSeek Harness (DSH), the interface usually tells you how many tokens you’ve used, the decode speed, and context occupancy, but it doesn’t directly show “how much this session roughly cost.” If you multiply the total tokens by a single unit price yourself, the result on DeepSeek is often way off: official pricing adjusts by peak/off-peak time periods, and the input unit price for cache hits vs. misses differs by an order of magnitude. The following introduces the community plugin Session Cost Pill (repo vegerot/deepseek-harness-session-cost-pill), which, without modifying Harness source code, puts the estimated cost of the current session into the Composer dock, displayed in the same row as the existing activity, usage, and context pills.
What Is This¶
Session Cost Pill was released by maintainer vegerot and is categorized under model inference in the SkillHub directory. It is a regular client plugin built on Cordis: it injects into the Composer dock via slots, reads each assistant step’s usage and timestamp from the session snapshot, and accumulates costs according to DeepSeek’s published peak/off-peak prices and itemized unit prices, producing a real-time estimated spend for this session. DeepSeek reports token consumption; this plugin supplements it with cost-side visualization.
What’s Added to the Composer Dock¶
The Composer dock already had metrics such as turns, speed, tokens, and context. After installation, a cost pill appears, showing the estimated total cost of this session; the icon changes with the amount range, making it easy to judge the magnitude at a glance (for example, tiers such as under $1, under $5; the README distinguishes them with different glyphs).
Clicking the cost pill expands a breakdown: uncached input, cache reads, and output are priced separately; it also shows how much of the total was billed at peak rates and how many steps are involved. Closing the panel relies on browser popover behavior (Escape, clicking outside, or clicking again); the plugin itself does not maintain dialog state or positioning logic.
The correspondence with the other pills in the same row is as follows (excerpted from the README):
| Pill | Displayed content |
|---|---|
| activity | turns · steps · decode speed |
| usage | total tokens · cache-hit rate |
| cost | estimated cost for this session |
| context | context-window pressure |
Pricing Logic: Why Not “Total Tokens × One Unit Price”¶
The README points out that simply multiplying the session’s total tokens by a fixed unit price gets it wrong twice on DeepSeek.
Peak and Off-Peak Time Windows¶
The peak unit price is about twice the off-peak price. Off-peak covers all times except the following windows (including all weekends); peak is UTC Monday–Friday 01:00–04:00 and 06:00–10:00. The plugin determines, for each assistant request step, whether it falls within peak time based on its timestamp, and then selects the corresponding unit price. Long sessions spanning a peak boundary get a total summed with mixed pricing, rather than applying a single rate to the entire session.
Unit prices transcribed in the README (USD / 1M tokens, source: Models & Pricing):
| Model | Tier | Cache hit input | Cache miss input | Output |
|---|---|---|---|---|
deepseek-flash |
off-peak | 0.003 | 0.15 | 0.60 |
deepseek-flash |
peak | 0.006 | 0.30 | 1.20 |
deepseek-v4-pro |
off-peak | 0.022 | 0.66 | 1.98 |
deepseek-v4-pro |
peak | 0.044 | 1.32 | 3.96 |
Cache Hits and Misses¶
The unit price for cache-hit input is far lower than for cache misses. In long agent sessions, the cache-hit ratio can be very high; if all prompt tokens are lumped into one bucket, the estimate will deviate significantly. The plugin prices each usage item separately (including cache-related fields).
Cross-Checking Against Platform Bills¶
DeepSeek does not provide a public pricing API; the README records that a real bill from the Platform console was compared with the plugin’s table for a certain account’s deepseek-flash usage in October 2025. The total differed from the platform’s USD-converted amount by about 0.11% (that month’s usage was effectively all off-peak). This demonstrates that the rate table and itemized algorithm point in the same direction as the official ones, not that any account or any month will necessarily be identical.
In terms of implementation, the plugin reads the chat snapshot via the session standard kit: useChat obtains the time and usage of each settled assistant step, useProjection('modelSelection') obtains the session model, and then it accumulates according to
total = Σ over steps costOfUsage(step.usage, model, isPeak(step.time))
Example injection method (from the README):
ctx.slots.inject('conversation.composer.dock', () => ctx.slots.register({
name: 'conversation.composer.dock',
id: 'cost-pill',
order: 2, // joins the activity (0) and usage (1) pills
}, CostPill));
Installation and Activation¶
Installation requires no build, bundler, or extra dependencies; just add the plugin, restart the corresponding profile, and refresh the page. The commands given in the official README use local-path form (replace the path with your local clone location):
dsh plugin --profile web add ~/code/github.com/vegerot/deepseek-harness-session-cost-pill
dsh plugin --profile desktop add ~/code/github.com/vegerot/deepseek-harness-session-cost-pill
The plugin runs with the permissions of the current dsh process; before installing, it’s recommended to read the repo’s source code and the MIT license to confirm it meets your security and compliance requirements. The SkillHub directory page (https://www.skillhub.cn/plugins/vegerot/deepseek-harness-session-cost-pill) is a community index; it has no official affiliation with DeepSeek / High-Flyer and is not an official app store.
Typical Usage¶
- Add the plugin to the web or desktop profile using the commands above, then restart and refresh.
- Start conversations normally in Harness; once the cost pill appears in the Composer dock, the number updates with the usage of each step in this session.
- When you need to see the itemized breakdown and the peak-time share, click the cost pill to open the breakdown; afterward, close it with Escape or by clicking outside.
For models without a listed price, no wrong number is shown; instead, the pill is simply not rendered (noted in both the README and the test suite).
Applicable Scenarios and Known Limitations¶
Who it’s for: developers who spend long hours debugging agents in DSH and need to see “roughly how much this session is costing” while it runs; especially those who rely on the cache, or whose sessions span UTC peak/off-peak boundaries, where itemized pricing plus per-step peak/off-peak billing is more reliable than hand calculation.
Limitations to note (key points from the README):
- China’s statutory holidays may in practice be treated entirely as off-peak, but the plugin does not incorporate the PRC holiday calendar; workday windows falling on statutory holidays that should be off-peak may still be marked as peak, causing a slight overestimate on those days.
- The model is selected at the session level: single-step nodes have
timeandusagebut no per-step model name; when the model is switched mid-session, all steps are priced at the rate of the most recently selected model. - No account-level total bill shown: the Platform console does have a real billing interface, but it depends on browser-side Remote zod codecs and such; the README states that this is deferred in the current version, so the interface only shows session estimates, not full-account spending.
On the development side: pnpm test runs tsc --noEmit && node --test test.ts; the client client.js is injected as a classic script, with types provided via JSDoc + tsc --checkJs, and there is no browser build step. The README notes 33 passing tests.
Conclusion¶
Session Cost Pill folds DeepSeek’s peak/off-peak pricing, cache itemization, and per-step timestamps into a single pill in the Composer dock, aligning “a lot of tokens” and “roughly how much money” within the same piece of UI. Directory page: https://www.skillhub.cn/plugins/vegerot/deepseek-harness-session-cost-pill ; source code and full documentation: https://github.com/vegerot/deepseek-harness-session-cost-pill .