View consumption costs directly on the conversation page
Check the consumption cost directly on the conversation page (embedded in the official bottom status bar, click to see the details); check the total cost, cache hits and input and output of Harness in the settings.
Project overview
DeepSeek Harness(DSH)Web GUI 的 Token 用量 / 缓存命中 / 费用统计插件:支持单对话视图与整体汇总,内置双计价方案并在 DeepSeek 调价后按记录时间自动切换。 功能 单对话视图:对话页面底部官方状态行(「首 token 平均 … · … tok/s」之后)直接嵌入本会话消耗费用,点击即可打开按请求的明细弹窗(时间 / 模型 / 缓存未命中 / 缓存命中 / 输出 / 费用,最新在上)。 整体汇总(设置 > 插件配置 > Web UI 插件 > Token 费用统计):时间筛选(今天 / 昨天 / 最近 7 天 / 最近 30 天 / 本月 / 上月 / 自定义,最多 30 天)+ 费用 / 输入 / 输出 / 缓存命中率统计卡,按模型、会话、日期分组。 计价状态:当前生效方案、下次切换时间、高峰时段一目了然。 数据来源
插件读取 DSH 的持久会话日志($DSHHOME/sessions/ / /session.jsonl.zstd),把 provider 上报的 usage 事件折叠为按请求的计费记录(同一 turn/step 取最后一次,与官方 token-meter 投影语义一致)。紧凑账本($DSHHOME/storages/dsh-token-cost/ledger.json)缓存解析结果,只重解析变化的日志;zstd 解压使用 fzstd(纯 JS 零依赖)。
Token 字段遵循 Harness 约定:inputTokens = 缓存未命中部分,cacheReadTokens = 缓存命中部分(两者不相交,相加即计费输入)。 价格引擎(双方案 + 自动切换)