DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

Api Balance — DSH Plugin for DeepSeek Harness
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins
A

dsh-api-balance

Api Balance

API Balance: A floating widget and settings page for read-only display of the DeepSeek API account balance, with query intervals aligned with the official update schedule.

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add github:AdaJyao/dsh-api-balance#f07995f6e1e85f5094f14cc463b448c9df08b86c
READMECompatibilityVersions

Compatibility and provenance

Api Balance is published as dsh-api-balance and currently resolves to version 0.1.0. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
web
Release source
github
Registry updated
9/11/2026

Versions

0.1.0stable
9/11/2026

Related plugins

Loading related plugins…

Latest
0.1.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
Unavailable
Files
Unavailable
Surface
web
License
MIT
Source
github
GitHub
★ 1
Weekly downloads
0
Last push
9/12/2026
View source ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue

Related plugins

More verified plugins in models-usage.

Usage@linxin666/dsh-usageUsage statistics plugin for the dsh web GUI: per-provider balance and coding-plan quota detection plus a live token usage ledger, with the current session provider's today usage on the sidebar entryWhale Widgetdsh-whale-widgetDeepSeek balance whale widget in the bottom-right corner of the DSH Web interface: balance/today’s usage/peak-off-peak pricing, customizable bubble click sequence (text/balance/today/peak-off-peak/image/random phrases and parallel weighted selection), per-line styles and fonts, floating quick editinUsage Stats@ychris12138/dsh-usage-statsToken usage heatmap, provider balances, and subscription quotas for the dsh web GUICodex Connectdsh-codex-connectChatGPT OAuth and Codex models for DeepSeek Harness.

README

dsh-api-balance

只读展示 DeepSeek API 账户余额的 DSH 插件:右下角悬浮挂件 +「设置 → API 余额」页面。

它做什么

  • 悬浮挂件(shell.overlay):🐳 ¥52.14,可拖到屏幕任意位置,单击展开明细(赠金 / 充值 / 账户状态 / 更新于)。鼠标悬停显示完整 tooltip。
  • 设置页(settings.section):一级导航里的中文名条目「API 余额」,展示余额、币种、查询节奏、数据接口与凭据来源。
  • 只读:没有任何充值、扣费或写操作,也不修改账户设置。

三条设计约束

  1. 查询节奏与官方更新节奏一致:对官方 /user/balance 的调用不快于每 5 分钟一次,且失败也计入该节奏(按 attemptAt 判定)。刷新页面、多开标签、多个界面同时轮询都不会额外打到官方接口。界面每 60 秒只重读 Host 缓存(本地 HTTP,不产生官方调用)。
  2. 状态模型区分「尝试」与「成功读数」:lastAttempt 决定展示形态(fresh / stale / error)与限速,lastSuccess 是失败时唯一能拿出来的事实。二者混用会导致「成功一次反而丢掉新值」,因此刻意分开。连续失败时界面保留上次成功读数并标黄,而不是把值丢光。
  3. 密钥不落地:API Key 由 Host 的 credentials 服务解析(DEEPSEEK_API_KEY),经 stdin 交给 curl -K - 的配置解析器 —— 不进 argv(ps 看不到)、不进子进程环境、不写文件、不下发到浏览器。

结构

文件作用
lib/index.jsHost 半边:读凭据、调官方接口、限速缓存,经 webServer 路由 /_dsh/api-balance/balance 暴露给浏览器
client/index.jsClient 半边源码(CJS 模块体,无 JSX)
client/build.mjs零依赖构建:套 __ModuleLoader__ 装载外壳 → client/dist/index.js
client/dist/index.js实际被浏览器加载的 bundle(构建产物)
cordis.patch.ymlcomposition 行:把本插件 insert 进 profile

路由为什么挂在 /_dsh/ 下

静态插件没有 harness / host 全局,Host↔Client 走 webServer HTTP 路由。

当 DSH 部署在门户或反向代理之后时(例如某些 NAS 应用门户),网关通常只转发一组固定的路径前缀,而 /_dsh/ 是其中常见的既有前缀之一。把路由挂在这个前缀下,可以让它在直连端口与门户路径两种访问方式下都可达,从而不必修改网关配置 —— 这也是选择它的唯一理由;若你的部署没有网关,任何前缀都一样。

构建

node client/build.mjs              # 产出 client/dist/index.js
node --check client/dist/index.js  # 语法自检

安装

方式一:用预打包 Release(推荐)

从 Releases 下载 dsh-api-balance-0.1.0.tgz(sha256sum 可与 Release 说明核对),然后直接跳到下面「方式二」的第 3 步生成 spec.json。省掉构建与打包两步。

方式二:从源码自己打包

本仓库不含预打包的 .tgz,也不含带绝对路径的本地 spec.json(两者都在 .gitignore 内)。

# 1. 构建客户端 bundle
node client/build.mjs

# 2. 打成 npm 风格 tarball —— 必须单顶层目录 package/
rm -rf /tmp/pack && mkdir -p /tmp/pack/package
cp -r package.json cordis.patch.yml README.md LICENSE lib client /tmp/pack/package/
tar czf dsh-api-balance-0.1.0.tgz -C /tmp/pack package
sha256sum dsh-api-balance-0.1.0.tgz

# 3. 照 spec.example.json 生成 spec.json(填 tgz 绝对路径与 sha256),
#    交给部署自带的插件安装器落盘 —— 商店条目 + 实体 + profile symlink + bundles + plugin-state,
#    然后重启 DSH。

安装器要求:tarball 单顶层目录;package.json 必须声明 dsh.bundle.patch。

HTTP 接口

POST /_dsh/api-balance/balance(请求体可省略)

{ "ok": true, "data": {
  "ok": true, "at": 1757600000000, "attemptAt": 1757600000000, "stale": false, "error": null,
  "intervalMs": 300000, "isAvailable": true, "currency": "CNY",
  "totalBalance": "52.14", "grantedBalance": "0.00", "toppedUpBalance": "52.14",
  "keySource": "file"
} }

data.ok=false 表示本次查询失败:带 stale: true 时数据字段是上次成功读数,不带则是从未成功过。

卸载

市场 UI 卸载,或删除 profile bundles / plugin-state.json 条目 / 实体目录后重启。