DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-client-usage

j

dsh-client-usage

Manifest valid★ 4

DeepSeek Harness (DSH) Web Client Plugin: real-time display of session-level API token usage and estimated cost, supporting cache hit/miss bucketing, context occupancy, and automatic adaptation to DeepSeek peak-valued pricing and price adjustments|DSH web plugin: real-time token usage & cost estimate

UI (client)Machine translated

dsh-client-usage

DSH web 客户端插件:在对话输入框下方的 dock 区显示 API 用量 —— token 用量分桶(缓存未命中输入 / 缓存命中输入 / 输出)、缓存命中率、上下文占用百分比,以及按 DeepSeek 官方定价估算的费用(支持峰谷时段自动计价)。

截图

输入框下方一行用量显示:

usage line

点击展开明细面板:

usage panel

显示内容

  • 输入框下方一行小字(与内置 StatsLine 并列,位于其右侧): API 用量 ↑1.23M ↓345K ≈¥0.42
  • 点击展开面板:
    • 输入(缓存未命中): tokens · 费用
    • 输入(缓存命中): tokens · 费用(含命中率 %)
    • 输出: tokens · 费用
    • 上下文占用: %
    • 估算费用合计 · 当前计价档位(高峰价 / 空闲价)

数据来源

  • tokenUsage / contextPressure 会话投影,由内置 @deepseek-ai/dsh-token-meter 提供(provider 报告的用量,非估算)。
  • 费用 = 分桶 tokens × 单价,单价按 usage-panel: 设置节(见下)。

价格设置(默认值 = DeepSeek 官方 deepseek-v4-flash,元/百万 tokens)

插件按日期自动切换价格档位:

  • 2026-08-17 之前:使用改价前的平峰统一旧价(0.02 / 1 / 2)
  • 2026-08-17 00:00(北京时间)起:使用新峰谷定价
    • 高峰时段 09:00–12:00、14:00–18:00:0.10 / 3.0 / 9.0
    • 空闲时段:0.05 / 1.5 / 4.5

编辑 ~/.dsh/settings.yaml 可覆盖任意档位:

usage-panel:
  priceMode: auto            # auto | peak | offpeak
  # 旧价(2026-08-17 前,平峰统一)
  legacyCacheHitYuan: 0.02   # 缓存命中输入
  legacyCacheMissYuan: 1     # 缓存未命中输入
  legacyOutputYuan: 2        # 输出
  # 新价 · 高峰(2026-08-17 起)
  cacheHitPeakYuan: 0.10     # 缓存命中输入
  cacheMissPeakYuan: 3.0     # 缓存未命中输入
  outputPeakYuan: 9.0        # 输出
  # 新价 · 空闲
  cacheHitOffpeakYuan: 0.05  # 缓存命中输入
  cacheMissOffpeakYuan: 1.5  # 缓存未命中输入
  outputOffpeakYuan: 4.5     # 输出

高峰时段 = 北京时间 09:00–12:00、14:00–18:00。auto 按当前北京时段自动切换;其他模型可在同一节中覆盖为对应价格。

安装

前置:已安装 Node.js ≥ 18,并全局安装 dsh:

npm i -g @deepseek-ai/dsh --registry=https://registry.npmmirror.com

兼容性:本插件基于 dsh 0.1.0-rc.6 开发。安装前可用 dsh --version 确认版本。若你的 dsh 版本不同,插件 API 可能有不兼容,届时以实际表现为准。

首次安装:如果你之前从未运行过 dsh web,~/.dsh/profiles/web/ 目录还不存在。请先运行一次 dsh web(会自动生成 profile 结构),然后停止它,再继续下面的步骤。或直接执行下方命令中的 New-Item 手动创建目录。

方式一:git clone(推荐)

# 1. 克隆本仓库
git clone https://github.com/jLeon-account/dsh-client-usage.git "$env:USERPROFILE\dsh-client-usage"

# 2. 复制到 dsh profile 的插件目录
$dst = "$env:USERPROFILE\.dsh\profiles\node_modules\dsh-client-usage"
New-Item -ItemType Directory -Path $dst -Force | Out-Null
Copy-Item "$env:USERPROFILE\dsh-client-usage\*" $dst -Recurse -Force

方式二:手动复制(无需 git)

把本仓库整个文件夹复制为 %USERPROFILE%\.dsh\profiles\node_modules\dsh-client-usage 即可(Windows 可用 robocopy <仓库路径> %USERPROFILE%\.dsh\profiles\node_modules\dsh-client-usage /E)。

启用插件

在 %USERPROFILE%\.dsh\profiles\web\cordis.patch.yml 中启用插件。如果该文件或目录还不存在,先创建(或用 CMD):

New-Item -ItemType Directory -Path "$env:USERPROFILE\.dsh\profiles\web" -Force | Out-Null

该文件默认内容是空数组 [](首次安装则为新创建的空文件),请把它改为:

- insert:
    - id: client-usage
      name: dsh-client-usage

注意:如果该文件已经有其他插件配置,请在顶层数组末尾追加上面这个 - insert: 条目,不要覆盖已有内容。

重启生效

重启 dsh web(或关闭并重新打开桌面应用)。插件在启动时扫描并加载。

卸载

  1. 从 cordis.patch.yml 中删除 - insert: 里的 client-usage 条目(或整个 insert 块)。
  2. 删除 %USERPROFILE%\.dsh\profiles\node_modules\dsh-client-usage 文件夹。
  3. 重启 dsh web。

Comments

Loading…

Similar plugins

dsh-usage-plugin

by feiyang-dev

DeepSeek Harness 用量与消耗插件(dsh-usage-plugin)—— 每次调用的 token 用量/缓存命中统计、峰谷计费、余额查询、CSV/JSON/PNG 导出,可经桌面端一键安装或命令行 dsh plugin add 安装。

Tools & CapabilitiesManifest valid

★ 37

MIT

JavaScript

Sep 24, 2026

dsh plugin --profile web add @feiyang666/dsh-usage-plugin

by MrTomTao

给DeepSeek Harness Web GUI用的会话token计费插件:在会话标题栏显示本次会话的实时花费,点开可以看输入 / 缓存命中 / 缓存写入 / 输出 / 推理的分项、按模型的账单,以及当前用的是高峰还是空闲时段价。

Manifest valid

★ 0

MIT

JavaScript

Sep 23, 2026

dsh plugin --profile web add dsh-token-billing

by 1998moye

DSH(DeepSeek Harness)Web 用量与费用看板插件:余额、今日/本周/本月/累计消费、API 请求次数、token 明细与趋势图,按 DeepSeek 官方峰谷价估算,数据从本地会话日志全量重建

Development & InfrastructureManifest valid

★ 0

MIT

JavaScript

Sep 15, 2026

dsh plugin --profile web add dsh-plugin-usage

by oliblue-evan

DSH 用量与余额:会话用量、按每笔实际发生时刻与模型计价的费用(峰谷/档位)、账户余额;账号登录无需 API Key。

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Sep 29, 2026

dsh plugin --profile web add dsh-usage-pill

by huanyuLv

DeepSeek Harness (DSH) Web 插件: 余额 + 峰谷计价潮汐提示。显示 DeepSeek 账户余额与本会话花费, 并在余额前提示当前峰/谷价格档位、距切换倒计时与使用建议。

UI & ExperienceManifest valid

★ 8

MIT

JavaScript

Aug 22, 2026

dsh plugin --profile web add dsh-balance-tide

by GHJIVHIDD

DeepSeek Harness 的用量(Usage)部署级插件:会话视图环新增「用量」页签,实时跟踪输入/输出/缓存命中 tokens 与费用(DeepSeek 官方峰谷价 + OpenCode Go 套餐价),动态渐变蓝状态条、自定义价格表、CSV/JSON 导出。原生UI界面

Terminal & ClientsManifest valid

★ 3

Apache-2.0

JavaScript

Aug 20, 2026

dsh plugin --profile web add @deepseek-ai/dsh-plugin-usage