Kihara777/dsh-api-balance
API 用量余额插件 for DeepSeek Harness — webui 用量圆圈内提供「用量 / 余额」标签切换,展示账户余额与用量明细
Project Overview项目介绍
dsh-api-balance is a native plugin built exclusively for DeepSeek Harness, designed to track DeepSeek API usage and display account balance information directly within DSH’s web user interface. The plugin adds a new “Usage / Balance” tab to the popup panel of the usage indicator circle, which sits to the left of the webui’s send button. It pulls account balance data via DeepSeek’s official GET /user/balance endpoint, can automatically scan for valid authentication tokens from the local browser, and generates charts for consumption broken down by date and model. It also adds small UI enhancements like red labeling for peak billing hours and improved scrolling for help modals.
Most users can install the plugin directly from GitHub via the DSH command line, using the command dsh plugin --profile web add github:Kihara777/dsh-api-balance. Once installed, it activates automatically as a layer of the DSH web profile, and can be uninstalled later with a matching remove command. For NixOS users, there is a declarative Nix Flake installation option available through the NixKits dsh module, which locks plugin versions with the system update for full reproducibility. This plugin is ideal for any DSH user that regularly uses DeepSeek API calls and wants to keep close track of their spending and usage.
The plugin is written entirely in plain JavaScript, with no build step required for installation or development. Dependencies are handled by the host DSH runtime, so local developers only need to run npm install --legacy-peer-deps to get set up. The project is released under the open source MIT license, but it is currently not published as an npm package due to the maintainer’s visual impairment that prevents completing the npm package submission process. Users can only install it via source code or the Nix Flake method, and the maintainer apologizes for any temporary inconvenience.
这是专为 DeepSeek Harness 开发的原生插件,用于追踪 DeepSeek API 的用量消耗与账户余额。它会在网页端界面发送按钮左侧的用量指示圆圈弹出面板中,新增「用量/余额」标签切换栏,支持通过 DeepSeek 官方接口查询账户余额,可自动从本地浏览器登录态获取令牌,展示按日、月、模型分类的详细消耗数据并生成统计图表。
普通用户可通过 DSH 命令行直接从 GitHub 源码安装,命令是 dsh plugin --profile web add github:Kihara777/dsh-api-balance,安装后即作为 web profile 的层级激活生效。NixOS 用户还可使用声明式 Nix Flake 方案安装,版本会随系统更新自动锁定,可复现性更强。这款插件适合经常调用 DeepSeek API 的 DSH 用户,方便随时掌握 API 消耗情况,避免余额不足中断服务。
本插件是纯 JavaScript 开发,不需要构建步骤,依赖由宿主 DSH 在运行时提供,本地开发只需要执行 npm install 安装依赖即可。项目采用 MIT 许可开源,目前暂不提供 npm 打包发布,用户只能通过源码或 Nix 方式安装。维护者因视力障碍暂时无法完成 npm 提交流程,感谢用户的理解。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-api-balance(Kihara777/dsh-api-balance)
仓库:https://github.com/Kihara777/dsh-api-balance
本站详情页:https://www.yhbd.top/plugins/kihara777-dsh-api-balance/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 2026-10-02 · 主语言 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 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
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 github:Kihara777/dsh-api-balance
把 Kihara777/dsh-api-balance 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-api-balance
API 用量余额插件(DeepSeek Harness)——在 webui 用量圆圈(发送按钮左侧的上下文已用显示)的弹出面板中提供「用量 / 余额」标签切换。
[!NOTE] 由于维护者(狐莉)患有罕见的视网膜色素变性(锥杆营养不良15型)疾病,并经中华人民共和国残疾人联合会认证属于一级视力残疾,暂时无法独立完成 NPM 软件包提交流程,故本仓库暂时不会提供 npm 打包。我们(狐莉与小爪)对此引起的不便表示抱歉,该问题终有一天会得到解决,但十分遗憾可能并不是现在立刻马上。在此之前,辛苦各位使用者通过 GitHub 源码安装(详见文档)。当然,这位用户,可以耽误您一点时间吗嘛?请允许我向您介绍我们声明式和可复现的 NixOS 以及更加符合狐莉美学的 nix flake 安装方案。(乖巧
安装
从 GitHub 源码安装
dsh plugin --profile web add github:Kihara777/dsh-api-balance
包内 dsh.bundle 指向 cordis.patch.yml,安装后即作为 profile 的一个 layer 激活。
卸载:dsh plugin --profile web remove @kihara777/dsh-api-balance。
声明式安装(NixOS)
NixOS 用户可经 NixKits 的 nixkits.dsh 模块声明式安装——
版本由 Nix 锁定、随系统代际更新、可复现:
{
nixkits.dsh.plugins.packages = [{
package = pkgs.dsh-api-balance;
id = "api-balance";
name = "@kihara777/dsh-api-balance";
}];
}
详见完整文档。
功能
- 余额 / 用量面板:webui 用量圆圈弹出面板内的「用量 / 余额」标签切换
- 账户余额:DeepSeek 官方
GET /user/balance(API key 认证) - 用量明细:当日 / 当月 / 30 日消耗(金额 + token + 分模型明细)与图表
- 平台令牌自动获取:默认从本机浏览器登录态自动扫描,手动连接为回退
- 语音播报:语音包 + TTS(浏览器内置 / 自定义 API),峰谷计费自动提示;音色按界面语言与话的变体自动匹配(请求普通话不会挑到粤语音色),也可在语音设置里直接指定音色
- 界面增强:峰时红色标识、疑问窗口滚动优化、回车换行开关等
开发
纯 JS 插件,无构建步骤(lib/index.js + lib/client.js 直接提交):
npm install --legacy-peer-deps # 安装依赖(peer 由宿主 dsh 在运行时提供)
代码结构:
| 文件 | 作用 |
|---|---|
lib/index.js |
host 半部:端点、令牌管理、上游查询 |
lib/client.js |
client 半部:webui 面板与交互 |
cordis.patch.yml |
bundle patch:供 dsh plugin add 注册本插件 |
许可
安全政策(含已评估的外部报告清单——误报不再重复受理)见 SECURITY.md。
MeteorNOX/DeepSeek-Balance-Whale-Widget
Lxiayu/DshCockpit
feiyang-dev/dsh-usage-plugin
Witherwithwinter/DeepSeek-Balance-Whale-Widget-Bowl
wenzetan/dsh-quota-panel
nonewind/dsh-spend
lssyd20070106/dsh-ui-preset-enhance