OkliaoliO/dsh-token-counter ↗★ 1

dsh-token-counter

Token counter: shows the account balance and, after every conversation turn, that turn's token usage and what it cost. 适合需要精细监控API消费额度、了解每轮对话具体花费的用户。

Package
dsh-token-counter
Compatibility
Unverified
Version
0.3.0
License
GPL-3.0
Last updated
Oct 2, 2026

Install

$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.