DSH Plugins Marketplace

DSH Plugins

Plugins

/

Tools & Capabilities

/

dsh-precise-billing

d

dsh-precise-billing

Manifest valid

Per-request DeepSeek billing with peak/off-peak and holiday pricing, a cost bar, sidebar card, usage dashboard (trends, calendar, yearly view) and a three-step hot restart (Windows DSH Desktop only).

UI (client)hasBundlePatch

精确计费(precise-billing)

按 DeepSeek 官方人民币价目(含峰谷时段与法定节假日)逐条请求精确计算会话费用,并提供费用条、侧栏卡片、用量看板(趋势 / 日历 / 年视图)与三段式热重启。

  • 作者:Sheldon Jinn
  • 版本:0.2.3
  • 包名:dsh-precise-billing
  • 类型:DSH 本地插件(Host + Client)

快速上手

  • 看费用:输入框下方的费用条,或侧栏底部的计费卡片(点卡片可展开本会话明细);
  • 开看板:侧栏卡片右上角 ▦ 图标,或 设置 → 精确计费 → 用量面板;
  • 改设置:侧栏卡片右上角 ⚙,或 设置 → 插件 → 精确计费;改完自动保存;
  • 热重启:侧栏卡片右上角 ↻,先检查运行中对话,再确认重启。

已发布:GitHub https://github.com/SheldonJinn/dsh-precise-billing · npm https://www.npmjs.com/package/dsh-precise-billing

界面预览

侧栏卡片

侧栏卡片

用量日历(按日)

用量日历

年视图(收起 / 展开月份)

年视图

设置页

设置页

热重启(三段式:警示 → 确认 → 执行)

热重启三段式确认

功能

1. 精确计费

  • 以每条 assistant/message 自带的 usage 为计价单位,而不是估算;
  • 按该请求自己的时间戳判定峰谷:北京时间 09:00–12:00、14:00–18:00,且为周一至周五;
  • 内置 2025–2026 中国法定节假日,节假日全天按闲时;
  • 输入(未命中缓存)、缓存命中、缓存写入、输出四个通道分别按单价计算;
  • 峰时单价 = 闲时单价 × 2(与官方一致);
  • 未定价模型单独计数并在界面上标注「未计价」,不会伪装成 0 元。
模型输入(未命中)缓存命中输出
deepseek-flash(含 v4-flash)¥1 / ¥2¥0.02 / ¥0.04¥4 / ¥8

上表为「人民币 / 百万 token,闲时 / 峰时」。

2. 费用条

  • 位置可选:输入框下方 / 会话标题栏 / 隐藏(选中隐藏后,下方设置项整体收起);
  • 显示内容可勾选:峰时/闲时、本次、今日、累计、余额;
  • 字体、字号、颜色可调,支持跟随主题;
  • 点击费用条可展开本会话明细。

3. 侧栏卡片

  • 常驻侧栏底部,显示今日消费、累计消费、账户余额与峰谷进度;
  • 风格:标准 / 简约 / 紧凑 / 自定义(自定义时逐项控制 16 个显示项);
  • 右上角三个灰色图标:热重启、用量看板、设置。

4. 用量看板

趋势

  • 统计卡:Token、API 请求次数、消费金额、余额;
  • 各模型消费金额(趋势 / 综合)、各模型 Token 用量、API 请求次数曲线、各模型明细与环比;
  • 单日按小时、多日按天、超过 120 天自动按月聚合;单日横轴 24 小时全部标注。

日历(日 / 周 / 月 / 年)

  • 每个格子显示 Token、消费、峰时/闲时金额;
  • 空格子:淡灰背景 + 淡灰文字;
  • 有数据的非选中格子:淡灰背景 + 保持原色(黑字、橙峰时、绿闲时);
  • 今天 / 本周 / 本月 / 今年:蓝底高亮 + 红点与文字标记;
  • 鼠标悬停任意格子:淡蓝背景 + 蓝边框,文字恢复原色;
  • 点击格子弹出详情(消费、峰时/闲时、API 请求、输入命中/未命中、缓存写入、输出、Token 合计、分模型);
  • 年视图:每年一行,左侧 Token/消费/峰时/闲时汇总,右侧 12 个月柱状图(橙=峰时、绿=闲时堆叠,带基线与投影),悬停柱子弹出该月详情,可展开 12 个月份卡片;当前年份行整行淡蓝高亮并带「● 今年」。

5. 热重启

  • 侧栏卡片右上角刷新图标触发;
  • 三段式流程:
    1. 先检查运行中的对话:有则弹橙色警示框列出对话标题,按钮为「取消(绿色实心白字)」「继续重启(橙色)」;
    2. 再弹红色确认框:标题与正文与边框同为红色系,明确提示会中断进行中的操作;
    3. 确认后进入蓝色执行中弹窗(进度条 + 日志路径,可「收起并复制日志」)。
  • 警示框边框 3.5px 彩色实线,并让边框粗细(3.5↔4.5px)、边框颜色与 6px 光晕同步柔和呼吸(2.6 秒一轮);
  • 重启前做环境快照(DSH_* 与代理变量),重开后环境一致;
  • 助手交给 Explorer 派发,避免被 DSH 的 job object 连带结束,全程无黑窗;
  • 每次重启写入 %TEMP%\pb-restart-<时间戳>.log;接口带 15 秒冷却;
  • 遵循系统「减少动态效果」设置(关闭呼吸动画)。

6. 设置

  • 所有选项自动保存(600ms 防抖),保存后在设置页中央弹出 ✓ 提示;
  • 「恢复默认」立即保存默认值;默认刷新间隔统一为 60 秒;
  • 「进度条」关闭时,刻度线/游标/悬浮提示自动禁用;重新开启时自动恢复勾选;
  • 自定义显示项至少保留一个;
  • 设置页底部「参考项目」提供两个原版插件的地址、主页按钮与复制安装命令。

安装

从 npm 安装(推荐,发布版):

dsh plugin --profile desktop add dsh-precise-billing

本地开发安装:

dsh plugin --profile desktop add link:C:\Users\XXJ\Documents\deepseek-harness\default-workspace\_plugins\precise-billing

安装后在 设置 → 插件 中启用,并刷新页面。

数据位置

  • 索引与设置:$DSH_HOME/storages/precise-billing.json
  • 会话源数据:$DSH_HOME/sessions/**/session.v4.jsonl.zstd(只读)
  • 重启日志:%TEMP%\pb-restart-*.log
  • 仓库备份:E:\DSH项目备份\插件编写\插件编写.git

参考项目

本插件的用量看板、热重启与会话计费分别参考了下面三个开源插件(均为 MIT 许可),代码为独立实现,未逐行复制。原版可按下面的地址与命令自行安装。

DeepSeek-Usage

官方用量看板:趋势 / 日历视图、模型消费与 Token 图表、按模型明细。

前往 GitHub 下载 · npm 页面

dsh-hot-restart

热重启插件:窗口内一键重启 DSH,无黑窗口,带自检诊断。

前往 GitHub 下载 · npm 页面

dsh-meter

会话计费插件:Token 分桶、缓存命中率、峰谷感知费用的会话标题栏,以及价格表设置页。

前往 GitHub 下载 · npm 页面

更多说明见仓库内 CREDITS.md;设置页底部「参考项目」也提供了一键打开主页与复制安装命令。

更新日志

0.2.3

  • 设置页底部新增「发布信息」:GitHub 仓库与 npm 包地址、安装命令;
  • README、插件列表说明补充开源与发布信息。

0.2.2

  • 修复改包名后 client 模块 id 仍为 @local/precise-billing 导致的重复注册与启动崩溃;
  • 清理 profile 中残留的旧符号链接。

0.2.1

  • 热重启改为三段式:运行中对话警示 → 红色二次确认 → 蓝色执行中;
  • 取消按钮改为绿色实心白字;警示框标题/正文与边框同色;
  • 警示框边框加粗至 3.5px,边框粗细、颜色与 6px 光晕同步呼吸;
  • 日历规则细化:空格灰字、数据格灰底原色、选中格蓝底高亮;
  • 年视图当前年份整行高亮,月份柱状图分峰/闲颜色、悬停浮框、底部对齐;
  • 设置页新增「参考项目」区与说明;默认刷新间隔统一 60 秒;
  • 重写 README 并更新全部界面截图;补充 dsh-meter 参考项目。

0.2.0

  • 新增:用量看板(趋势 + 日历日/周/月/年、模型图表、日期详情、年视图柱状图);
  • 新增:热重启、环境快照、预检与重启日志;
  • 新增:设置自动保存与提示。

0.1.0

  • 首个版本:逐条请求计价、费用条、侧栏卡片、设置页。

作者

Sheldon Jinn

许可

MIT License,Copyright (c) 2026 Sheldon Jinn。详见 LICENSE。

发布到 GitHub / npm / 插件市场的完整步骤见 PUBLISHING.md。

Comments

Loading…

Similar plugins

dsh-usage-badge

Sidebar row with today's tokens and estimated spend for DeepSeek Harness; the dialog adds 24h, 7-day, 30-day, 12-month and per-year charts, a contributions heatmap, per-request peak/off-peak pricing f

Tools & CapabilitiesTerminal & ClientsManifest valid

★ 0

MIT

JavaScript

dsh plugin --profile web add dsh-usage-badge

DeepSeek balance and token usage panel for DSH, with official platform billing, a daily usage calendar, and local session-log estimates for all providers using editable per-model pricing.

Tools & CapabilitiesTerminal & ClientsManifest valid

★ 1

MIT

JavaScript

dsh plugin --profile web add deepseek-usage

by LZ-jun

Shows the DeepSeek account balance and the current peak / off-peak phase in the sidebar, and estimates per-session and per-turn cost using the official peak and off-peak rates.

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Oct 16, 2026

dsh plugin --profile web add dsh-balance-usage

DeepSeek account balance and model cost tracking with official peak/off-peak pricing, three-tier token billing (cache miss, cache hit, output), per-model and per-session breakdowns, a composer summary

Tools & CapabilitiesTerminal & ClientsModels & ProvidersManifest valid

★ 0

dsh plugin --profile web add dsh-balance-and-cost

DSH plugin: real-time API balance in the sidebar with provider switching (DeepSeek / Zhipu GLM / OpenRouter / Tavily), peak/off-peak pricing, per-session and daily cost tracking, and configurable spending limits.

Tools & CapabilitiesTerminal & ClientsManifest valid

★ 0

dsh plugin --profile web add dsh-balance-monitor

by Hann428

DeepSeek Harness Usage tab for balance, official peak/off-peak pricing, live countdown, and platform usage link.

Tools & CapabilitiesManifest valid

★ 0

BSD-3-Clause

TypeScript

Oct 10, 2026

dsh plugin --profile web add dsh-hann-usage-dashboard