Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dsh-costline「花费行」

在 DeepSeek Harness Web GUI 的聊天统计条末尾追加 本次会话累计花费(人民币): … 缓存命中 99% | 输入 21.3M tok | 本会话 · 输入 ¥4.20 / 输出 ¥0.43 · 合计 ≈ ¥4.63,悬停显示明细 (输入命中 / 输入未命中 / 输出 各多少钱)。

前身:dsh-cost-meter。v1.0.0 起更名 dsh-costline。

特性

  • 零 token 消耗:只读取客户端已有的 tokenUsage 投影并乘价格,不发起任何模型请求
  • 与官方口径一致:和统计条渲染同一份数据(uncachedInputTokens / cacheReadTokens / cacheWriteTokens / outputTokens)
  • 多段调价时间线(内置):定价按系统时间自动选择生效档位(内置 2026-08-17 峰谷调价档,之后自动按北京时间高峰 9-12、14-18 切换);官方再次调价时更新插件即可
  • 纯显示、零配置:无设置页,价格全部内置(v2.0.1 起移除设置面板)
  • 精确分账:拆分显示保证 输入 + 输出 ≡ 合计(不再有 1 分钱误差)
  • 自动跟随:会话切换、官方统计条重渲染都会自动同步

价格表(人民币 / 每百万 tokens,内置时间线)

deepseek-v4-flash(当前默认)

时段 命中输入 未命中输入 输出
2026-08-17 前 ¥0.02 ¥1.0 ¥2.0
空闲时段 ¥0.05 ¥1.5 ¥4.5
高峰时段 ¥0.10 ¥3.0 ¥9.0

deepseek-v4-pro(内置备用,需改 FAMILY 常量启用)

时段 命中输入 未命中输入 输出
2026-08-17 前 ¥0.025 ¥3.0 ¥6.0
空闲时段 ¥0.15 ¥4.5 ¥13.5
高峰时段 ¥0.30 ¥9.0 ¥27.0

安装

# 在 web profile 的 package.json 注册(dependencies + dsh.profile.bundles)
cd $env:USERPROFILE\.dsh\profiles\web
pnpm install --no-frozen-lockfile
# 重启 dsh web 生效

说明

  • 金额为估算:按单价 × 投影 token 数计算,实际扣费以 DeepSeek 账单为准
  • 价格为快照(2026-08 DeepSeek 官方价);官方调价后更新插件(client.js 中 DEFAULT_TIMELINE_*)即可

版本历史

版本 内容
v2.0.1 移除设置页,回归纯显示;保留内置多段调价时间线(本版)
v2.0.0 设置页 + 多段调价时间线(设置页样式不合预期,被 v2.0.1 移除)
v1.0.0 由 dsh-cost-meter 更名;dock 行注入(本仓库 v1 tag)
dsh-cost-meter 前身:统计条 DOM 注入版(不在本仓库)

开发

node --check client.js          # 语法检查(零构建,手写 CJS bundle)
node --test test/pricing.test.mjs test/inline-layout.test.mjs   # 纯函数测试
  • cordis.patch.yml — host 侧 loader 入口(id: costline)
  • index.js — host 半部(no-op)
  • client.js — 浏览器半部(全部功能:时间线定价 / dock 行)
  • test/ — node:test + vm 加载 client.js 的纯函数测试

About

Cost line for DeepSeek Harness Web GUI: session cost estimate with editable multi-segment pricing timeline, zero LLM tokens

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages