Web UI 美元成本徽标:头部显示会话总成本、每条回复结尾显示该轮成本,悬停看分项。
Per-turn USD cost badge in the Web UI: session total in the header and per-turn cost in each message footer, with a hover breakdown.
安装
dsh plugin --profile web add @steven-wu/dsh-cost-meter从 npm 安装预构建包
安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗
安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。
README
Out-of-tree dsh plugin that shows a live USD cost badge for the open conversation in the Web UI.
It is a dual-face dsh.client package:
- Host half (
lib/index.js) registers asessionCostprojection on the session-projection seam. The fold tracks the current provider/model fromrequest/headerevents and accumulates cost from the provider-reported usage buckets (uncached input / output / cache-read / cache-write), reusing token-meter's "replace the same(turn, step)sample instead of double-counting" rule. The view exposes the whole-session totals plus abyTurnmap keyed by turn number. - Client half (
lib/client.js) registers a badge into theconversation.chat.assistant-actionsslot — the action row at the end of each assistant message, alongside the turn's time/duration info. Each badge shows that turn's cost; hovering opens a tooltip with the per-bucket breakdown (input / output / cache-read / cache-write) plus the session total.
Pricing table
Pricing is USD per million tokens, keyed by provider/model:
{
"per": 1000000,
"currency": "USD",
"default": { "input": 0.6525, "output": 1.9575, "cacheRead": 0.02175, "cacheWrite": 0 },
"models": {
"deepseek-official/deepseek-v4-pro": { "input": 0.6525, "output": 1.9575, "cacheRead": 0.02175, "cacheWrite": 0 },
"deepseek-official/deepseek-v4-flash": { "input": 0.2175, "output": 0.6525, "cacheRead": 0.00725, "cacheWrite": 0 }
}
}
The plugin reads ~/.dsh/cost-pricing.json on boot (override the path with the
DSH_COST_PRICING env var or the row's config.pricingPath). On first run it
writes the default table to that path; edit it and restart dsh web to apply
changes. A model without a models entry falls back to default (zero cost
when no default is present).
Install
The package declares a dsh.bundle manifest, so dsh plugin add installs it
and adds it to the profile's bundle layers automatically — no manual patch
edit:
dsh plugin --profile web add @steven-wu/dsh-cost-meter
# restart the web profile, then refresh the page
For a local checkout during development:
dsh plugin --profile web add file:/path/to/dsh-cost-meter
Notes:
@deepseek-ai/dsh-*are declared as peerDependencies (resolved from the harness), never asdependencies— installing them into a profile shadows the harness copy and can pull a stale dist-tag.- The Settings "Plugins" panel is read-only (inventory + config cards); install
happens only through
dsh plugin --profile … add. - Purely-cordis mounting (a
cordis.patch.ymlinsert row) also works — the shippedcordis.patch.ymlholds that row for either path.
The sessionCost projection is delivered through the same seam as
tokenUsage / sessionStats, so it also appears in every projection carrier
(history tail page, session/projection push frames) without extra wiring.
原始 README: https://github.com/Sttrevens/dsh-cost-meter/blob/main/README.md ↗
同类插件
查看全部 →
dsh-usage-plugin
DeepSeek Harness 用量与消耗插件(dsh-usage)—— 每次调用的 token 用量/缓存命中统计、峰谷计费、余额查询、CSV/JSON/PNG 导出,可经桌面端一键安装或命令行 dsh plugin add 安装。

dsh-whale-report
🐋 鲸鱼记事本 — 你的 Agent 年度报告:从会话事件日志生成日报/周报/月报/年报,任意区间、只读不改写

dsh-balance-meter
输入框 dock 显示 DeepSeek 账户余额与会话花费,自动拉取官方定价,支持高峰/低谷计价。

dsh-usage-stats
DeepSeek Harness 使用统计插件|Token 总量与构成、7/30 天趋势、年度活跃热力图、模型占比、工作区/任务筛选、CSV/JSON 导出

dsh-balance
DeepSeek 余额实时显示插件: 在 dsh Web UI 输入框 下方、命中率/输入输出 token 统计条所在的同一行 , 实时显示:

dsh-balance-monitor
DeepSeek 账户余额、剩余比例条与今日花费,显示在 dsh 侧边栏底部 · DeepSeek balance, remaining-ratio bar and today's spend in the dsh si