PeterZoneZz/dsh-token-cost1

@dsh-user/dsh-token-cost

DeepSeek Harness 网页端插件:提供一个可拖拽的鲸鱼悬浮窗,实时显示单次请求的 Token 费用、会话/累计花费以及 DeepSeek 官方账户余额。

AI 分析

核心用途是直观监控 API 消费情况。适合对大模型调用成本敏感,希望在界面右下角随时掌握当前对话花费及官方余额的 DSH 用户。余额查询需配置 API Key。

包名
@dsh-user/dsh-token-cost
版本
0.1.0
许可证
MIT
最近更新
2026年8月15日

安装

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

4. 配置 API Key(余额查询)

余额查询复用 DSH 的 credentials 机制:在 DSH Web 的 模型设置页写入 DEEPSEEK_API_KEY,或启动 DSH 前 export DEEPSEEK_API_KEY=sk-...。不配置也不影响 token 用量与费用显示,仅余额部分显示降级提示。

⚙️ 配置

价格表与余额查询均可通过 profile 的 cordis.patch.yml 覆盖(价格单位为元 / 百万 tokens,按模型 id 匹配,未匹配回落 defaultcacheWrite 按输入价计费,cacheRead 按缓存命中价计费):

- id: token-cost
  config:
    prices:
      deepseek-chat:     { input: 2, cacheRead: 0.5, cacheWrite: 2, output: 8 }
      deepseek-reasoner: { input: 4, cacheRead: 1,   cacheWrite: 4, output: 16 }
      deepseek-v4-flash: { input: 1, cacheRead: 0.25, cacheWrite: 1, output: 4 }
      default:           { input: 2, cacheRead: 0.5, cacheWrite: 2, output: 8 }
    balance:
      enabled: true
      apiKeyEnv: DEEPSEEK_API_KEY
      baseUrl: https://api.deepseek.com
      pollMs: 60000

🖱️ 使用

操作效果
鼠标悬停鲸鱼鲸鱼摇摆,外圈环形显示剩余余额百分比
点击鲸鱼展开锚定卡片(余额 / 本次会话用量 / 累计花费)
按住拖动移动浮窗;靠近屏幕左右边缘松手自动吸附
点击卡片外部 / Esc / ✕关闭卡片
卡片打开时拖动鲸鱼卡片跟随移动,保持锚定