← 返回列表
D

dsh-token-price

v0.2.0 · 2 天前发布

Live token cost + account balance readouts for the DeepSeek Harness Web UI

dshdsh-plugindeepseekdeepseek-harnesstokencostpricebalance

README

dsh-token-price

<!-- README-I18N:START -->

English | 汉语

<!-- README-I18N:END -->

DeepSeek Harness Web 界面提供准确的 Token 成本和账户余额显示。

功能

  • 单轮成本:在每条 AI 回复的统计行后按 hover 显示本轮已完成请求步骤的 ¥... 成本。

  • 会话累计:汇总每一个已上报用量的请求步骤;已取消但已产生用量、却没有最终回复的请求也会计入。

  • 人民币估算:仅以 ¥... 显示按市场 USD/CNY 汇率换算的估算值,界面不显示 USD;它不代表扣款金额,也不是官方单请求 CNY 价格。

  • 账户余额:直接显示官方 GET /user/balance 的返回结果,优先选用返回的 CNY 余额;若接口没有 CNY,则保留接口实际返回的币种。
  • USD 仅作为内部精确计费主值。没有明确官方价格规则的 provider/model 路由显示为 未定价,不会错误显示为零成本。

    安装

    一条命令(需要 pnpm):

    sh
    dsh plugin --profile web add dsh-token-price

    包声明了 dsh.bundledsh.client,会同时启用宿主端服务和浏览器端读数。

    配置

    ```yaml

  • id: token-price

  • name: dsh-token-price
    config:
    balanceBaseURL: https://api.deepseek.co

    版本兼容矩阵

    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-token-price
    Repo
    Engines
    {"node":">=18"}
    Weekly DL
    0
    Monthly DL
    0
    dsh.bundle
    {"bundle":{"patch":"./cordis.patch.yml"},"client":{"platform":"web"}}