Wanbinyu/dsh-billing
Local per-model cost, token usage, and session quota plugin for DeepSeek Harness
Project Overview项目介绍
dsh-billing is a community-developed native plugin built exclusively for DeepSeek Harness, designed to track token usage and calculate estimated usage costs per conversation session. To install the plugin, you can run the DSH CLI command dsh plugin --profile web add https://github.com/Wanbinyu/dsh-billing/releases/download/v0.6.6/dsh-billing-community-bundle-0.6.6.tgz then restart DSH to activate it. The plugin includes three core packages: a core billing module that aggregates costs per provider and model, a web UI component that renders cost data, and a pre-bundled package that combines the other two for out-of-the-box installation. If you prefer to customize the plugin combination manually, you can also install the two core packages separately via npm and add the plugin entries to your profile’s cordis.patch.yml file.
The plugin generates a billing projection for each conversation session, and the web client renders cost information directly from the precomputed projection. It supports separate cost tracking for the same model ID hosted by different providers, for example deepseek/deepseek-v4-flash and openrouter/deepseek-v4-flash are counted separately. You can configure custom pricing for each model and set a per-session spending quota, with support for both exact provider/model matching and fallback matching for all providers of the same model. The web UI shows costs for the current turn and the full session, and increases alert color intensity as the quota approaches 50%, 80%, and 100%.
This plugin is released under the open-source MIT license, and all calculated costs are for local reference only. They do not constitute an official bill, and the plugin will not automatically block model calls when the quota is exceeded. Currently, the quota is calculated per-session, and deployment-level global budget tracking is not yet implemented. Automated tests cover core features like host configuration, projection deduplication, and quota state, so core functionality is stable for regular use. The plugin is compatible with multiple pre-release versions of DeepSeek Harness, ranging from 0.1.0-rc.6 to 0.1.2-rc.1, so you should verify compatibility with your specific host version before installation.
dsh-billing 是面向 DeepSeek Harness 开发的独立社区原生插件,用于统计每个对话会话的 Token 使用量并计算对应的预估使用费用。它包含三个相互独立的核心模块:按提供商和模型分开统计费用的核心计费模块、展示费用信息的前端 UI 组件,以及整合两者的可直接安装的 bundle。可通过 DSH CLI 命令直接安装,同时支持一键 bundle 安装和手动模块化自定义安装两种方式。
插件会在每个会话生成计费投影数据,前端从投影数据渲染费用界面,支持按照不同提供商的相同模型分别统计费用。用户可以在配置中自定义不同模型的价格、设置单会话额度,支持精确匹配 provider/model 格式,也支持回退匹配所有提供商下的同名模型。Web 界面会显示本轮和整个会话的费用,额度达到阈值后会逐步增强颜色提示。
本插件为开源社区项目,采用 MIT 许可证,所有计算得出的费用仅为本地参考值,不生成官方账单也不会自动阻止超限调用。当前仅支持按单个会话计算额度,暂未实现部署级的全局预算功能。适配多个 DeepSeek Harness 预发布版本,需注意不同宿主版本的兼容性问题,安装后需重启 DSH 才能生效。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-billing(Wanbinyu/dsh-billing)
仓库:https://github.com/Wanbinyu/dsh-billing
本站详情页:https://www.yhbd.top/plugins/wanbinyu-dsh-billing/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 3 · 最近提交 2026-09-25 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【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 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
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 https://github.com/Wanbinyu/dsh-billing/releases/download/v0.6.7/dsh-billing-community-bundle-0.6.7.tgz
把 Wanbinyu/dsh-billing 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-billing
v0.6.7 价格更新:官方
deepseek/deepseek-official路由按调用时刻使用 DeepSeek 价目。deepseek-flash与仍被路由的旧 Flash 名字走 V4.1-Flash 价,deepseek-v4-pro继续走 Pro 价。兼容性仍以 Harness0.1.5-rc.2验证为准。
面向 DeepSeek Harness 的会话计费与额度插件。
[!NOTE] 这是独立的社区项目,不属于 DeepSeek Harness 官方发行版。费用是本地参考值,不是账单,也不会自动阻止模型调用。
包含组件
| 包 | 作用 |
|---|---|
dsh-billing |
按 provider/model 统计 token 费用,生成 billing session projection,并支持每会话额度。 |
dsh-client-ui-billing |
在 Web composer dock 显示本轮/会话费用、额度进度、未定价模型提示和模型明细。 |
dsh-billing-community-bundle |
将上面两个包和 cordis.patch.yml 组合成可安装的 DSH bundle。 |
host 侧负责计价和 projection,浏览器侧从 host 已计算的 projection 渲染界面。可安装的根 bundle 同时导出 host 与 Web client 入口,因此从 GitHub 安装不依赖另外发布两个内部包。相同模型 ID 在不同 provider 下会分开统计,例如 deepseek/deepseek-v4-flash 和 openrouter/deepseek-v4-flash。
v0.6.7 在 v0.6.6 的 Harness 0.1.5-rc.2 兼容修复上更新了官方价目。
作为 bundle 安装
仓库根目录的 bundle 包含 dsh.bundle 声明和两个运行时包。安装到 web profile:
dsh plugin --profile web add https://github.com/Wanbinyu/dsh-billing/releases/download/v0.6.7/dsh-billing-community-bundle-0.6.7.tgz
安装后重启 dsh。bundle 通过一个 billing 配置条目同时启用 host projection 和 Web 费用条,价格优先使用配置,其次使用内置 USD 模型目录。
手动安装
宿主项目需要自己控制组合层时,可以安装两个包:
npm install ./packages/dsh-billing ./packages/dsh-client-ui-billing
然后在 profile 的 cordis.patch.yml 中加入:
- insert:
- id: billing
name: dsh-billing
config: {}
- id: ui-billing
name: dsh-client-ui-billing
配置价格和额度
留空 models 时,deepseek 和 deepseek-official 上的 deepseek-flash、deepseek-v4-flash、deepseek-v4-flash-0731、deepseek-v4-flash-vision-exp、deepseek-v4-pro 按官方 USD 价目计费。价格按每条用量的时间戳冻结:2026-09-10 04:00 UTC 起 Flash 家族使用 V4.1-Flash 价,Pro 保持自己的价。高峰是周一到周五 UTC 01:00–04:00 和 06:00–10:00,2026 年中国法定节假日全天按空闲价。缓存写入按未命中输入价计。图片 token 由供应商折进输入用量后,随输入一起计价。
显式 models 会覆盖这个价目,并且是单一价格,不再区分峰谷。其他供应商仍走内置 USD 目录。
- id: billing
config:
currency: USD
quota:
limit: 5
价格键优先使用精确的 provider/model,例如 openrouter/deepseek-v4-flash;只写模型 ID(例如 deepseek-v4-flash)仍然有效,并作为所有 provider 的兼容回退。如果在 bundle 已插入后修改 billing 行,Harness 的 patch 会替换整段 config,因此需要保留所有希望继续使用的配置字段。
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
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