WFMinerva/dsh-turn-cost ↗★ 0

dsh-turn-cost

Per-turn/session estimated cost plus subscription quota windows for DeepSeek Harness (dsh), shown in the Web UI: pay-as-you-go DeepSeek routes show money, Kimi/Aliyun subscription routes show tokens plus the official live window reading 适合需要实时监控和估算DSH会话Token消耗及API费用的用户。

Package
dsh-turn-cost
Compatibility
Unverified
Harness peer range
*
Cordis peer range
*
Version
0.6.2
License
MIT
Last updated
Oct 2, 2026

Other repositories with this package name

Install

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

dsh-turn-cost

featured in awesome-dsh-plugin

在 DeepSeek Harness(dsh)Web UI 里显示每轮与整会话的预估费用:按 provider 上报的真实 token 用量与本地费率表计价,人民币结算、峰谷自动分档。

A DeepSeek Harness (dsh) web plugin that shows an estimated cost per turn and per conversation, priced from provider-reported token usage with a local rate table — the built-in official DeepSeek CNY card, optionally overlaid with your own.

界面

会话累计(输入框上方,与 dsh 官方统计条同一带):

会话累计读数与官方统计条并排

每轮费用(每条 AI 回复的操作行):

每轮费用读数

功能

每轮费用:每条 AI 最终回复的操作行里多一行灰色小字。

本轮 ¥0.67 · 332万 token · 缓存读 100%

会话累计:输入框下方(与 dsh 官方统计条同一带)显示整会话汇总,并带上该会话实际用过的模型名。

deepseek-flash · 本会话 ¥15.42 · 3280万 token · 缓存读 99%
  • 用量取自 provider 上报值:未缓存输入、缓存读、缓存写、输出四桶分别统计,不是按文本估算 token。
  • 一条用户消息算一轮:中间的模型与工具步骤合并计为一轮,不重复计费。
  • 打开历史会话同样显示:每一轮照常标注,会话累计覆盖该会话的全部历史。
  • 没有单价的模型不编造金额:只显示 token 数,并计入「未计价」,不会按 0 元冒充已知价格。
  • 金额精确到分,不足半分显示 `` | | tarball | dsh plugin --profile add .tgz |

也可以在应用内侧边栏的「插件」页用添加插件,填入上面任一形式的地址。

  • 把 换成目标 profile 名,例如桌面版为 desktop。
  • 本地目录会被装成 link:(指向检出目录),改完代码重启即生效;npm 与 tarball 形式是复制安装,适合固定版本。
  • 安装后需要重启该 profile 才生效:插件成员在启动时确定(dsh web 重新启动,桌面应用完全退出后重新打开)。
  • 卸载:dsh plugin --profile remove dsh-turn-cost。

自定义费率表

内置价目只覆盖 DeepSeek 官方模型。其它模型(自部署、代理转发、按套餐计费等)用一份本机 JSON 叠加:

  1. 复制 rates.example.json 到本机任意位置,按各条的 note 说明填写;

  2. 在目标 profile 的 cordis.patch.yml 里给本插件加一段配置:

    - id: turn-cost
      name: dsh-turn-cost
      config:
        ratesPath: 
    
  3. 重启该 profile 生效。

费率表字段:

  • models.:平价条目 { input, cacheRead, cacheWrite?, output },或峰谷条目 { peak: {...}, offPeak: {...} };单位为元 / 百万 token,未写的字段按 0 计。
  • 模型名可写成 /,用于区分同一模型在不同来源上的单价。
  • aliases:模型名归一化,处理同一模型的多种写法。
  • 没有 token 单价的套餐,把四个单价都写 0 并加 note 说明——token 照常显示,金额恒为 0,不编造价格。
  • 文件缺失或损坏时自动回退内置价目,插件照常工作。

隐私

  • 用量取自本机 dsh 会话日志,单价取自本机费率表 JSON;两者都只在本机读取,不外发。
  • 不读取、不复制、不记录任何 API Key 或凭据。
  • 官方价目随包内置,不联网获取价格。

License

MIT