SanChou0627/dsh-token-bill ↗★ 0

dsh-token-bill

提供实时余额查询与按小时Token消耗统计 适合需要精确监控DeepSeek API余额及Token花费的用户。

包名
dsh-token-bill
兼容性
待验证
Harness 依赖范围
*
版本
0.1.0
许可证
MIT
最近更新
2026年9月28日

安装

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

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']
FieldDefaultMeaning
dshHome$DSH_HOME or ~/.dshDSH home directory.
profile$DSH_PROFILE or webProfile whose in-profile ledger path is also checked.
sessionsRoot/sessionsRoot of the session logs.
outDir$DSH_TOKEN_BILL_DIR or /token-billStatement output directory.
decimals4Decimal places in printed amounts.
chartWidth26Bar width for terminal charts.
costModeledgerMoney source, as above.
historyDays1Days in the per-day summary.
maxBytes134217728 (128 MB)Skip any single session log larger than this.
timeoutMs10000Balance request timeout.
writeFilestrueWhether statements may be written.
modelsbuilt-in tablePrice table override.
holidaysHOLIDAYS_2026Statutory holiday day keys billed at the valley rate.