← 返回列表
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).

deepseekharnessdshdsh-plugincostusagetokensbilling

README

dsh-convo-cost

实时统计当前对话的 token 用量与费用,在会话输入框下方的状态行显示一行
本对话 ¥x.xx · xx tok,悬停可看调用次数 / 输入(含缓存命中)/ 输出(含推理)/
费用 / 计价模式 / 模型明细。

  • 计价标准:DeepSeek 官方价目表(人民币 / 百万 tokens),已与

  • api-docs.deepseek.com/zh-cn/quick_start/pricing 核对
  • 自动切换计价:2026-08-17 00:00(北京时间)前用基础价,之后按峰谷价

  • 高峰时段(北京时间 09:00-12:00、14:00-18:00)自动按高峰价计

  • 模型名来自请求头,未知模型按 ¥0 计
  • 安装

    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 |

    原理

  • Host 侧lib/index.js):通过 DSH 的 sessionProjections 服务订阅会话事件流,

  • 在每条 assistant/message 的精确 usage 上
    查看完整 README →

    版本兼容矩阵

    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"]}}