AI Agent Hub
Back to plugins
🖥️

dsh-turn-cost

Client Updated 2026.09.16

Run the following command in DeepSeek Harness:

dsh plugin install CHIP-PHILO-GH/dsh-turn-cost

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install CHIP-PHILO-GH/dsh-turn-cost to install this plugin in DeepSeek Harness; source code is available at https://github.com/CHIP-PHILO-GH/dsh-turn-cost

About this plugin

DSH already surfaces token-step stats like "71 steps · 257 tok/s" and "10.7M tok · 99% cache hit", but it stops short of the one number most people want: what did this turn actually cost? dsh-turn-cost fills that gap. A pill appears in the existing stats row under the input box reading "This turn ¥x · This conversation ¥x", and a small badge attaches to the action bar at the end of every assistant reply showing that turn's cost. Both are single DOM nodes inserted in place — no new panels, no patches to DSH source or stylesheets.

Pricing follows the dsh-cost-meter ledger: the plugin reads ledger.json for per-model rates (USD per 1M tokens), exchange rate (default 7.2), decimal places, and peak/off-peak UTC hour windows, then converts the four usage buckets — inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens — into RMB. When the ledger is missing or malformed it silently falls back to a built-in DeepSeek deepseek-flash rate card rather than throwing. Peak/off-peak logic is strict: calls before peakEffectiveAt always use the base price, and a non-boolean truthy value for peakEnabled simply disables the whole mechanism.

Who is it for? If you call models frequently in DSH and want a glanceable RMB figure without leaving the interface or digging into a billing portal, this is the lightweight overlay you need. Keep in mind it is an estimate, not an invoice: cache writes are priced at the hit rate (aligned with dsh-cost-meter), channels with custom cache-write pricing will show a different number here, and only the four usage tokens are accounted for. Treat it as a magnitude gauge; reconcile with your actual invoice when precision matters.

Use Cases

  • Glance at per-turn and cumulative RMB cost during a conversation without leaving the DSH interface
  • Switch between models with per-model rate cards and let peak/off-peak UTC windows drive pricing automatically
  • Fall back to a built-in DeepSeek flash rate card when the ledger is unavailable, keeping the UI stable

Best For

  • Developers calling DSH models frequently who want a glanceable RMB figure in-context
  • Individual users tracking API spend who prefer lightweight estimates over portal reconciliation
  • Small teams on DeepSeek-style models wanting a consistent, at-a-glance cost signal