qwert702/dsh-token-viewer

Developer tool: live token usage & cost monitoring for DeepSeek Harness - consumed tokens for the current sess

dsh-token-viewer brings CC Switch-style token consumption statistics to the DeepSeek Harness Web GUI: a slim TokenDock strip above the composer, a sidebar card with balance and aggregate consumption, and a usage statistics panel with per-request records (one timestamped entry per assistant step: commit time, model, four token buckets), hero totals and cost, hourly/daily trend charts, per-project and per-model tabs with average cost, and range presets. Pricing is per-model peak/off-peak (V4-Flash/V4-Pro, CNY per 1M tokens) with a provider-pricing fetch fallback. It adds no prompt content, tools, or provider requests — purely read-only surfaces.

Agent Capabilities ★ 6 updated 2026-09-19 ⚠️ needs adapt
View on GitHub ↗

Install

dsh plugin add qwert702/dsh-token-viewer

GitHub install per README (one command): dsh plugin add qwert702/dsh-token-viewer. Restart the harness, refresh the web page, then open the 'Token 消耗' card in the sidebar → 用量详情. Read-only surfaces over the harness's host-computed projections plus one balance read; the plugin adds no prompt content, tools, or provider requests. The TypeScript monorepo source (extracted from deepseek-ai/deepseek-harness) lives on the archive/monorepo-src branch. MIT.

Compatibility

DeepSeek Harness Web GUI. TokenDock live strip above the composer (billed input uncached/cache read/cache write, output, cache hit rate, approximate context occupancy); sidebar card with DeepSeek account balance (refresh + error-retry) and aggregate consumption expandable per conversation; usage statistics panel ported from CC Switch's usage-dashboard method (per-request stats from the host usageLog projection, hero totals, trend chart, request log / per-project / per-model tabs, range presets today/7d/14d/30d/all); per-model peak/off-peak list pricing (Beijing windows 09:00–12:00 and 14:00–18:00, double off-peak). Balance route GET /api/billing/balance proxies DeepSeek /user/balance through the harness credentials service.

Details

Recent updates

The current English README documents: install (one command), features (TokenDock, sidebar card, usage statistics panel with tabs/presets, per-model pricing), repo layout (lib/index.js host half, lib/client.js browser half, scripts/build-client.mjs), model pricing (MODEL_PRICING + /api/billing/pricing fallback), and license.

FAQ

Does the plugin add anything to my prompts?
No — it is read-only over the harness's host-computed projections plus one balance read; it adds no prompt content, tools, or provider requests.
Where does the balance come from?
The GET /api/billing/balance route proxies DeepSeek's /user/balance through the harness credentials service; the API key never leaves the server.
How is per-model cost calculated?
Every request bills under its own model's provider list price (V4-Flash / V4-Pro, CNY per 1M tokens, cache writes at the cache-miss rate), split by the provider's Beijing peak windows; unknown models fall back to the V4-Flash off-peak table.

Alternatives

Max-Samson/dsh-usage-chart · lanlandeli/dsh-usage-stats · zh667/TokenLedger

More plugins in Agent Capabilities

Browse more in Agent Capabilities

Guides for Agent Capabilities plugins