OkliaoliO/dsh-token-counter ↗★ 1
dsh-token-counter
实时统计并显示每轮对话消耗的Token与费用 适合需要精细监控API消费额度、了解每轮对话具体花费的用户。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:OkliaoliO/dsh-token-counter说明文档
阅读完整 README ↗Configuration
A browser half is a frozen artifact — a Loader row's config reaches the Host half only — so tunables are named constants at the top of lib/client.js:
| Constant | Meaning |
|---|---|
DICTS | UI copy, one dictionary per interface language, selected by labelsFor |
PRICES | Official per-1M-token rates, keyed by currency (CNY / USD), each with routes (keyed by provider/model) plus a default. Values are that currency's off-peak column |
FALLBACK_CURRENCY | Currency used when the interface language is not Chinese, or is unknown |
PEAK | Peak-window multiplier; set enabled: false to always bill off-peak |
BALANCE_POLL_MS | Wallet re-read interval for the chip, once a reading has landed |
SYMBOL | Currency symbol per code |
Price sources: (CNY) and (USD). Both tables must be edited together. Each page prints a peak and an off-peak column; PRICES holds the off-peak one, because PEAK already doubles it.