wannanbigpig/dsh-usage-stats
DeepSeek Harness web 用量与计费插件:官方余额、Token 用量、贡献热图与按小时计费统计。Balance, token usage, contribution heatmap & per-hour cost stats for dsh web.
Project Overview项目介绍
wannanbigpig/dsh-usage-stats is a native plugin built exclusively for the DeepSeek Harness Web GUI. It adds a local usage dashboard that lets DSH users view token usage, account balance, package quota, DeepSeek billing estimates, and daily usage trends all in one place. The plugin automatically adjusts its display position based on whether an active session is running: it opens in the DSH sidebar when there is an active session, in the main global panel for older DSH versions when there is none, and falls back to a modal window if needed. It supports over 10 common LLM providers, each with dedicated support for checking their account information. It also lets you set up daily consumption limits and balance alerts.
This plugin is designed for DSH users who work with multiple LLM providers and want a centralized way to track their usage, spending, and remaining balance. After you install the plugin through DSH's plugin system, a dedicated entry called "Usage and Billing" is added to DSH's settings menu. From there, you can configure which providers you want to pin to the overview, set up alert thresholds for low balance or over-limit spending, and adjust how often the plugin refreshes usage data. You can open the usage dashboard at any time to view detailed breakdowns of your usage by model, date, and hour, as well as an annual contribution heatmap of your API calls.
This plugin is released under the permissive MIT license, so it is free to use, modify, and distribute. It requires DeepSeek Harness version 0.1.5-rc.2 or newer to run correctly, and it automatically adapts to newer DSH versions per its update cycle. All of your usage data and plugin settings are stored locally on your machine, and the plugin never saves your API keys—they are only accessed through DSH's native credential service. One known limitation is that usage logged while the plugin is disabled cannot be automatically recovered, and manual recovery with broad settings carries a small risk of duplicate billing. When you first open the plugin after installation, it will automatically migrate any old version data to the new storage format.
这是一款专为 DeepSeek Harness Web GUI 开发的原生插件,为 DSH 用户提供统一的用量查询中心,支持查看多供应商的 Token 消耗统计、账户余额、套餐额度、DeepSeek 费用估算以及不同时间维度的用量趋势。插件会根据当前是否存在活动会话自动适配显示位置,遵循 DSH 宿主主题样式,目前已支持十多种常见 LLM 供应商的用量和账户信息查询,还提供了消费预警和超限停止功能。
该插件面向需要统一管理多 LLM 供应商用量、余额和消费的 DSH 用户开发。安装完成后,用户可以在 DSH 的设置中找到专属的「用量与计费」配置入口,可自定义固定展示的供应商、消费预警阈值、刷新周期等参数,随时打开用量中心查看今日、本月及累计的用量明细,也能查看按模型拆分的统计和年度用量热图。
该插件采用 MIT 许可证开源,完全免费使用,依赖 DeepSeek Harness 0.1.5-rc.2 及以上版本运行。所有统计数据、配置信息都保存在用户本地,API Key 不会被插件存储,仅通过 DSH 原生凭据服务访问。已知限制是,插件停用期间遗漏的用量无法自动补回,手动恢复时如果放宽范围可能存在重复计费的风险,首次打开会自动迁移旧版本数据。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-usage-stats(wannanbigpig/dsh-usage-stats)
仓库:https://github.com/wannanbigpig/dsh-usage-stats
本站详情页:https://www.yhbd.top/plugins/wannanbigpig-dsh-usage-stats/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 3 · 最近提交 2026-09-28 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
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 @wannanbigpig/dsh-usage-stats
把 wannanbigpig/dsh-usage-stats 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-usage-stats
面向 DeepSeek Harness Web GUI(dsh web)的本地用量中心:统一查看 Token、余额、套餐额度、DeepSeek 费用估算和每日趋势。
The local usage, balance, quota, and billing companion for DeepSeek Harness Web.
文档导航: 核心亮点 · Provider 支持 · 界面预览 · 快速安装 · 配置 · 数据与隐私
0.5.3 更新
- 对照 Harness
0.1.7-rc.2适配新版 Settings/Config:插件设置接入宿主配置编辑器,旧 JSON 设置在插件激活后导入。 - “前往设置”适配新版账户菜单,同时保留旧版设置按钮路径;焦点样式使用宿主主题变量。
- 兼容新旧 UI 图标导出名,修复右侧 Sidebar 的 React #130 空白页;测试会核对当前宿主实际导出。
0.5.2 更新
- 适配并声明支持 Harness
0.1.6-alpha.1,保留0.1.5-rc.2开发依赖回归。 - 卸载前排空已接受的用量写入,按
session/disposed清理会话缓存,同时保留正在落盘样本的去重身份。 - 工作区报告随用量刷新;切换范围清除旧数据,后台暂停轮询,失败提供重试。
- 通知和数据设置明确展示初次读取状态,数据操作等待统计刷新后恢复按钮。
- 图表和状态边框使用宿主主题色,遵循减少动态效果偏好,窄屏保留设置入口。
核心亮点 / Features
| 能力 | 你可以做什么 |
|---|---|
| 用量查询中心 | 有活动会话时从侧栏打开宿主原生右侧 Sidebar;无活动会话时打开宿主全局主面板;旧宿主再回退到 Modal |
| 多供应商账户 | 展示 DeepSeek/Moonshot 余额、Z.ai/Kimi/MiniMax/OpenCode Go 套餐窗口、OpenRouter Key 额度与账户 Credits;小米及 MiMo Token Plan 提供官方查询入口;账户概览最多固定 3 个供应商 |
| 时间与模型分析 | 查看今日 / 本月 / 累计 Token、请求次数、24 小时输入输出、模型拆分、缓存命中率与自然年贡献热图 |
| 费用与限额 | 冻结 DeepSeek 官方调用费用,配置每日消费限额、余额提醒、预警比例、通知和可选超限停止 |
| 本机数据边界 | API Key 只在服务端凭据服务中解析;统计账本、设置和告警保存在本机,插件 RPC 仅经宿主本机认证围栏访问 |
查询面板保持只读。默认展示供应商、计费、限额、通知和数据管理统一位于「设置 → 用量与计费」。切换默认展示供应商不会改变模型调用路由。会话过程显示由 Harness 原生「设置 → 通用设置 → Conversation display」控制。
数据口径
- Token 来自 provider-reported
usage(assistant/chunk、assistant/message或llm/streamusage chunk),统计 API 不使用本地 tokenizer 估算。 - 请求次数按
provider/model的独立用量样本统计;同一(turn, step)的流式中间样本与最终样本只计一次。冻结归档沿用每个模型桶的entryCount。 - 调用级 ledger 按
provider/model归集;日期、小时、费用和「今日」限额均按请求完成时间对应的北京时间计算。 - 只有
deepseek-official参与 CNY 费用估算和消费限额;其他供应商保留 Token、余额或套餐额度展示。 - 界面支持中文和英文;供应商列表来自 Harness 当前已经添加的可配置 provider route,不会猜测或探测未知远端接口。
Provider 支持
| route 示例 | 远端查询 | 能否直接复用模型设置中的 Key | 展示与额外操作 |
|---|---|---|---|
deepseek-official、deepseek |
/user/balance |
可以 | 余额、CNY 费用估算、每日消费限额与余额提醒 |
moonshotai、moonshotai-cn |
/v1/users/me/balance |
可以 | USD/CNY 可用余额、现金与代金券余额;Key 必须与国际/国内站匹配 |
openrouter |
/api/v1/key,可选 /api/v1/credits |
Key 查询可复用 | 普通模型 Key 的消费上限、已用与剩余额度;账户 Credits 需额外配置 OPENROUTER_MANAGEMENT_KEY,不会拿普通模型 Key 试探该接口 |
opencode-go |
/zen/go/v1/usage |
可以 | OpenCode Go 5 小时滚动 / 每周 / 每月订阅窗口;已有接口查询,不重复显示官网按钮 |
opencode |
无 API-key 余额接口 | 不适用 | 不读取网页登录态;显示 OpenCode Zen workspace 查询入口 |
kimi-coding |
/coding/v1/usages |
可以 | 5 小时 / 每周 Token 窗口;月总额度不读取网页登录态,提供 Kimi 我的额度 入口 |
minimax、minimax-cn |
Token Plan 查询(兼容多个官方路径) | 可以 | 5 小时 / 每周比例窗口 |
zai、zai-coding-cn |
/api/monitor/usage/quota/limit |
可以 | 5 小时 / 每周剩余比例与重置时间 |
xiaomi |
无稳定的 API-key 用量接口 | 不适用 | 不读取网页登录态;显示 MiMo API Key 用量入口 |
xiaomi-token-plan-cn、xiaomi-token-plan-ams、xiaomi-token-plan-sgp |
暂无稳定的 API-key 配额接口 | 不适用 | 不读取 Cookie/CDP;显示 MiMo Token Plan 官网查询入口 |
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
wssfk12138/dsh-damage-pulse
Ychris12138/dsh-usage-stats
JingbiaoMei/Tokdash
yxxbc/dsh-balance-plugin
feiyang-dev/dsh-usage-plugin
LaoYueHanNi/dsh-token-usage
lanlandeli/dsh-usage-stats
Shiye-10Pages/dsh-whale-meter