SanChou0627/dsh-token-bill ↗★ 0
dsh-token-bill
提供实时余额查询与按小时Token消耗统计 适合需要精确监控DeepSeek API余额及Token花费的用户。
安裝
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:SanChou0627/dsh-token-bill說明文件
閱讀完整 README ↗Configuration
Add a config block to the plugin's row in your profile's cordis.patch.yml:
- id: token-bill
name: dsh-token-bill
config:
costMode: ledger # ledger | token | both
decimals: 4 # decimals used in printed amounts
chartWidth: 26 # bar width in terminal charts
historyDays: 1 # days included in the per-day summary
writeFiles: true # set false to never write statements
timeoutMs: 10000 # live balance request timeout
outDir: !!js dshHomePath('token-bill')
sessionsRoot: !!js dshHomePath('sessions')
# Override or extend the price table (CNY per million tokens):
# models:
# my-model: { hit: { off: 0.01, peak: 0.02 }, miss: { off: 1, peak: 2 }, out: { off: 4, peak: 8 } }
# Extra statutory holidays, billed at the valley rate all day:
# holidays: ['2027-01-01']
| Field | Default | Meaning |
|---|---|---|
dshHome | $DSH_HOME or ~/.dsh | DSH home directory. |
profile | $DSH_PROFILE or web | Profile whose in-profile ledger path is also checked. |
sessionsRoot | /sessions | Root of the session logs. |
outDir | $DSH_TOKEN_BILL_DIR or /token-bill | Statement output directory. |
decimals | 4 | Decimal places in printed amounts. |
chartWidth | 26 | Bar width for terminal charts. |
costMode | ledger | Money source, as above. |
historyDays | 1 | Days in the per-day summary. |
maxBytes | 134217728 (128 MB) | Skip any single session log larger than this. |
timeoutMs | 10000 | Balance request timeout. |
writeFiles | true | Whether statements may be written. |
models | built-in table | Price table override. |
holidays | HOLIDAYS_2026 | Statutory holiday day keys billed at the valley rate. |