dsh-usage-plugin: A Usage and Cost Statistics Plugin for DeepSeek Harness
feiyang-dev/dsh-usage-plugin
DSH plugin tracks token usage and costs per call, with peak/off-peak billing, balance query, and CSV/JSON/PNG export.
Provides DeepSeek Harness with per-call token usage, cache hits, peak/off-peak billing, and balance query, with CSV/JSON/PNG export.
dsh plugin --profile web add github:feiyang-dev/dsh-usage-plugin- Category
- Models & Reasoning
- Platform
- DSH-Plugin
- Author
- feiyang-dev
- Distribution
- Plugin
dsh-usage-plugin Key Features
dsh-usage-plugin Repository

dsh-usage-plugin Repo Summary
dsh-usage is a usage and cost statistics plugin (DSH plugin) for DeepSeek Harness, maintained by feiyang-dev under the MIT license, last updated in 2026-08. It solves the problem of invisible model call costs: how many tokens each call consumes, cache hit status, how fees are calculated with peak/off-peak pricing, and remaining account balance. After installation, two tabs appear at the top of the WebUI: "Usage & Cost" and "Balance Query". Core capabilities include token usage and cache hit statistics, cost calculation based on DeepSeek peak/off-peak prices, calendar heatmap, cache hit list, editable price table, balance query, and CSV/JSON/PNG export with import merge.
What core statistics and billing features does the dsh-usage DSH plugin support?
The plugin records token usage and cache hits for each model call (input miss, cache hit, cache write, output, reasoning, finish reason) and calculates cost based on DeepSeek peak/off-peak prices, with peak hours automatically priced at Beijing time 9:00–12:00 and 14:00–18:00. Model names are displayed as per request parameters; non-DeepSeek models are no longer shown as "unknown model", and models without official prices are counted as 0 cost. The overview includes a "by model" table and a "by API provider × model" detail table, with a total cost summary at the bottom.
How does dsh-usage display daily usage heatmap and cache hit list?
The "Usage Calendar" shows a monthly heatmap of daily usage, colored by cost or call count, with hover details (including peak/off-peak cost breakdown), click on a day to view call details and peak/off-peak cost statistics, along with a daily statistics table and monthly summary. The "Cache Hit List" shows the latest records first, supports quick filters for today/last 7 days/last 30 days/all and custom date ranges, with paginated rendering (100 per page) to handle large record volumes smoothly.
How does dsh-usage query balance, edit price table, and export data?
"Balance Query" uses the configured DEEPSEEK_API_KEY to query the DeepSeek account balance. The "Price Table" shows official DeepSeek API base and peak/off-peak prices, editable directly in the panel and persisted to pricing.json, with a one-click restore to defaults. Export supports CSV/JSON/PNG long images (up to the latest 2000 records, PNG report includes peak/off-peak cost breakdown), exportable to any directory (native directory picker), and automatically opens the containing folder after export; import supports JSON/CSV merge with deduplication by time.
How to install dsh-usage?
Desktop one-click installation is recommended, or use the command line. The installation command is:
dsh plugin --profile web add github:feiyang-dev/dsh-usage-plugin
You can also install for other profiles by replacing web with the profile name. After installation, restart the dsh web service to take effect.
What DeepSeek Harness versions and platforms does dsh-usage support?
The plugin supports Windows / macOS / Linux, with paths handled per platform (node:path), directory selection and "open containing folder" use native system methods (osascript/open on macOS, zenity/xdg-open on Linux), and balance query and export do not depend on Windows-specific commands. Records are persisted in real-time to <session workspace>/dsh-usage/usage-records.json, auto-restored on restart (up to 100,000 records). Panel font size scales with the app's "display size" setting, wide tables scroll horizontally within the container, and all columns and totals remain fully visible at any window size.