AI Agent Hub
Back to plugins
🖥️

dsh-cost-stats

Client Updated 2026.09.14

Run the following command in DeepSeek Harness:

dsh plugin install thezavtrak-a11y/dsh-cost-stats

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

Run dsh plugin install thezavtrak-a11y/dsh-cost-stats to install the plugin; source code at https://github.com/thezavtrak-a11y/dsh-cost-stats

About this plugin

DSH reports token counts but never a monetary amount, so you are left staring at a wall of numbers without ever knowing what a session actually cost. dsh-cost-stats closes that gap by doing the arithmetic against a local, editable price table and placing the results exactly where you already look: a flat, right-aligned cost pill in the message action row after every completed turn, styled to match the shipped Used N tokens item beside it, and a four-figure session summary tucked into the stats strip under the composer. Click the pill and it unfolds into a per-bucket breakdown covering uncached input, cached input, cache write, and output including reasoning, along with the model used, turn number, TTFT, and tokens per second.

The Cost tab is where the depth lives. Every model request is attributed to exactly one of three mutually exclusive categories, so the shares always sum to the total without double counting. The tab lays out KPI cards for loaded-turn cost, whole-session cost, requests, average cost per request, reasoning share, cache hit rate, tok/s, TTFT, and turn wall time; a spend-composition donut; rating boards for the most expensive turns, tools by calls and time, and models by cost; and a fully interactive timeline. The timeline supports wheel-zoom around the cursor, drag-to-pan, double-click or Reset to return to the full range, and step granularity from 10 s to 15 min. Hovering any step reveals its own numbers, and a summary line above the plot reports the visible window's request count, cost, average rate, and peak rate.

The numbers are an estimate, not an invoice. Token counts come from the provider's logs; the money comes from a four-column per-model table you can edit in place. Cached input is priced at zero by default, after auditing a long-lived DSH corpus showed roughly 99.4% of prompt tokens arriving as cache hits and the published cache rate overshot the provider's own bill by an order of magnitude. If your plan does charge for cache reads, drop the real number in and every total adjusts automatically. Nothing upstream is patched: the plugin registers into DSH's official slot, session-source, and locale registries, so it survives upgrades cleanly and uninstalls by removing a single row. If you use the DSH web GUI for daily coding or agentic work and want to know exactly where the money goes without digging through JSONL logs, this plugin was written for that.

Use Cases

  • Use the DSH web GUI for daily coding and want an at-a-glance cost per turn and per session
  • Compare spend share across tool calls, reasoning, and read-analyze categories to find the costliest action type
  • Review a long session on the interactive timeline, zoom into spend spikes and anomalous requests

Best For

  • Developers who use the DSH web GUI for daily coding or agentic work
  • Tech leads tracking LLM API costs and wanting category-level token optimization
  • Teams running multi-turn agentic workflows that need post-hoc spend accounting per action type