FengHuoLinShan/dsh-plugin-llm-balance
DSH插件:可拖动的API余额/配额悬浮卡片(DeepSeek / Moonshot / Kimi For Coding自动发现、分档变色、实时刷新)| 适用于DeepSeek Harness的可拖动API余额/配额卡片
Project Overview项目介绍
This is a native DSH plugin that adds a persistent floating balance and quota card to the DSH web GUI. It can be installed with a single dsh plugin add command, supporting multiple installation methods including from npm, GitHub, local source, or tarball. After installation, you just need to restart the DSH service, and the card will appear in the top-right corner of your web interface. It requires DSH version 0.1.1-rc.2 or newer, and works with both loopback RPC for older versions and the newer BrowserAuth RPC for newer DSH releases. It automatically discovers configured providers from your existing DSH settings, so you do not need to manually add each provider.
The plugin automatically tracks the most recently used providers after activation, only keeping up to 3 different providers in the floating card. Existing entries keep their position, and only older unused entries get replaced when you use a new provider. The card is draggable and remembers its last position, supports manual refresh on click, and auto-refreshes every 60 seconds by default. It pauses refreshing when the page is hidden, and updates immediately when the page becomes visible again. It is ideal for DSH users that regularly use multiple LLM providers and want to quickly check their remaining balance and quota.
The plugin follows the MIT open source license, and has strong security guarantees for your API credentials. API keys are never sent to the browser, and all balance queries are proxied through the DSH server, so your credentials never get exposed. OpenAI Codex quota display is an optional feature that requires you to install the separate dsh-codex-connect plugin and complete ChatGPT OAuth login, and other providers work without any extra dependencies. The color coding for balance and quota makes it easy to see at a glance how much you have left, with green for healthy levels down to gray for exhausted quota.
这是DeepSeek Harness(DSH)的原生余额配额悬浮卡片插件,安装后会在DSH的Web GUI常驻显示最近使用的最多3个LLM提供商的使用情况,让余额、套餐余量和重置时间一目了然。它支持自动发现配置,可合并内置提供商、llm-pi-ai配置和插件自身配置,无需手动逐个添加提供商,目前支持8个主流LLM服务商。
插件会自动记录启用后成功完成的模型调用,仅保留最近3个不同提供商,已有项目保持位置稳定,新调用仅替换淘汰项。卡片支持拖动且会记忆位置,支持点击手动刷新,默认每60秒自动刷新一次,页面隐藏时暂停刷新,恢复可见后立即更新,适合高频使用多LLM提供商的DSH用户快速查看配额状态。
本插件遵循MIT开源许可协议,要求DSH版本不低于0.1.1-rc.2,可通过一条dsh plugin命令完成安装,安装后重启DSH服务即可生效。API密钥不会发送到浏览器端,所有余额查询都由服务端代理,不暴露凭证,OpenAI Codex配额显示为可选功能,需额外安装dsh-codex-connect插件。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-plugin-llm-balance(FengHuoLinShan/dsh-plugin-llm-balance)
仓库:https://github.com/FengHuoLinShan/dsh-plugin-llm-balance
本站详情页:https://www.yhbd.top/plugins/fenghuolinshan-dsh-plugin-llm-balance/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 3 · 最近提交 2026-09-13 · 主语言 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 dsh-plugin-llm-balance
把 FengHuoLinShan/dsh-plugin-llm-balance 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-plugin-llm-balance
🏷️ DSH 官方插件生态收录项目(git tag:
dsh-official-plugin;GitHub topics:dsh-plugin·deepseek-harness)。English | 中文
DSH(DeepSeek Harness)的余额与配额悬浮卡片。它会在 Web GUI 中常驻显示最近使用的最多 3 个 provider,让余额、套餐余量和重置时间一眼可见。

功能
- 自动跟随最近使用的 provider:只记录插件启用后成功完成的模型调用,显示最近 3 个不同 provider;已有项目保持槽位稳定,新项目只替换被淘汰项。
- 同时支持余额与配额:金额余额按数值显示;套餐配额同时展示 5 小时、周等可用窗口及重置时间,状态颜色按最紧张的窗口计算。
- DeepSeek 峰谷电价徽标:DeepSeek 余额行尾部显示「☾ 低谷 / ☀ 高峰」小药丸——2026-08-17 起高峰为北京时间工作日 09:00–12:00、14:00–18:00,含周末在内的其余时段均为低谷半价;纯时钟计算不发请求,tooltip 显示时段表与距切换的倒计时,徽标随现有余额轮询及标签页恢复刷新;未配置 Key 的行不挂徽标。
- 自动发现配置:合并内置 provider、
llm-pi-ai.providers.*和本插件配置,无需逐个添加。 - 轻量交互:卡片可拖动并记忆位置;点击即可刷新;默认每 60 秒自动刷新,页面隐藏时暂停、恢复可见时立即更新。
- 凭据不出服务端:API Key 和 OAuth token 不会发送到浏览器;DSH 0.1.1 使用 loopback-only RPC,0.1.2 使用其统一 BrowserAuth。
支持范围
| Provider | 展示内容 | 凭据来源 |
|---|---|---|
| DeepSeek / DeepSeek Official | CNY 余额 | DSH credentials |
| Moonshot / Moonshot CN | CNY 余额 | DSH credentials |
| Kimi For Coding | 5h、周配额与套餐等级 | DSH credentials |
| OpenAI Codex | 5h、周、可选月配额与 Credits | Codex Connect 的 ChatGPT OAuth |
| OpenCode Go | 5h、周配额 | DSH credentials |
| OpenRouter | API Key 日/周/月消费限额 | DSH credentials |
| MiniMax / MiniMax CN | Token Plan 5h、周配额 | DSH credentials |
| Z.AI / BigModel | Coding Plan 5h、周配额 | DSH credentials |
余额颜色:绿 >=100,黄 20–99,红 1–19,灰 <1。配额颜色:绿 >=50%,黄 20–49%,红 5–19%,灰 <5%;加载或查询失败同样显示灰色。
原理
服务端(
lib/index.js):记录最近使用的 provider,通过/api/llm-balance精确 Fetch 路由代理余额查询,从显式apiKeyEnv或llm-pi-ai/<provider>API-key record 取凭据,并对同源请求去重;OAuth grant 只判断已配置,不解析内容。浏览器端(
lib/client.js):聚合最近 3 个 provider,只请求当前需要展示的数据,并负责刷新、着色、拖动和位置记忆。支持的 provider 接口:
provider id 接口 口径 deepseek / deepseek-official GET https://api.deepseek.com/user/balance余额(CNY;官方 total_balance为字符串,数字同样兼容)moonshotai / moonshotai-cn GET https://api.moonshot.ai/v1/users/me/balance/https://api.moonshot.cn/...国际/CN 余额(CNY) kimi-coding GET https://api.kimi.com/coding/v1/usages套餐配额(顶层 usage=周限额 + limits 窗口明细(5h 限流等,window 对象归一化为 5h/周),含套餐等级) openai-codex dsh-codex-connect(GET https://chatgpt.com/backend-api/wham/usage)Codex Connect 配额(rateLimits 主 bucket(id codex,回退首个)窗口 = 剩余百分比(limit=100,18000s → 5h、604800s → 周,其余稳定时长标签);可选 individualLimit → 月配额、credits → USD 余额或 Credits 段(credits.unlimited=true时仅因百分比 UI 显示为有限 100/100——绿色 100% 而非灰色 ∞/∞,账户本身仍无限))opencode-go GET https://opencode.ai/zen/go/v1/usageOpenCode Go 套餐配额( usage.rolling→ 5h、usage.weekly→ 周:percent为已用百分比 → amount=100-percent、limit=100,resetsAt→ 重置时间;monthly 忽略;单个窗口无效只跳过该窗口,至少一个窗口有效才成功。⚠️ 端点目前无官方公开文档,可能变化)openrouter GET https://openrouter.ai/api/v1/key当前 Key 的日/周/月消费限额;Key 未设限时如实报告无剩余额度口径 minimax / minimax-cn GET https://www.minimax.io/v1/token_plan/remains/https://www.minimaxi.com/...Token Plan 文本模型 5h、周剩余比例 zai / zai-coding-cn GET https://api.z.ai/api/monitor/usage/quota/limit/https://open.bigmodel.cn/...Coding Plan 5h、周剩余比例;忽略 MCP/tool-only 月额度
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
MeteorNOX/DeepSeek-Balance-Whale-Widget
edison7009/EchoBird
Han-1413141/dsh-cost-meter
wssfk12138/dsh-damage-pulse
zh667/TokenLedger
edonadei/caliper
Ychris12138/dsh-usage-stats
Aisland-SJL/dsh-usage