YZz-S/dsh-token-cost-meter ↗★ 1
dsh-token-cost-meter
DeepSeek Harness (dsh) 会话费用插件:显示当前会话累计 token 消耗与估算费用,价格从 DeepSeek 官方价格页动态获取。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:YZz-S/dsh-token-cost-meter说明文档
阅读完整 README ↗dsh-token-cost-meter
DeepSeek Harness (DSH) plugin that shows the current session's cumulative token consumption and estimated cost (CNY) in real time in the stats line below the input box, with prices fetched dynamically from the official DeepSeek pricing page.
DeepSeek Harness(DSH)插件:在 Web GUI 输入框下方的统计行中实时显示当前会话累计 token 消耗与估算费用(人民币),价格从 DeepSeek 官方价格页动态获取。
Supports two forms: an installable dsh.bundle package (recommended, persists across DSH restarts) and the dynamic cordis_define usage (temporary run).
English
中文 · ← Back to DeepSeekHarnessPlugins
Preview
A new stats line appears below the input box (right of the built-in stats line):
Cost ¥0.13 · 43.2K tokens
Hovering shows the breakdown: pricing model, input (cache-miss / cache-hit buckets), output, pricing mode (current / peak-hour / off-peak-hour), price source and fetch time.
Features
- Real usage: reads the session projection
tokenUsage(provider-reported cumulative usage: cache-miss input / cache-hit input / output — same source as DSH's built-in stats line) - Official dynamic pricing: the Host fetches and parses the official DeepSeek pricing page every 6 hours (including peak/off-peak price tables, auto-switching by Beijing time)
- Graceful degradation: if the official page fetch fails, automatically falls back to the built-in price snapshot, prefixing amounts with
≈and noting the reason in the hover tooltip - Three-level model detection fallback: recent request
provenance→requestConfig→ Hostagents.options.model; if all fail, displays a price range computed per model - Zero data egress: the only outbound request is the official public pricing page; token usage is displayed locally only — never uploaded or persisted
Files
| File | Description |
|---|---|
index.js | Installed Host half: fetches/parses the official pricing page; /api/token-cost-meter/* routes ( / ) |