feiyang-dev/dsh-usage-plugin22

@feiyang666/dsh-usage-plugin

DeepSeek Harness usage & cost tracker plugin: per-call token/cache-hit stats, peak/off-peak billing, DeepSeek balance query, CSV/JSON/PNG export with custom destination, and persistent local storage. Ships a host half plus a web client half in one npm package; installs into a DSH profile as a dsh.bundle with one command (dsh plugin --profile web add @feiyang666/dsh-usage-plugin).

AI 분석

用于精确记录和分析每次模型调用的 Token 消耗与费用。适合需要导出用量报表(CSV/JSON/PNG)、查看热力图并支持峰谷计费的 DSH 用户。

패키지
@feiyang666/dsh-usage-plugin
버전
1.9.1
라이선스
MIT
최근 업데이트
2026. 8. 16.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:feiyang-dev/dsh-usage-plugin

DeepSeek Harness Usage & Cost Tracker (dsh-usage-plugin)

English · 简体中文

GitHub · npm · MIT License

A community plugin for DeepSeek Harness — records token usage and cost for every model call, with peak/off-peak billing, balance query, a calendar heatmap, and CSV / JSON / PNG export.

License Node Platform


🔔 Important Notice (2026-08-16): npm package renamed

The npm package has been renamed from @feiyang666/deepseekharnessdesktop to @feiyang666/dsh-usage-plugin (matching the GitHub repo feiyang-dev/dsh-usage-plugin).

  • Use the new package name for install / upgrade: dsh plugin --profile web add @feiyang666/dsh-usage-plugin
  • The old package @feiyang666/deepseekharnessdesktop remains published for a while, but it is no longer maintained and will not receive updates — please migrate soon.
  • The desktop client (DeepSeek Harness Desktop) supports both package names and will auto-detect old-name installs with a one-click update to the new name.

Overview

dsh-usage-plugin is a usage & cost tracker plugin in the DeepSeek Harness ecosystem (a DSH plugin shipped as a Host + Client two-in-one package). After installation, "Usage & Cost" and "Balance Query" tabs appear in the Web UI, right after "Conversation" and "Trace":

Supports Windows / macOS / Linux: paths are handled per platform (node:path), and the folder picker / "reveal in file manager" use each OS's native mechanism (macOS: osascript / open; Linux: zenity / xdg-open). Balance query and export do not depend on Windows-only commands.

  • Usage & Cost: records each model call's token usage and cache hits (input miss / cache hit / cache write / output / reasoning / finish reason), and computes cost using DeepSeek's peak/valley or base pricing (peak hours are automatically priced by Beijing time 09:00–12:00 and 14:00–18:00). Model names come from the actual request parameters, so non-DeepSeek models are shown truthfully instead of "unknown model"; models without an official price are counted as 0. The overview shows a by-model table plus a by-API-provider × model drill-down (each provider grouped with every model's calls and peak/off-peak cost split) and a grand total row.
  • Usage Calendar: a monthly daily-usage heatmap (colored by cost or call count), hover for details including the peak/off-peak cost split, click a day for its call list and peak/off-peak totals, plus a per-day statistics table with peak cost / off-peak cost / total columns and monthly rollups.
  • Cache Hit List: newest-first, fully scrollable, with quick filters (Today / 7 days / 30 days / All) and custom date ranges; the summary line and footer total split peak vs off-peak consumption with a grand cost total. The list is paginated (100 rows per page), so it stays smooth even with large data volumes.
  • Price Table: the official DeepSeek API price table — base and peak/valley unit prices shown side by side (peak vs off-peak), editable in-panel and persisted to pricing.json, with a reset-to-default option.
  • Balance Query: queries your DeepSeek account balance using the configured DEEPSEEK_API_KEY.
  • Export: CSV / JSON / PNG long image (newest-first, up to the latest 2000 records, warns if exceeded; the PNG report includes peak/off-peak cost columns), to any directory (native picker), auto-opens the folder after export.
  • Import: merge-imports JSON / CSV files, deduplicated by time.
  • Persistence: records are written live to /dsh-usage/usage-records.json and restored on restart (cap 100000 records).
  • UI adaptation: panel typography scales with the app's display-size setting (em-relative fonts); table wrapping and spacing are tuned so large display sizes stay readable.

Screenshots

Usage & Consumption

Usage & Consumption

Balance Query

Balance Query

Recommended Installation

Either method works and is equivalent. We recommend the desktop app — fully graphical, no command line needed.

Option 1 (recommended): One-click via the desktop app

Install DeepSeek Harness Desktop, open it, then go to "Install Plugins" → Recommended → Usage & Cost Tracker → Install and click "Restart Service Now" to activate.

Option 2: Command line


### Usage & Consumption
![Usage & Consumption](https://raw.githubusercontent.com/feiyang-dev/dsh-usage-plugin/8c51f1d51866ea69730e17d683ad120aeb15cab7/docs/assets/usage-overview.png)

### 5. Configuration (for balance query)

"Balance Query" uses the configured `DEEPSEEK_API_KEY`: set the API Key in **Settings → Models** (same key used for chats), then open the "Balance Query" tab and click "Query Balance".

---