dsh-usage-meter
Manifest validsimple usage meter to show how much money is consumed. Supports peak and valley charges
dsh-usage-meter
English | 中文
Want to see your account balance? Want to know how much a single sentence costs you, without a pile of analytics features? Want to see how much a price hike hits your wallet? This plugin is for you.
It shows your DeepSeek official API balance and the amount spent in the current session in the top-right corner of the interface; hover over the amount to see the details. The price table and peak/off-peak pricing are configurable on the settings page.
UI language: All UI copy follows the language selected in DSH (中文 / English). Switch it live in DSH Settings → General → Language; when unset, it follows your browser language.
Features
-
Session header indicator:
- Balance: calls the official DeepSeek
GET https://api.deepseek.com/user/balance; hidden for non-official APIs / missing key / failed queries. - This session: shows the amount used by the current session (CNY, 2 decimals). Hover for details. UI:
- Balance: calls the official DeepSeek
-
Settings page "Balance / Usage": balance details plus pricing settings:
- A peak/off-peak pricing toggle. When enabled, every request is priced by the time window it occurred in, giving accurate amounts even when a conversation spans peak and off-peak windows.
-
(Same conversation as above, but with the peak/off-peak toggle on. Pricing the whole conversation with either the peak or the off-peak rate alone would be wrong, because it spans both windows.)
- Usage is priced by the window at the time the request occurred; only the official API is supported for now. Unmatched models only show token counts, not amounts.
Layout
dsh-usage-meter/
package.json plugin package declaration
cordis.patch.yml bundle patch: mounts this plugin as a Cordis host plugin
host.js host ESM: TypertRemoteService RPC (balance/usage/pricing)
client.js client static module: header pill + settings page (bilingual, follows DSH language)
install.ps1 one-click install
uninstall.ps1 one-click uninstall
README.md English docs
README.zh.md Chinese docs
Install
1. Direct install:
Clone this repo locally, then run its install.ps1:
cd <plugin directory>
powershell -ExecutionPolicy Bypass -File .\install.ps1
2. Install via npm:
Run in PowerShell:
dsh plugin --profile web add @hunterchcl/dsh-usage-meter
Requires pnpm and dsh to be installed.
Uninstall
Run uninstall.ps1:
powershell -ExecutionPolicy Bypass -File .\uninstall.ps1 # keep local data
powershell -ExecutionPolicy Bypass -File .\uninstall.ps1 -RemoveData # also delete usage/pricing data
Or via pnpm:
dsh plugin --profile web remove @hunterchcl/dsh-usage-meter
Notes & Limitations
- Usage is a local estimate (based on persisted usage records in the DSH session event log:
assistant/chunkandassistant/message), for reference only — not a platform bill; the DeepSeek Open Platform is authoritative. - Opening a session computes its full historical usage (including records from before this plugin was installed), priced by the peak/off-peak window at the time each request occurred.
- If you later run
pnpm installmanually in the profile directory, it may clean up local plugin directories not declared independencies; if that happens, re-runinstall.ps1. - This project is open source under the MIT license. You may freely distribute and modify it, but must retain the original copyright and license text.
Comments
Loading…
Similar plugins
by xfpuls
DSH 用量与费用统计 + 提问置顶:本轮花费、今日 token 与消费、空闲/高峰时段,并钉住最新提问
★ 0
MIT
JavaScript
Oct 6, 2026
dsh plugin --profile web add dsh-usage-suiteby 1514100951
DSH web 用量/费用悬浮按钮插件:账户余额、峰谷时段、今日/本会话消费估算与 token 统计(含设置开关)
★ 3
MIT
JavaScript
Aug 27, 2026
dsh plugin --profile web add dsh-usage-footerby wannanbigpig
DeepSeek Harness web 用量与计费插件:官方余额、Token 用量、贡献热图与按小时计费统计。Balance, token usage, contribution heatmap & per-hour cost stats for dsh web.
★ 3
MIT
JavaScript
Oct 9, 2026
dsh plugin --profile web add @wannanbigpig/dsh-usage-statsby godpanzz
DSH 插件:统计今日 token 用量与费用(按模型价格与峰谷计费),Web 侧栏面板 + /usage 命令
★ 0
MIT
JavaScript
Aug 17, 2026
dsh plugin --profile web add dsh-usageby wangfujian762
DSH 网页右下角的额度小仪表:官方余额、峰谷计价时段、本地自算今日消耗(可配置重置时间),可插可卸载
★ 0
MIT
JavaScript
Aug 17, 2026
dsh plugin --profile web add dsh-web-quota-meterby olimc2016
DSH(DeepSeek Harness)Token 用量与花费面板插件:今日消费、预算进度、成本构成、缓存命中省下的钱。社区插件,非官方。
★ 1
MIT
JavaScript
Sep 24, 2026
dsh plugin --profile web add dsh-token-meter-panel