wannanbigpig/dsh-usage-stats 预览 preview

wannanbigpig/dsh-usage-stats

Plugin插件 Native原生 ⭐ 3 MIT Usage & Cost用量与计费Data & Analysis数据与分析

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 原生凭据服务访问。已知限制是,插件停用期间遗漏的用量无法自动补回,手动恢复时如果放宽范围可能存在重复计费的风险,首次打开会自动迁移旧版本数据。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • 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/stream usage 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 →

← 上一个 Prev dsh-provider-usage 下一个 Next dsh-wx-skin →