ChengChe106/dsh-session-cost
DSH插件:在Web GUI统计栏中估算每次会话的DeepSeek API费用
Project Overview项目介绍
dsh-session-cost is a native plugin built exclusively for DeepSeek Harness (DSH). It adds a line of estimated current session DeepSeek API cost to the bottom stats bar of DSH’s web GUI. The display matches the official stats bar’s 12px font size and adapts to the active user theme, so it fits seamlessly into the DSH interface. To install, run the command dsh plugin add dsh-session-cost if you have DSH installed globally, or use an npx command if you do not have DSH installed globally. After installation completes, you must restart the dsh web process for the plugin to activate.
This plugin pulls token usage data directly from DSH’s official tokenUsage session projection, which is the same data source used for DSH’s built-in token stats. It calculates cost based on DeepSeek’s official pricing, separating cached hit tokens, cached miss/write tokens, and output tokens into different pricing tiers. It supports DeepSeek’s peak/off-peak pricing for v4 models, automatically switching based on Beijing time without any extra user configuration. All current pricing for DeepSeek v4 flash and pro models is preconfigured, matching official pricing effective until August 17, 2026. It is ideal for DSH users who regularly use the DeepSeek API and want to track spending during active sessions.
The cost shown by this plugin is only an estimate, and it may differ from your actual DeepSeek API bill due to factors like rounding, mid-session model switching, and pricing alignment. Currently, if you switch models mid-session, the plugin will not retroactively recalculate cost for earlier tokens, and it uses a single default model for all sessions unless you edit the source code to change the default. The plugin is released under the open source MIT license, so you can modify the default model and pricing table directly in the source code if your individual needs differ from the preconfigured defaults.
dsh-session-cost 是一款专为 DeepSeek Harness (DSH) 开发的原生插件,核心功能是在 DSH 的 Web 界面底部统计条新增当前会话的 DeepSeek API 费用估算显示。插件显示风格与官方统计条对齐,支持自适应主题配色,字号也统一为 12 像素,界面融合度很高,用户可以在会话过程中随时直观看到当前的费用消耗情况。
插件可以通过 DSH 官方命令行工具直接安装,全局安装 DSH 后执行 dsh plugin add dsh-session-cost 即可,未全局安装 DSH 则使用 npx 命令 npx --yes @deepseek-ai/dsh plugin --profile web add dsh-session-cost 安装。安装完成后需要重启 dsh web 才能生效。这款工具适合经常使用 DSH 调用 DeepSeek API 开发的用户,帮助他们实时掌握会话费用,避免账单超支。
插件依托 DSH 官方 dsh-token-meter 提供的 tokenUsage 会话数据计算费用,计费口径和官方账单一致,会区分缓存命中、未命中以及输出 tokens 的不同单价,还支持 DeepSeek 官方的峰谷计价规则。本次费用为估算值仅供参考,可能和实际账单存在出入,采用 MIT 开源协议,用户如果需要修改默认模型和价格表,可以自行编辑源码文件。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-session-cost(ChengChe106/dsh-session-cost)
仓库:https://github.com/ChengChe106/dsh-session-cost
本站详情页:https://www.yhbd.top/plugins/chengche106-dsh-session-cost/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 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 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
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 add dsh-session-cost
把 ChengChe106/dsh-session-cost 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-session-cost
DSH(DeepSeek Harness)插件:在 Web GUI 底部统计条里显示当前会话的 DeepSeek API 费用估算。
效果:统计条下方多出一行 费用 ≈¥0.35 | 命中 ¥0.28 | 未命中 ¥0.02 | 输出 ¥0.05,字体与配色完全对齐官方统计条(12px、主题自适应)。

安装
dsh plugin add dsh-session-cost
(dsh 未全局安装时:npx --yes @deepseek-ai/dsh plugin --profile web add dsh-session-cost)
安装后重启 dsh web 生效。
怎么算的
- 数据源:DSH 的
tokenUsage会话投影(官方dsh-token-meter提供,与统计条同源):uncachedInputTokens/cacheReadTokens/cacheWriteTokens/outputTokens - 计费口径(对应官方账单):缓存写入按"未命中"单价计
费用 = (未命中 + 写入) × miss单价 + 命中 × hit单价 + 输出 × out单价 - 价格:官方 https://api-docs.deepseek.com/zh-cn/quick_start/pricing
| 模型 | 百万输入(命中) | 百万输入(未命中) | 百万输出 |
|---|---|---|---|
| deepseek-v4-flash(2026-08-17 前) | ¥0.02 | ¥1 | ¥2 |
| deepseek-v4-pro(2026-08-17 前) | ¥0.025 | ¥3 | ¥6 |
| deepseek-v4-flash · 高峰(9-12/14-18 北京时间) | ¥0.10 | ¥3 | ¥9 |
| deepseek-v4-flash · 空闲 | ¥0.05 | ¥1.5 | ¥4.5 |
| deepseek-v4-pro · 高峰 | ¥0.30 | ¥9 | ¥27 |
| deepseek-v4-pro · 空闲 | ¥0.15 | ¥4.5 | ¥13.5 |
- 2026-08-17 00:00(北京时间)起自动切换峰谷计价;高峰时段自动按北京时间判断
说明与限制
- 估算值:仅供参考,与实际账单可能有出入(缓存写入归入未命中的口径、模型切换、四舍五入)
- 模型:v1 按
deepseek-v4-flash计(会话中途切换模型不追溯);要改默认模型/价格,编辑lib/client.js顶部的DEFAULT_MODEL与价格表 - 显示"≈"标记表示估算
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