D
dsh-convo-cost
v1.0.0 · 1 天前发布
Real-time cost tracking for the current DSH conversation: a composer-dock line showing the running token usage and DeepSeek official price estimate (base and peak/valley pricing).
README
dsh-convo-cost
实时统计当前对话的 token 用量与费用,在会话输入框下方的状态行显示一行本对话 ¥x.xx · xx tok,悬停可看调用次数 / 输入(含缓存命中)/ 输出(含推理)/
费用 / 计价模式 / 模型明细。
api-docs.deepseek.com/zh-cn/quick_start/pricing 核对
2026-08-17 00:00(北京时间)前用基础价,之后按峰谷价安装
sh
dsh plugin --profile web add dsh-convo-cost
重启 dsh web 后,会话状态行出现「本对话 ¥x.xx · xx tok」。
效果
| 状态行 | 悬停明细 |
| --- | --- |
| 本对话 ¥1.47 · 20.9M tok | 调用 152 次 · 输入 20,812,672 tok(缓存命中 20,812,672)· 输出 118,945 tok(推理 …)· ≈ ¥1.47 · 计价:基础价 · 模型:deepseek-v4-flash |
原理
lib/index.js):通过 DSH 的 sessionProjections 服务订阅会话事件流,在每条
assistant/message 的精确 usage 上版本兼容矩阵
| DSH 版本 | 状态 | 说明 |
|---|---|---|
dsh@0.1.0-rc.6 | ✅ 兼容 | cordis patch ✅ |
dsh@0.1.0 | ✅ 兼容 | 标准 patch ✅ |
dsh@0.2.0 | ⚠️ 待验证 | 待实测(API 可能在变) |
dsh@0.3.0+ | ❓ 未知 | 尚未发布 |
💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正
元数据
- License
- MIT
- npm
- dsh-convo-cost
- Repo
- git+https://github.com/ljr282341583/dsh-convo-cost.git
- Engines
{"node":">=20"}- Weekly DL
- 0
- Monthly DL
- 0
- dsh.bundle
{"bundle":{"patch":"./cordis.patch.yml"},"client":{"platform":"web","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-ui-conversation"]}}