TheTianzz/dsh-billing
DeepSeek Harness 插件:账户余额 + 会话费用(/balance /cost 命令、deepseek_billing 工具、Web UI 双胶囊),官方价格每 12 小时自动同步
Project Overview项目介绍
dsh-billing is a native DeepSeek Harness plugin built exclusively to track DeepSeek API usage costs and display account balance for DSH web users. It can be installed in one command through the DSH CLI: users can run dsh plugin --profile web add followed by the local directory, compressed package, npm package name, or GitHub repository address. After installation, users need to restart the dsh web process and refresh their browser page to activate the plugin, which uses the existing DeepSeek API key saved in DSH's web model settings.
Once activated, dsh-billing adds two permanent capsules to the top of each conversation that show current account balance and total session cost, and clicking either capsule immediately refreshes both values. Hovering over a capsule opens a detailed breakdown: the balance capsule shows recharge, bonus, and USD amounts, while the cost capsule breaks down spending by model and token type. Users can also call slash commands /balance and /cost or ask the AI model directly to get detailed information via the built-in deepseek_billing tool.
dsh-billing is open source under the MIT license, and it uses an event-driven refresh logic that makes zero unnecessary network requests when the plugin is idle. It automatically pulls the latest DeepSeek official pricing every 12 hours, supports automatic peak/off-peak price switching, and lets users override default prices for any model directly in the plugin configuration. All calculated costs are estimates, and actual charges will match the official DeepSeek billing statement.
这是一款专门为 DeepSeek Harness 开发的原生计费插件,用于实时统计 DeepSeek API 会话消耗费用、查询账户可用余额,自带网页端 UI 悬浮显示功能。插件提供了多个使用入口,包括会话头部常驻显示的余额和本会话费用双胶囊,点击可立即刷新,鼠标悬停即可查看按模型拆分的明细,还支持斜杠命令 /balance 和 /cost,以及供模型直接调用的 deepseek_billing 工具。
该插件适合使用 DeepSeek Harness 网页端、需要实时掌握 API 消耗和账户余额情况的开发者和普通用户使用。典型使用流程中,用户安装并重启 DSH 网页端后,无需额外手动配置就能在每个会话顶部看到余额和当前会话费用,需要更新数据或查询明细时,可以点击胶囊手动刷新,或调用斜杠命令、直接提问模型获取完整的费用拆分统计信息。
dsh-billing 采用 MIT 许可证开源,完全免费使用,插件采用事件驱动刷新逻辑,空闲时不会发起额外请求,只有特定事件触发时才会拉取更新。插件会自动每 12 小时拉取 DeepSeek 官方最新定价,支持峰谷价自动切换和用户自定义定价覆盖,费用为估算值,实际扣费以 DeepSeek 官方账单为准。安装后需要重启 dsh web 并刷新浏览器页面才能生效。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-billing(TheTianzz/dsh-billing)
仓库:https://github.com/TheTianzz/dsh-billing
本站详情页:https://www.yhbd.top/plugins/thetianzz-dsh-billing/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 6 · 最近提交 2026-08-14 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 6 stars - very few users, little community feedback星标只有 6,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add dsh-billing
把 TheTianzz/dsh-billing 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
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
官方文档:
Han-1413141/dsh-cost-meter
wssfk12138/dsh-damage-pulse
songoao25/dsh-bottom-info-bar
Phant0Meow/dsh-meow-cachebilling
Rianico/dsh-better-edit
Ghost011118/dsh-balance-meter
ai-shushu/dsh-quota-meter
TwotwoPiggy/dsh-balance