对话费用 · Conversation Costs
DeepSeek Harness 插件。在左侧对话行显示累计模型费用,在聊天页显示单轮费用,并提供按花费排序的明细页。
安装
适用于 DeepSeek Harness 0.2.2-rc.1 至 0.2.x 的桌面端或 Web 界面,运行环境为 Node.js 24 及以上。
通过 Harness 的插件管理器安装 GitHub 来源,或在已有 CLI 的环境执行以下命令。桌面端使用 desktop profile,Web 端改为 web。
dsh plugin --profile desktop add github:KimiChen2000/dsh-conversation-costs
本仓库包含可直接运行的前后端文件,安装时无需编译。启用后查看侧栏「对话费用」。有界面订阅用量时每 20 秒更新一次。
费用口径
- 根据本地会话日志中每次模型回复的用量、请求模型和请求开始时间,估算人民币模型费。
- 支持 DeepSeek 官方 API Key 与 DeepSeek 账号渠道下的 Flash 和 V4 Pro,包含两个旧 Flash 别名。
- 缓存命中输入、未命中输入、输出分别计价。同一轮中多次模型调用合计到该轮。
- 分支会话继承的历史调用不会重复计费。历史对话可从已保存用量回算。
- 缺少用量、未知模型或未知计价时期会显示「待计价」或「部分」,金额包含已成功计价的记录。
- 价格按 2026-11-06 的 DeepSeek 官方人民币表。当前价格与假日日历覆盖 2026-09-11 至 2026-12-31,后续年份需要更新插件。
- 按北京时间工作日 9–12 点、14–18 点使用高峰价,其余时间使用空闲价,并处理覆盖期内的中秋、国庆假期。
- 统计范围为会话日志保存的模型回复用量。搜索、抓取、语音等独立服务费用与没有保存用量的请求需要另外核对。
- 显示值为估算,实际扣款以服务账单为准。未来调价需要更新插件中的价格表。
价格依据见 DeepSeek 官方价格。
数据与兼容性
通过 Harness 的只读会话接口读取标题和用量,在本机内存计算。插件没有外部网络请求,也不会发送聊天内容或 API Key。插件使用的同源接口返回会话标题、汇总金额和逐轮金额,随宿主访问权限提供给当前界面。
停用插件即可移除显示,重新启用时从会话日志回算。在 DeepSeek Harness 0.2.2-rc.1 的真实会话读取接口上验证过,其他主版本需要重新验证。
Development
npm test
npm pack --dry-run
Zero runtime dependencies. The browser entry uses the host React instance. Tests cover billing boundaries, model changes, inherited branches, unknown usage, cache refresh, and read-only route behavior.
The sidebar shows per-conversation estimates, the conversation header and turn tail show totals, and the cost panel ranks conversations by recorded model spend. Supported tariffs are the published CNY DeepSeek Flash and V4 Pro rates for the documented date range. Estimates cover recorded model replies and can differ from the provider bill.
MIT license.
No comments yet. Be the first to write one.