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.
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/balanceendpoint (reuses the harness-configuredDEEPSEEK_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
Option A: dynamic plugin (recommended ยท no config changes)
- Open a DSH session (agent preset cordis).
- Call
cordis_defineโ pasteplugin/host.jsascode.hostandplugin/client.jsascode.client. - Call
cordis_runto activate (approve in the browser on first run). - 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)
| Model | Period | Cache hit | Cache miss (input) | Output |
|---|---|---|---|---|
| V4 Flash | Peak | 0.10 | 3 | 9 |
| V4 Flash | Off-peak | 0.05 | 1.5 | 4.5 |
| V4 Pro | Peak | 0.30 | 9 | 27 |
| V4 Pro | Off-peak | 0.15 | 4.5 | 13.5 |
Peak hours: Beijing 09:00-12:00, 14:00-18:00. All other hours are off-peak (half price).
๐ License
MIT ยฉ noneghost