wei2yun/dsh-api-cost ↗★ 1

dsh-api-cost

统计并展示会话的API Token费用 适合需要监控和统计DSH会话中API调用Token消耗及费用的用户。

包名
dsh-api-cost
兼容性
待验证
版本
1.0.1
许可证
MIT
最近更新
2026年10月22日

同名包的其他仓库

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:wei2yun/dsh-api-cost

Configuration

Set the row's config in your profile's cordis.patch.yml (the Web profile reloads it live; other profiles apply it on restart):

- id: api-cost
  config:
    currency: CNY          # CNY (¥) | USD ($)
    peakPricing: auto      # auto | peak | offPeak
    prices:
      deepseek-flash:
        input: 1
        cacheRead: 0.02
        cacheWrite: 0
        output: 4
        peak:
          input: 2
          cacheRead: 0.04
          output: 8
FieldDefaultMeaning
currencyCNYSelects the built-in price book and the symbol.
peakPricingautoauto applies the Beijing peak windows; peak/offPeak bill every call at one rate.
offPeakDates[]Extra statutory-holiday dates (YYYY-MM-DD, Beijing time) billed at the off-peak rate; 2026 is built in.
prices{}Per-model overrides in the configured currency, per 1M tokens. A key is a bare model for any provider route, or provider/model for one exact route. An entry replaces that model's whole price set; a peak block overrides only the fields it sets, and the rest fall back to the entry's base price.

Overrides are how you track a promotional price, a self-hosted endpoint, or a provider the built-in book does not know. Prices and currency only affect presentation: changing them re-prices existing history, it does not rewrite it.