YuGaN525/DSH-token-admin ↗★ 0

dsh-turn-cost

在对话下方显示单轮token用量、估算费用与余额。 适合需要精确监控每轮对话成本、峰谷计价及DeepSeek余额的用户。

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

同名包的其他仓库

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:YuGaN525/DSH-token-admin

配置

配置写在 cordis.patch.yml 的 config:,或安装后的 profile patch 里(按 id dsh-turn-cost 覆盖)。

键默认说明
refreshSeconds30余额缓存时间(秒),也是浏览器刷新余额的 TTL
balanceSourceautoauto = 先账号后 API key;account / apikey 强制单路
pricing.currencyCNY费用显示币种;余额按接口返回币种单独显示
pricing.peakMultiplier2峰时价格倍率
pricing.peakWindows[[540,720],[840,1080]]峰时窗口(当地分钟数,09:00–12:00、14:00–18:00)
pricing.weekendValleytrue周末按谷时计价
pricing.holidays2026 法定节假日节假日全天谷时;每年安排公布后补下一年的日期
pricing.timeZoneAsia/Shanghai判断峰谷用的 IANA 时区
pricing.defaultModelflash未匹配到模型时使用的价位
pricing.modelsflash / pro 两档每档 cacheHit、cacheMiss、output,单位为 元/百万 token

覆盖示例:

- id: dsh-turn-cost
  config:
    refreshSeconds: 60
    pricing:
      models:
        flash:
          cacheHit: 0.02
          cacheMiss: 1
          output: 4
        pro:
          cacheHit: 0.15
          cacheMiss: 4.5
          output: 13.5

只写一个字段也会与默认值合并,例如只改 flash.cacheHit 不会把 cacheMiss / output 清零。