Preface¶
When running long conversations and multi-turn tool calls in DeepSeek Harness (DSH), tokens quietly pile up, and figuring out your account balance or “how much this conversation has actually cost” usually means opening another page or just guessing. The community plugin dsh-token-monitor (maintainer Ta9y) brings these three things into the main interface: a narrow vertical bar pinned to the right edge of the window that expands into a card on hover, showing your topped-up wallet balance, the cumulative tokens for the current conversation, and the estimated cost of this conversation based on DeepSeek’s official pricing. Below we cover what it does, how to install and configure it, the estimation methodology, and known limitations.
What Is This¶
dsh-token-monitor is a standard DSH bundle: the host half (index.js) reads balances, accumulates usage, fetches prices, and serves HTTP routes; the client half (client.js) injects ui.js into the page. Its one-line description is “Floating token & cost monitor for DeepSeek Harness”. It’s categorized as a model inference capability; the repo currently has about 1 GitHub star, is licensed under MIT, and package.json reports version 1.0.0. The README notes that, apart from a one-line description, the plugin body was generated by DeepSeek Harness.
UI and Interaction¶
The vertical bar sticks to the right edge of the window, can be dragged up and down, and its position is stored in the browser’s localStorage as viewport proportions; the popup card aligns vertically with the bar. It takes about 320ms of hovering before the details expand; hovering over the title-bar “×” row does not expand it, avoiding accidental triggers. Switching conversations refreshes the display immediately (the plugin detects the DOM selection state, and the host looks up the session by title or id). The UI language follows the DSH app (Simplified Chinese / English).
Illustration (from the README):
┌──────────────────────┐ ┌──┐
│ ● 你的对话标题 × │ │¥ │
│ 余额 ¥25.87 │ │25│
│ 本对话 ≈¥0.42 25.4M│ │.8│
└──────────────────────┘ └──┘
悬停后展开明细 ↑
Core Features¶
Balance¶
It reads the topped-up wallet via the DSH account service (ctx.deepseekAccount.getBalance()); the gifted balance is visible on hover. By default it queries every 60 seconds, which can be changed via the balanceSeconds config option.
Token Consumption for the Current Conversation¶
It accumulates the usage from each model call in the current conversation. Only main sessions are counted; subagent tasks are not included. The session must be a live session in Host memory; cold sessions display —.
Cost of This Conversation (Estimate)¶
Costs are estimated according to the DeepSeek official pricing page, broken down by model and by peak / off-peak time slots. Unit: RMB per million tokens. Peak hours are Beijing-time weekdays 9:00–12:00 and 14:00–18:00; all other periods (including weekends) are billed at the off-peak rate. Statutory holidays are not handled separately, and the result is an estimate only, not the actual billed amount.
Pricing details:
- The model is read from the session’s
requestContext(); unknown models fall back todeepseek-flash. - Each usage record is bucketed into the peak or off-peak bucket based on the time the call occurred, using the corresponding unit prices (including cache hit / cache miss / output).
- Search / Fetch: counts
web_search/web_fetchcalls and prices them at RMB 5 per 1,000 calls; per the official docs, calls before 2026-11-01 00:00 are not billed, and the plugin uses thesearchBillingFromconfig option (a date) to decide whether to include them.
Automatic Price Updates¶
When autoPrices: true, prices are fetched from the official pricing page once a month, cached for 30 days, and written to prices.auto.json (including fetchedAt); if the fetch fails, the old values continue to be used. You can also disable automatic fetching and use only the hand-written prices in config.json.
Installation and Activation¶
The plugin ships with both host and client halves; after installation you must restart the DSH process once (the host half is cached via ESM, so reloading the plugin does not re-execute the host). After that, changes to ui.js or config.json only require a page refresh.
Replace <profile> in the commands with the target profile name; for desktop it’s usually desktop.
Install from GitHub (the one-liner recommended in the README)¶
dsh plugin --profile <profile> add github:Ta9y/dsh-token-monitor
Graphical UI¶
Settings → Plugins → Install, then paste github:Ta9y/dsh-token-monitor.
npm (Not Yet Available)¶
The README states the package has not yet been published to npm; dsh plugin --profile <profile> add dsh-token-monitor currently returns 404 — wait until it’s published before using it.
Local development, manual pnpm add file:..., and other methods are covered in the repo README and are not expanded on here.
Configuration¶
Edit config.json in the plugin directory and refresh the page to apply — no DSH restart needed:
{
"pollSeconds": 10,
"balanceSeconds": 60,
"autoPrices": true,
"searchPer1000": 5,
"fetchPer1000": 5,
"searchBillingFrom": "2026-11-01",
"prices": {
"deepseek-flash": {
"offpeak": { "cacheHit": 0.02, "cacheMiss": 1, "output": 4 },
"peak": { "cacheHit": 0.04, "cacheMiss": 2, "output": 8 }
},
"deepseek-v4-pro": {
"offpeak": { "cacheHit": 0.15, "cacheMiss": 4.5, "output": 13.5 },
"peak": { "cacheHit": 0.3, "cacheMiss": 9, "output": 27 }
}
}
}
pollSeconds controls the page polling interval; searchPer1000 / fetchPer1000 are the Search/Fetch unit prices (RMB per 1,000 calls).
Typical Usage¶
After installing and restarting DSH, open the desktop app or web host UI and the vertical bar will appear on the right side. Day-to-day use needs no extra commands:
- Read the abbreviated balance and per-conversation token figures on the bar.
- Hover to expand the card, viewing the detailed cost and the per-model breakdown (if available).
- Switch conversations in the session list on the left; the monitor follows the currently selected conversation.
If the estimate differs greatly from your expectation, first check whether there were many calls during peak hours, whether the conversation includes lots of web_search/web_fetch calls, and whether it is a main session (subagent tasks are not counted).
Privacy and Local Files¶
The plugin does not read login tokens and does not touch API keys; balances are fetched only through the DSH account API. It sends no requests to third parties — the only outbound request is the monthly fetch of the official pricing page. Data lives in local memory and localStorage (the bar’s position). Files it may write include: debug.log (safe to delete), token.txt (a per-page random token), and prices.auto.json (price cache).
Use Cases and Caveats¶
Good for: developers running long conversations in DSH who want to see balance and current-session token/cost estimates at a glance; those who want prices to follow the official site’s updates while accepting the error introduced by the simplified peak-hour/holiday rules.
Environment and compatibility:
- Requires DSH 0.2.x (
@deepseek-ai/dsh-base+dsh-web-app). - The desktop client is injected via
dsh.client;dsh webis injected via index. - The README states it has so far only been tested on the desktop profile on Windows.
Security and trust: the plugin runs with the permissions of the current DSH process; before installing, it’s recommended to read the GitHub source and the MIT license.
The DSH ecosystem emphasizes “everything is a plugin”; the SkillHub directory page is a community listing and has no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
dsh-token-monitor puts balance, per-conversation tokens, and officially-priced cost estimates into a non-obstructive floating bar, with drag-to-move, language sync, and monthly price fetching. If you’re doing model-inference development in the Harness and want cost visibility, install it with the commands above — and remember to restart DSH once.