le-soleil-se-couche/dsh-token-cost
DeepSeek Harness(DSH)Web GUI 的 Token 用量 / 缓存命中 / 费用统计插件:单对话与整体汇总,内置 DeepSeek 官方计价方案(含 V4.1 Flash 降价与 V4 Pro 路由,东八区峰谷),也可为自己调用的其他模型填写单价。
catalog descriptioncatalog 简介 / catalog description:在对话页面直接查看消耗费用(嵌入官方底部状态条,点击看明细);设置中汇总用量与费用,并可自定义其他模型单价
Project Overview项目介绍
dsh-token-cost is a DSH-native plugin designed exclusively for DeepSeek Harness Web GUI that tracks per-session and aggregate token usage, cache hit rates, and API call costs. It includes DeepSeek’s official pricing schemes across all historical price adjustments, plus support for peak/off-peak pricing in the China (East 8) time zone. Install the plugin via the official DSH CLI with the command dsh plugin --profile web add github:le-soleil-se-couche/dsh-token-cost, which supports the official @deepseek-ai/dsh@0.1.2-rc.1 host version. After installation, you just need to restart your dsh web instance to activate the plugin, and it will automatically backfill existing historical session data on your first query.
The plugin embeds the current session’s total cost directly into the official status bar at the bottom of the conversation page. Clicking the embedded cost opens a popup with a per-request breakdown that shows the time, model, cache status, token counts, and cost for each individual request. In the plugin configuration panel, users can view aggregate statistics filtered by multiple pre-built or custom date ranges, with results grouped by model, session, and date. This makes it ideal for frequent DeepSeek Harness users who want to track and control their API usage costs.
The plugin only reads token usage data that DSH has already logged to local session files, and it does not add any unrecorded usage data or invent missing token counts. It supports all past versions of the DSH session format from v0 to v3, and will warn users if it encounters an unsupported newer version. It can not replace DeepSeek’s official billing, and all calculations are based solely on the usage data logged by DSH. Users can also add custom pricing for third-party models they call, with prices saved locally and persisted across restarts.
这是一个专为DeepSeek Harness(DSH)Web GUI开发的原生插件,用于统计会话的Token用量、缓存命中率和API调用费用。它内置DeepSeek官方各阶段的计价方案,包含最新调价信息和东八区峰谷定价规则,同时支持用户为自定义第三方模型手动填写单价,修改后已有历史费用会自动按照新输入的单价重新计算。
插件会在对话页面底部的官方状态行直接嵌入当前会话的总消耗费用,点击即可打开按请求排序的费用明细弹窗,展示每条请求的时间、模型、缓存命中情况、用量和费用。用户可以在插件配置页查看支持多维度时间筛选的整体汇总统计,结果可按模型、会话和日期分组,满足DSH重度用户跟踪调用成本的需求。
可以通过DSH官方CLI命令dsh plugin --profile web add github:le-soleil-se-couche/dsh-token-cost完成安装,依赖官方@deepseek-ai/dsh@0.1.2-rc.1宿主版本。插件仅读取DSH本地已记录的会话日志计费,不会虚构未记录的用量,也不能替代官方最终账单,安装完成后重启dsh web即可使用,首次查询时会自动回填已有历史会话数据。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-token-cost(le-soleil-se-couche/dsh-token-cost)
仓库:https://github.com/le-soleil-se-couche/dsh-token-cost
本站详情页:https://www.yhbd.top/plugins/le-soleil-se-couche-dsh-token-cost/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证未声明 · ⭐ 9 · 最近提交 2026-09-14 · 主语言 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 更稳。
- No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
- Only 9 stars - very few users, little community feedback星标只有 9,几乎没人在用,遇到问题缺少社区反馈
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 github:le-soleil-se-couche/dsh-token-cost
把 le-soleil-se-couche/dsh-token-cost 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-token-cost
English · 中文
DeepSeek Harness(DSH)Web GUI 的 Token 用量 / 缓存命中 / 费用统计插件:单对话与整体汇总,内置 DeepSeek 官方计价方案(含 V4.1 Flash 降价与 V4 Pro 路由,东八区峰谷),也可为自己调用的其他模型填写单价。
2026-08-17更新:支持为自己调用的其他模型填写单价;点「添加模型」即写入本地价格文件,刷新后仍在,历史费用立刻按新单价重算。
2026-08-25 更新:计量内核升级为 attempt-aware fold,补齐失败调用后 retry、compaction/summary.usage 与 fork seedLength 边界;账本 schema 升至 v2,旧缓存会从权威 session logs 自动重折叠。
2026-08-28 更新:retry 边界与官方 llm/retry-started 对齐,补充官方 session id 目录编码兼容,并刷新与 0.1.2-alpha.1 的差异说明。账本 schema 升至 v3,已有 v2 缓存会自动重折叠。
2026-09-05 更新:本版本使用官方 npm 0.1.2-rc.1 SDK,直接消费官方设置与插件卡片类型;同时增加 session format v2 读取,账本 schema 为 v4;并修复 Windows 路径下账本目录创建、显式 flat: false 自定义价格持久化,以及已有统计行费用标记的刷新。宿主 SDK 与日志协议分别验证:v2 synthetic fixture 通过不代表 0.1.3-alpha.1 宿主运行已验收。
2026-09-11 更新:同步官方调价——新增方案 C(V4.1 Flash,2026-09-10 12:00 起)与方案 D(V4 Pro 自 2026-09-14 12:00 起按 Flash 价计费);旧模型名 deepseek-v4-flash / deepseek-v4-flash-vision-exp 自方案 C 起按 Flash 价计费,并补齐 vision-exp 在方案 B 的单价。另补入 2026-08-23 起的周末闲时历史方案,保留调价前后的各段价格。历史记录在自动模式下按生效时间切换。
功能
- 单对话视图:对话页面底部官方状态行(「首 token 平均 … · … tok/s」之后)直接嵌入本会话消耗费用,点击即可打开按请求的明细弹窗(时间 / 模型 / 缓存未命中 / 缓存命中 / 输出 / 费用,最新在上)。
- 整体汇总(设置 > 插件 > 插件配置 > Token 费用统计):时间筛选(今天 / 昨天 / 最近 7 天 / 最近 30 天 / 本月 / 上月 / 自定义,最多 30 天)+ 费用 / 输入 / 输出 / 缓存命中率统计卡,按模型、会话、日期分组。
- 计价状态:高峰时段按东八区显示(09:00–12:00、14:00–18:00),判定也按东八区时钟;2026-08-23 起峰时仅限工作日,周末整天按闲时,界面会标注「仅工作日」。
- 自定义模型价格:配置页可从账本发现未定价模型,或手动添加尚未调用的模型;按每百万 tokens 填写缓存未命中 / 缓存命中 / 输出。点「添加模型」即写入本地价格文件,刷新后仍在,历史记录立刻按新单价重算。缓存命中可不填(按 0 计)。第三方模型按平价,不受 DeepSeek 峰谷影响。
2026-09-14 更新:增加官方 session format v3 读取,账本 schema 升至 v5。v2/v3 共用已经核验的用量字段、retry 和继承边界;未知未来版本继续告警并跳过。
数据来源
插件读取 DSH 的持久会话 generation:当前 v3 为 $DSH_HOME/sessions/<project-key>/<encoded-session-id>/session.v3.jsonl(或 .zstd),并兼容 v2 的 session.v2.jsonl(.zstd)、v1 的 session.v1.jsonl(.zstd) 与 v0 的 session.jsonl(.zstd)。同一会话迁移后可能保留多代不可变文件;插件只选择数字版本最高的 canonical generation 一次,不重复结算迁移副本。若最高代高于已支持的 v3,插件明确告警并跳过该会话,不回退读取旧代。
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