DeepSeek Usage

August 14, 2026 ยท View on GitHub

An in-harness usage dashboard for DSH (DeepSeek Harness) users: live balance + historical token stats + peak/off-peak cost estimate + usage-time advice, with one-click Chinese/English switching.

License: MIT Platform: DSH Lang: EN / ZH

English | Chinese


โœจ What is it?

After installing this plugin in DSH, a dashboard replicating the official DeepSeek usage page appears in your sessions:

  • ๐Ÿ’ฐ Balance โ€” live total balance via the official GET /user/balance endpoint (reuses the harness-configured DEEPSEEK_API_KEY; no manual setup needed).
  • ๐Ÿ“Š Token usage โ€” a by-day stacked bar chart (input / cache-read / output) showing where your tokens go each day.
  • ๐Ÿ—“ Time ranges โ€” Today / This Week / Last 7 Days / This Month / Last 30 Days / All; every statistic follows the selection.
  • ๐Ÿงฎ By model โ€” per-model usage (input / cache read / cache write / output / calls) within each range.
  • ๐Ÿ—‚ By workspace โ€” grouped by each session's working directory, covering all historical workspaces (including records before the plugin was installed).
  • ๐Ÿ’ธ Cost estimate โ€” priced with the official 2026-08-17 peak/off-peak rates (peak: Beijing 9-12 / 14-18; off-peak: half price), split into peak/off-peak cost.
  • โฑ Period analysis โ€” peak/off-peak share + a 24h usage distribution that follows the selected range.
  • ๐Ÿ’ก Savings advice โ€” directly computes "how much you'd save by moving peak usage to off-peak" and suggests the best batch window (22:00-08:00).
  • ๐ŸŒ Bilingual โ€” one-click EN / ZH toggle in the panel header.

๐Ÿš€ Install

  1. Open a DSH session (agent preset cordis).
  2. Call cordis_define โ€” paste plugin/host.js as code.host and plugin/client.js as code.client.
  3. Call cordis_run to activate (approve in the browser on first run).
  4. Done โ€” start using it ๐Ÿ‘‡

Option B: standard npm package (composition)

This repo also ships a standard DSH plugin package (lib/index.js Host + lib/client.js Client), installable directly from GitHub:

# 1) Install as a dependency (direct GitHub install)
npm install github:noneghost/dsh-deepseek-usage

# 2) Add a composition row in your harness profile's cordis.patch.yml:
#    - id: dsh-deepseek-usage
#      name: dsh-deepseek-usage

After restart: the "Token Usage" button appears at the right of session headers โ†’ right-side details panel; or Settings โ†’ DeepSeek Usage.

No dependencies to install; the plugin only uses harness built-in services.


๐Ÿ–ฑ How to use

  • Open the panel: the "Token Usage" button at the right of any session header โ†’ right-side details panel; or Settings โ†’ DeepSeek Usage.
  • Change range: the Range dropdown at the top of the panel.
  • Switch language: the EN / ZH toggle at the top-right of the panel.
  • Live badge: under the input box shows "today tokens ยท calls".

๐Ÿ“ธ Screenshots

Coming soon โ€” PRs welcome (screenshots/ directory).


โ“ FAQ

Q: Balance is not showing? Balance needs a valid DEEPSEEK_API_KEY. The plugin prefers the harness-configured credential (the panel shows its source); you can also paste a key manually (memory only, never written to disk).

Q: Why is the first open slow? The first open scans the harness's persisted session logs (which may include many historical sessions). Results are cached afterwards, so range switches are instant.

Q: How is "workspace" determined? By each session's creation working directory (cwd). Every workspace you have used appears; workspaces without records show 0.

Q: Is the cost figure the official bill? It is an estimate: actual usage from harness call records ร— the official peak/off-peak rate table. For the authoritative bill please check the platform. Rates live in PRICES in plugin/host.js โ€” easy to update when the official pricing changes.

Q: Is any data written to disk? API keys stay in memory only. The plugin reads the harness's existing session logs and writes nothing itself.


๐Ÿ“Š Official pricing (effective 2026-08-17, CNY per 1M tokens)

ModelPeriodCache hitCache miss (input)Output
V4 FlashPeak0.1039
V4 FlashOff-peak0.051.54.5
V4 ProPeak0.30927
V4 ProOff-peak0.154.513.5

Peak hours: Beijing 09:00-12:00, 14:00-18:00. All other hours are off-peak (half price).


๐Ÿ“„ License

MIT ยฉ noneghost