dsh-balance-display-simple
Manifest validShow the DeepSeek API account balance in the DSH sidebar, refreshed every 60 seconds through a same-origin endpoint that keeps the API key on the server side.
dsh-balance-display-simple
DSH 侧边栏顶部品牌行下方实时显示 DeepSeek API 账户余额。
名字里的
simple是实话:只做「查余额、显示余额」。没有图表、历史记账、多供应商切换。
功能
- 侧边栏 deepseek 标题正下方显示
API 余额 ¥19.74,多币种用·拼接 - 每 60 秒自动刷新;点击余额条立即刷新
- 状态圆点:绿 = 正常,红 = 账户不可用,橙 = 查询失败(保留上次数值)
- 侧边栏折叠成 rail 时自动隐藏
- 跟随主题配色
安全设计
浏览器 / 渲染进程不接触 API Key:
- Host 半区(
lib/index.js)注册同源端点GET /api/deepseek-balance-simple,通过credentials服务解析DEEPSEEK_API_KEY(来源:进程环境 ><DSH_HOME>/.credentials.yaml>.env), 由服务端调用https://api.deepseek.com/user/balance(15 秒超时,cache-control: no-store)。 - Client 半区(
lib/client.js)只请求这个本地端点,经 MutationObserver 在侧边栏品牌行后注入余额条, React 重渲染后自动重新挂载。
安装
前置:Node.js 20+;DSH_HOME 指向 DSH 数据家,或用 --dsh-home 显式传入。
方式 A:手动复制(不需要 pnpm)
git clone https://github.com/happyde2b/dsh-balance-display-simple.git
cd dsh-balance-display-simple
node install.js # → <DSH_HOME>\profiles\desktop\node_modules\dsh-balance-display-simple
node install.js --profile web # 指定 profile
# 同时更新 profile 的 package.json(dependencies + dsh.profile.bundles)
方式 B:官方插件管理器
node install.js --pack # 产物:<DSH_HOME>\downloads\dsh-balance-display-simple-<版本>.tgz
# 在 DSH「插件 → 添加插件」里填该 tgz 的绝对路径,安装后启用
安装后重启 DSH 桌面端生效。
配置
暂无配置项。轮询间隔在 lib/client.js 顶部 REFRESH_MS = 60000,改后重启桌面端。
验证
node --check lib/index.js
node --check lib/client.js
桌面端运行中可直接查端点:
curl http://127.0.0.1:<DSH Web 端口>/api/deepseek-balance-simple
# {"ok":true,"fetchedAt":...,"is_available":true,"balance_infos":[{"currency":"CNY","total_balance":"19.74"}]}
目录结构
lib/index.js Host 半区:注册余额端点
lib/client.js Client 半区:侧边栏余额条
cordis.patch.yml bundle 配置层(插入插件行)
install.js 手动安装 / 打包脚本
许可
MIT
Comments
Loading…
Similar plugins
by etony668
DeepSeek API 余额常驻显示(侧边栏「设置」旁)· DeepSeek API balance badge beside Settings in the DSH sidebar
★ 0
MIT
JavaScript
Oct 17, 2026
dsh plugin --profile web add @etony668/dsh-balanceby changan0617
Floating DeepSeek account balance card for the dsh web UI: shows total, granted and topped-up balance per currency, refreshed every 60 seconds. Draggable and collapsible; the API key resolves from the
★ 0
MIT
JavaScript
Oct 18, 2026
dsh plugin --profile web add dsh-deepseek-balanceby neltharion11
DeepSeek Harness plugin: show your DeepSeek API account balance in the DSH web sidebar (live widget) and expose it to the model via an api_balance tool
★ 0
MIT
JavaScript
Aug 19, 2026
dsh plugin --profile web add dsh-api-balanceby AKUSH99
Live DeepSeek API balance in the sidebar footer plus an always-visible bottom-right pill: status dot and amount, refreshed every 60 seconds, the API key is read from the local credential store and nev
★ 0
MIT
JavaScript
Aug 26, 2026
dsh plugin --profile web add dsh-balance-chipby chenjingchun
DeepSeek account balance badge for the DSH sidebar footer, with a settings card for the refresh period. The API key never reaches the browser.
★ 0
MIT
JavaScript
Sep 21, 2026
dsh plugin --profile web add dsh-deepseek-balance-badgeby wangxiang0605qvq
DSH 侧边栏实时 DeepSeek 账户余额插件(走账号登录,无需 API Key) | Live DeepSeek account balance in the DSH sidebar
★ 0
MIT
JavaScript
Sep 29, 2026
dsh plugin --profile web add @deepseek-ai/dsh-deepseek-balance