
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
dsh-token-pricing
Advanced tools
Per-model token pricing for the dsh web surface: durable USD rates with multi-window peak hours, a cost readout in the composer dock, and a collapsible draggable floating window with per-turn and per-model cost views
中文 | English
dsh-token-pricing是一款第三方(非官方)插件,由社区维护,与 deepseek-ai 官方发布无关。
Web 界面的按提供方/模型 token 定价:按提供方/模型配置美元价格(未命中输入、缓存命中输入、输出,以及可在任意多个高峰时段内生效的高峰价格档),并在三个表面查看会话费用——底部数据栏,以及一个可折叠可拖拽的浮窗(「按轮计价」与「按模型计价」两种视图)。按轮用量由 tokenPricing 投影从会话日志派生,随会话持久化、随归档一并保留。node 半身注册设置命名空间与投影单元,其余全部复用现有 Host 服务。
前置:Node ≥ 22、pnpm、可用的 dsh 安装。
# 安装到 web profile(自动初始化 profile、安装依赖、注册补丁层)
dsh plugin --profile web add dsh-token-pricing
# 启动
dsh web
dsh plugin add 走官方插件机制:把本包装进 $DSH_HOME/profiles/web/ 的依赖 → 依据 dsh.bundle 声明加入 profile 补丁层 → 补丁层的一行 row 同时挂载 node 半身与浏览器半身。本包只声明两个自用运行时依赖(schemastery、zod);其余 @deepseek-ai/dsh-* 由 dsh 安装本身提供(官方机制的双锚点解析),因此安装不会拉取任何内部包。更新与卸载:
dsh plugin --profile web update dsh-token-pricing
dsh plugin --profile web remove dsh-token-pricing
未发布到 npm 时可用 git 源安装(仓库内已提交构建好的 lib/):
dsh plugin --profile web add github:LightClear/dsh-token-pricing

设置 → 模型定价 把模型目录按提供方分组为卡片,每个模型带已配置/未配置圆点。展开某个模型打开编辑器,自动载入已存配置,可编辑三档基础费率——输入未命中、输入命中、输出(美元/每百万 token)——以及高峰期计价规则:启用高峰定价后,可按需增删任意多个高峰时段(添加高峰时段 / 删除时段),全部时段共享一套高峰费率。默认只有一段,时段支持跨午夜(22:00–08:00),当前时间落入任一时段即按高峰价计费。

对话框底部数据栏在出厂统计行旁显示会话的 输入 $X · 输出 $Y · 总计 $Z。每一步按自身时间、在其派发路由下计价,读数对每个已计价步骤求和,因此与浮窗总计永远一致;未配置计价路由的用量不计入该数字。

折叠态是小球形状,显示当前会话的累计费用;点击小球展开面板。

展开态面板包含两个视图切换页签与底部总计栏。标题栏(顶部)与总计栏(底部)都是拖拽区域。
悬浮窗提供两种计价方式:按对话轮数计价与按模型计价。

「按轮计价」按对话轮次列出每轮(轮次号与开始时间)使用的路由、token 数与费用;一轮中途切换模型时按路由拆分为多行。

「按模型计价」按会话中使用过的所有模型聚合 token 数与费用,按首次使用顺序排列。两种视图中,未配置计价规则的模型仍显示 token 数并提示 未设置计价。
按轮用量不是单独存储的:tokenPricing 投影将会话的持久事件日志折叠为逐步用量事实——每条携带服务商上报 usage 的 assistant/message,盖上其派发路由(最近一条 request/header)与该步自身的时间戳。由于折叠重放日志,数据随会话持久化、重启后还原,并随归档的会话一并保留(归档只隐藏列表行,从不改写日志)。投影只携带用量事实——费率住在设置作用域里——因此浏览器在渲染时逐步计价,事后修改价格条目会按新价重算历史。高峰/非高峰按每步自身时间判定:某步的时间落入其条目任一 peakWindows 即按高峰价计费。
/client 导出为插件主体(apply/inject)、dock、浮窗与设置页组件及其注入面类型。纯费用计算位于 src/client/pricing.ts,投影折叠位于 src/projection.ts。
本插件不向任何模型请求添加任何内容:不注册工具、不注册提示段,也没有任何设置值进入请求路径。数据栏、浮窗与设置页只呈现线上已有的持久数据——tokenPricing 投影值与 token-pricing 设置段。
零:本包不添加、移除或改动任何提示内容、工具 schema 或消息。
无:请求组成、缓存复用与压缩均不受影响;tokenPricing 折叠只在请求提交后运行。
tokenUsage 计量口径一致)。FAQs
Per-model token pricing for the dsh web surface: durable USD rates with multi-window peak hours, a cost readout in the composer dock, and a collapsible draggable floating window with per-turn and per-model cost views
We found that dsh-token-pricing demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.