DeepSeek Harness plugin

dsh-billing

Account balance and session cost commands, tools, and Web UI capsules for DeepSeek Harness.

Jump to install

Source facts

Repository
TheTianzz/dsh-billing
Latest update
Aug 14, 2026
Category
Usage & Billing
GitHub stars
7
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/TheTianzz/dsh-billing
Plugin: dsh-billing
Author: TheTianzz

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-billing

DeepSeek Harness 插件:账户余额 + 会话费用(人民币),带 Web UI 悬浮显示。

功能

入口用法说明
UI 会话头部双胶囊无需操作,常驻显示余额 + 本会话费用 并排显示在会话标题旁;点击任一胶囊立即刷新两个
悬停明细鼠标悬停余额胶囊:充值/赠金/美元;费用胶囊:按模型的 token 与费用拆分
斜杠命令 /balance聊天框输入 /balance查询账户余额(人民币优先,附美元)
斜杠命令 /cost聊天框输入 /cost当前会话费用明细
工具 deepseek_billing直接问模型"余额多少/花了多少钱"query = balance / cost / both

结构

  • host.js — 宿主插件:命令 + 工具 + /billing/{balance,cost} RPC 通道(供浏览器胶囊轮询)
  • client.js — 浏览器 bundle(__ModuleLoader__ 工厂格式,仅依赖平台共享的 react,无构建步骤)

- conversation.session.header.actions 槽位(负数 order = 静态会话上下文)→ 余额 + 会话费用双胶囊

  • package.json — 声明 dsh.bundle(空 patch)+ dsh.client(web 平台)
  • cordis.patch.yml — 空层;本插件由 profile 的 cordis.patch.yml 插入行激活

安装(一条命令)

组合包自带激活层(cordis.patch.yml),安装后自动生效,无需手改任何配置:

# 从本地目录安装
dsh plugin --profile web add ./deepseek-billing

# 或从打包产物安装(跨机器分发推荐)
dsh plugin --profile web add ./dsh-billing-0.2.0.tgz

# 或从 npm / git 安装(发布后)
dsh plugin --profile web add dsh-billing
dsh plugin --profile web add github:you/dsh-billing

安装后重启 dsh web,再刷新浏览器页面(F5)使新 boot graph 生效。 宿主侧 API key 使用 DEEPSEEK_API_KEY 凭据引用(在 Web 模型设置页保存即可)。

配置(全部可选)

config.pricing 按模型覆盖单价(元/百万 tokens),支持峰谷价自动切换(见 host.js 顶部默认值)。例如:

config:
  pricing:
    deepseek-v4-pro:
      cacheHit: 0.025
      cacheMiss: 3
      output: 6
      schedules:
        - effectiveAt: '2026-08-17T00:00:00+08:00'
          timezoneOffsetMinutes: 480
          peakWindows: [[9, 12], [14, 18]]
          offPeak: { cacheHit: 0.15, cacheMiss: 4.5, output: 13.5 }
          peak: { cacheHit: 0.30, cacheMiss: 9.0, output: 27.0 }

更新频率(事件驱动,空闲零请求)

  • 轮次中:每完成 10 步刷新一次(步号跨过 10 的整数倍时触发)
  • 每轮结束(turn/end):刷新一次,结算本轮收尾的步(短轮也靠它结算)
  • 挂载 / 切换会话 / 点击胶囊 / 页面从后台切回可见:立即刷新
  • 空闲时零请求:没有定时轮询;只有上述事件发生时才有请求
  • 服务端按需从内存会话日志计算,无后台常驻任务

价格自动同步(官方改价怎么办)

  • 启动时 + 每 12 小时自动拉取官方价格页(https://api-docs.deepseek.com/zh-cn/quick_start/pricing/)解析最新单价(含峰谷价与生效时间)
  • 解析失败自动回退:上次成功在线值 → 内置默认值;费用输出会标注当前来源与同步时间
  • 优先级:用户显式配置 > 官方在线同步 > 内置默认(用户对某个模型写过 pricing 就永远以它为准)
  • 可在 config.priceSync 关闭或调整:{ enabled: true, url: "...", intervalMs: 43200000 }

计费口径

  • token 取自会话日志中 provider 上报的 usage(含缓存命中拆分;失败重试也计入)
  • 单价内置官方价格,2026-08-17 起自动按北京时间峰谷价
  • 子代理是独立会话,各自单独统计
  • 输出为估算值,实际扣费以 DeepSeek 官方账单为准

维护提示

  • client.js 后:客户端 HMR 会自动更新,刷新页面必生效
  • host.js 后:若热重载未生效(Node ESM 缓存),可改文件名/包名触发重导入,或重启 dsh web

官方文档:

  • 查询余额:https://api-docs.deepseek.com/zh-cn/api/get-user-balance/
  • 模型 & 价格:https://api-docs.deepseek.com/zh-cn/quick_start/pricing/
  • Harness 客户端模块:https://deepseek-harness.github.io/deepseek-harness/reference/subsystems/client-modules