nonewind/dsh-spend 预览 preview

nonewind/dsh-spend

DeepSeek Harness 的令牌用量与成本监控器——悬浮组件,支持多维度统计、时序图表、自动检测计费方案(代码/令牌)及预估花费。

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness, designed to track token usage and estimate AI API calling costs. To install the plugin, users can add it via the DSH plugin marketplace or clone the repository and load it as a local bundle in their DSH instance. Once activated, it automatically injects a floating interactive widget into the bottom right corner of DSH’s web UI, requiring zero initial configuration from end users. It automatically detects billing plans for different providers and pulls real-time quota and balance data from supported vendors.

This plugin is ideal for DSH users who want to actively track their AI calling costs and avoid unexpected budget overages. It uses a three-tier interaction model that keeps key data visible without cluttering the main DSH interface. A small floating capsule stays in the corner at all times, displaying total token usage and estimated total cost, and changes color to alert users when they approach or exceed their configured monthly budget. Hovering over the capsule shows a quick summary of today’s usage, while clicking opens a full detailed panel with four separate tabs for deeper analysis.

This plugin is released under the open-source MIT license, so it is free to use, modify, and distribute. All built-in pricing data was verified against official provider documentation as of August 2026, and includes support for DeepSeek’s new peak/off-peak pricing that launched on August 17, 2026. It supports currency switching between USD and CNY with real-time exchange rate lookups, and can export usage details to CSV or JSON files. Note that all cost calculations are estimates for reference only, not official billing, and reverse-engineered third-party quota APIs may fail, which the plugin handles gracefully with fallback values.

这是一款专为DeepSeek Harness开发的原生插件,核心功能是监控大模型调用的Token用量与估算费用。插件会在DSH的Web UI右下角添加一个悬浮交互窗口,支持零配置自动识别不同供应商的计费计划,可直读9家主流订阅供应商的真实额度与账户余额,内置覆盖17家供应商、131个模型的官方定价知识库,定价信息均经过2026年8月的官方文档核实。

该插件面向需要追踪大模型调用成本、控制预算的DSH用户,采用三级交互逻辑设计。右下角常驻悬浮胶囊,始终展示总Token用量和预计总花费,当用量达到月预算的80%会变黄告警,超过100%则变红提醒。用户hover胶囊可快速查看当日用量费用摘要,点击即可展开包含四个标签页的详情面板,分别对应总览、今日统计、性能指标和调用明细四个板块。

该插件采用MIT许可协议,完全免费开源。支持人民币与美元的货币切换,可自动获取实时汇率,获取失败则默认使用7.2的固定汇率。支持按工作区筛选统计,可导出调用明细为CSV或JSON格式。需要注意的是,插件展示的费用均为基于官方单价的估算值,仅作参考,并非实际账单;部分逆向获取的第三方订阅额度接口可能随时失效,插件已内置失败降级逻辑,不会导致崩溃。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 8 stars - very few users, little community feedback星标只有 8,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-spend

把 nonewind/dsh-spend 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-spend

Token usage & cost monitor for DeepSeek Harness — floating widget with multi-dimensional stats, time-series charts, auto-detected billing plans (Code/Token) and estimated spend.

dsh 用量与计费仪表盘:token 调用量、按模型 / 供应商 / 时间统计、预计费用,自动识别订阅制(Code)与按量(Token)计费计划。

简体中文 | English

在 dsh Web UI 右下角显示一个悬浮用量窗口:实时查看 token 调用量、多维度统计与预计计费金额,零配置自动识别计费计划并直读订阅商真实额度/余额。

目录


功能特性

  • 🖱️ 三级交互:悬浮胶囊常驻 → hover 摘要预览 → 点击展开四标签页详情面板
  • 📊 多维统计:按提供商 / 模型 / 小时 / 天 / 会话 / 工作目录 / 最近调用,含性能指标(TTFT、生成速度)
  • 📈 时间序列图表:今日逐小时、24h/72h/7d 时间曲线、52 周活跃热力图
  • 🏷️ 计费计划自动识别:内置知识库(17 供应商 / 131 模型价格),自动区分订阅制(Code)与按量(Token)
  • 🔴 实时额度 / 余额直读:9 家订阅商内置适配器(额度 7 + 余额 2),展示厂商接口返回的真实值,失败安全回退不崩溃
  • ⚡ DeepSeek 峰谷计价:8/17 起按调用时刻自动按高峰/空闲价计费
  • 💱 $ / ¥ 货币切换:实时汇率(失败回退 usdCnyRate,默认 7.2)
  • 📂 工作区筛选:按项目限定全部统计口径,支持逐级下钻子目录
  • 📤 数据导出:调用明细支持 CSV / JSON / 调用明细 CSV 导出,可在独立窗口查看
  • 🔁 自动刷新:默认 30s(服务端下发,页面无需改动),面板内也可手动刷新

界面预览

仪表盘总览

调用明细窗口

交互方式

层级 内容
悬浮胶囊(右下角) 始终显示预计费用与总 Token(超预算变黄/变红告警)
hover 摘要预览:费用、Token、输入 / 输出 / 缓存读、调用次数、今日小计
点击展开 四标签页详情面板;顶部工作区筛选下拉(按项目限定统计、逐级下钻子目录),标签栏右侧 $ / ¥ 货币切换按钮(悬停预览同款;汇率由服务端实时拉取,失败回退 usdCnyRate 固定值)

四个标签页

  • 总览(纯 KPI + 排名摘要,无图表):
    • 统计栏:预计花费(月)+ 构成、当月预计(本月按量外推)、按 token 估算、总 Token、调用、会话、平均 / 次、缓存命中率、月预算(可选配置,超 80% 胶囊变黄、超 100% 变红)、活跃天数 / 连续使用;
    • 计划用量:自动识别 Code/Token 计划、档位、额度使用与剩余;
    • 费用 Top 提供商 / Top 模型(各 6 行)+ 近 31 天趋势。
  • 今日:当天调用数、Token 与费用小结 + 今日逐小时 Token / 费用图(横轴从当天首个有调用的小时起算,避免凌晨空白;当天无调用时窗口收敛到当前小时)+ 时间曲线(默认近 24 小时,可切换 24h / 72h / 7d,首个有调用的小时起算,跨天处自动标注日期)+ 活跃热力图(近 52 周,GitHub 风格,颜色深度 = 当日 Token 量,悬停看 Token / 费用 / 调用)。
  • 性能:每模型的首字延时(TTFT)均值 / P50 / P90、生成速度(tokens/s)、总延迟均值 + 按小时的 TTFT / 速度曲线(支持 24h / 72h / 7d 切换,首个有样本的小时起算)。
  • 调用明细:每会话 × 模型的调用次数、token 与费用明细 + 按工作目录统计(各项目会话数 / 模型数 / 调用 / 费用)+ 按会话统计 + 最近调用(费用远超均值的异常调用标红点)+ 计费单价表。可在独立窗口打开(随主窗口自动刷新,支持 CSV / JSON / 调用明细 CSV 导出)。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-worktree-panel 下一个 Next dsh-plugin-claude-bridge →