OkliaoliO/dsh-token-counter ↗★ 1

dsh-token-counter

实时统计并显示每轮对话消耗的Token与费用 适合需要精细监控API消费额度、了解每轮对话具体花费的用户。

套件
dsh-token-counter
相容性
待驗證
版本
0.3.0
授權
GPL-3.0
最近更新
2026年10月2日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:OkliaoliO/dsh-token-counter

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:

ConstantMeaning
DICTSUI copy, one dictionary per interface language, selected by labelsFor
PRICESOfficial 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_CURRENCYCurrency used when the interface language is not Chinese, or is unknown
PEAKPeak-window multiplier; set enabled: false to always bill off-peak
BALANCE_POLL_MSWallet re-read interval for the chip, once a reading has landed
SYMBOLCurrency 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.