940842546/dsh-usage-billing

Usage and cost statistics with peak/off-peak pricing after the 2026-08-17 rate change, a floating summary panel, per-session breakdowns, and a day/week/month/year/all usage heatmap.

dsh-usage-billing is a build-free dual-face plugin for DeepSeek Harness that automatically tracks every DeepSeek model call across all sessions, bills them by official tiered pricing, and provides charted usage panels on the main UI and the Settings page. Features: automatic tracking via llm/stream listener recording every model call (input / output / cache hit / cache miss tokens); historical backfill on first start (scans local session logs to rebuild historical usage and cost with session titles); tiered billing per call — 'pre-change · legacy', 'post-change · peak', or 'post-change · off-peak' — by Beijing time (weekdays 09:00–12:00 and 14:00–18:00 = peak; all other times and weekends = off-peak at half rate); budget alert desktop notifications at 80% and 100% crossing (once per threshold per day) with orange/red progress bars; configurable pricing (price table, peak hours, boundary date, USD exchange rate — editable in settings, reset to defaults with one click; changes apply to subsequent calls only); one-click CSV or JSON export (daily / per-session breakdown, filename includes date range); official balance fetch (auto-detects the configured DeepSeek API key and polls the official account balance).

Usage & Billing ★ 8 updated 2026-08-21
View on GitHub ↗

Install

dsh plugin --profile web add dsh-usage-billing

npm package dsh-usage-billing 0.5.4 (registry-verified 2026-08-23). Install from npm (recommended, prebuilt): dsh plugin --profile web add dsh-usage-billing. Local path also works: dsh plugin --profile web add <repo path>. The package auto-mounts at startup through its dsh.bundle.patch (cordis.patch.yml) — no other configuration needed. Do not patch official bundles (e.g. @deepseek-ai/dsh-web-app/cordis.patch.yml) directly, and do not place the plugin inside npm-cache\_npx/ (npm reify rebuilds it and leaves dangling links).

Compatibility

DeepSeek Harness web profile. Build-free dual-face plugin (no build step). Auto-detects the configured DeepSeek API key for official balance fetching. Tiered billing: legacy prices before 2026-08-17 00:00 Beijing time; peak/off-peak pricing after that (peak = weekdays 09:00–12:00 and 14:00–18:00 Beijing time; weekends and all other times are off-peak at half the peak rate). CSV export filename includes the date range. Budget alert desktop toasts fire once per threshold per day at 80% and 100% crossing.

Details

Recent updates

The current English README (README.en.md) documents: automatic tracking (llm/stream listener), historical backfill, tiered billing (legacy / peak / off-peak with Beijing time rules), budget alert notifications (80%/100%, once/day, orange/red bars), configurable pricing (price table, peak hours, boundary date, exchange rate, one-click reset), CSV/JSON export, official balance fetch, build-free dual-face architecture, npm install.

FAQ

Does the plugin capture API calls made before it was installed?
Yes — on first start it performs a historical backfill by scanning local session logs to rebuild past usage and cost, including session titles. This gives you a complete picture from day one even if the plugin was installed later.
How does peak vs. off-peak billing work?
Peak hours are weekdays 09:00–12:00 and 14:00–18:00 Beijing time; all other times and all weekends are off-peak (half the peak rate). The boundary date is 2026-08-17 00:00 Beijing time — calls before that use legacy pricing. All these parameters are configurable in Settings.
Can I export usage data for accounting?
Yes — one-click CSV or JSON export is available for daily summaries or per-session breakdowns. The filename includes the date range for easy filing.

Alternatives

Max-Samson/dsh-usage-chart · Airmetro/dsh-update-checker · omdsh-dev-dsh-balance-monitor

More plugins in Usage & Billing

Browse more in Usage & Billing

Guides for Usage & Billing plugins