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 Monitor — DSH Plugin for DeepSeek Harness
← Plugins
A

api-monitor

Api Monitor

Persistent API usage monitoring: DeepSeek/GLM Coding Plan/OpenCode Go/火山 Coding+Agent Plan balances and quotas, session tree tokens and costs (sidebar entry + standalone floating window).

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

npx -y @deepseek-ai/dsh plugin --profile web add github:jcleener/api-monitor#0b8fba64a0ae589f33f351d6859dd42a3b1ea4f1
READMECompatibilityVersions

Compatibility and provenance

Api Monitor is published as api-monitor and currently resolves to version 0.2.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
8/28/2026

Versions

0.2.0stable
8/28/2026
0.1.3
stable
8/21/2026
0.1.2stable
8/20/2026

Related plugins

Loading related plugins…

Latest
0.2.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
Unavailable
Files
Unavailable
Surface
web
License
MIT
Source
github
GitHub
★ 0
Weekly downloads
0
Last push
9/20/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
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in

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 a dedicated pet bubble for the current providerWhale 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

api-monitor

DSH(DeepSeek Harness)插件:常驻 API 用量监控。 侧边栏底部常驻摘要 + 独立浮动窗,实时查看 DeepSeek 余额、GLM Coding Plan、OpenCode Go 与火山引擎(Coding Plan / Agent Plan)订阅配额,以及当前会话树(主会话 + 全部子代理)的 token 用量与花费。

功能

  • 余额与配额监控:
    • DeepSeek — GET api.deepseek.com/user/balance
    • GLM Coding Plan(智谱 / Z.ai)— GET {base}/api/monitor/usage/quota/limit
    • OpenCode Go — GET opencode.ai/zen/go/v1/usage
    • 火山引擎 — GetCodingPlanUsage / GetAFPUsage(SigV4 签名,service = ark)
  • 会话树用量:统计主会话与全部子代理的 token 用量与花费(价格表可配置,priceTable 覆盖)
  • 入口:侧边栏底部 .footArea(Cordis 面板按钮上方)。宽侧栏显示竖排多行摘要(每家一行:状态色点 + 名称 + 数值,行数由「显示在入口」勾选控制);侧栏收起(rail)时退化为圆形图标;点击弹出 Cordis 风格浮动窗(标题栏 + ✕ 关闭 + Esc 关闭 + 遮罩点外关闭)
  • 轮询:默认 60s 可配置;拉取失败时保留上次成功值(stale-while-revalidate,弱化显示并标注获取时间)
  • 凭据:经 ctx.credentials.resolve() 读取 DEEPSEEK_API_KEY / BIGMODEL_API_KEY(或 ZAI_API_KEY)/ VISION_API_KEY / VOLCES_API_KEY

状态灯配色

场景颜色
DeepSeek 余额 < balanceWarn(默认 10 元)🔴 红
周期用量(GLM Coding Plan / OpenCode Go / 火山 Coding / 火山 Agent)剩余 ≤ 10%(0% = 用尽)🔴 红
周期用量剩余 ≤ 30%(预警)🟡 黄
其余正常🟢 绿

周期用量显示的是剩余百分比(100 − 已用),按三个窗口(5小时/周/月)中最低的剩余决定颜色——任一窗口告急即亮警示。

安装

在目标电脑的 DSH 环境执行:

dsh plugin --profile web add "github:jcleener/api-monitor"

或固定版本:

dsh plugin --profile web add "github:jcleener/api-monitor#v0.1.2"

安装后重启 dsh web,侧边栏底部即出现监控入口。插件为静态常驻:随 DSH 启动自动加载,无需在 Cordis 面板中手动启用/授权,配置持久化于 ~/.dsh/settings.yaml 与 .credentials.yaml。

早期「手动粘贴到 Cordis 面板」的动态版源码与恢复步骤保留在 legacy/,已不推荐使用。

配置

设置命名空间 api-monitor(DSH 设置页或 ~/.dsh/settings.yaml):

键默认说明
volcesAccessKeyId / volcesSecretAccessKey空火山引擎 AK/SK(配额查询专用,与推理用 VOLCES_API_KEY 不同;role('secret') 脱敏)
volcesTierauto火山档位(auto/lite/pro,Agent Plan 另含 small/medium/large/max)
pollIntervalSeconds60轮询间隔(秒)
warnPercent / dangerPercent70 / 90已用%阈值(用于推算剩余%的告警/危险档)
balanceWarn10余额预警阈值(元)
priceTable{}模型价格表({ "模型ID": { pi, pcr, pcw, po } },每 1M tokens USD)
showCacheHitRate / showResetTimetrue / false是否显示缓存命中率 / 重置时间
entryVisibility.*true各供应商是否显示在入口

火山引擎 AK/SK 配置

  1. 在浮动窗的「火山 Coding Plan」/「火山 Agent Plan」区块点 key配置,输入 AccessKey ID 与 SecretKey,保存(两区块共用一份)。
  2. 保存后立即重拉配额;若鉴权失败,区块会显示 ResponseMetadata.Error 中的具体错误(如 SignatureDoesNotMatch / AccessDenied)。
  3. 需要 IAM 具备用量查询权限;SigV4 使用 region=cn-beijing、service=ark。

GLM Coding Plan 配置

  1. 在 .credentials.yaml 配置 BIGMODEL_API_KEY(国内 open.bigmodel.cn,推荐)或 ZAI_API_KEY(国际 api.z.ai),插件自动按凭据名选择端点;无需 AK/SK。
  2. 配额走智谱官方用量接口 GET {base}/api/monitor/usage/quota/limit(Bearer 鉴权),解析 data.limits[]:unit=3 → 5 小时滚动窗口、unit=6 → 周配额、TIME_LIMIT → 月度工具额度(有则显示),data.level 为套餐档位(lite/pro/…)。
  3. 浮动窗「GLM Coding Plan」区块显示套餐档位 + 三窗口剩余 %,入口行显示 5小时|1周 剩余;未订阅或未配置时区块内显示错误提示,不影响其他区块。

历史说明:v0.1.x 曾支持 SiliconFlow 余额(/v1/user/info),因其仅反映 API-key 旧口径余额、与网页钱包不一致,已于 v0.2.0 移除。

工作原理

  • Host 半段(lib/index.js)常驻 dsh web 进程:
    • 注册 api-monitor 配置命名空间(真实 schemastery schema,role('secret') 原生脱敏);
    • 60s 轮询 5 家数据(原生 fetch;火山 SigV4 用 crypto.subtle 计算 HMAC-SHA256);
    • 聚合会话树 token/花费(sessionProjections.tokenUsage + assistant/message 事件按供应商分桶);
    • 经 webServer.register 暴露同源路由:/api-monitor/snapshot|config|refresh|set-volces-keys|set-tier|set-visibility。
  • Client 半段(lib/client.js)以 window.__ModuleLoader__.load factory 加载,注册 sidebar.footer.action 槽(order -20),数据经 fetch 同源路由获取。

开发 / 结构

lib/index.js      Host 半段(ESM,原生 fetch + crypto.subtle)
lib/client.js     Client 半段(__ModuleLoader__ factory,React.createElement)
cordis.patch.yml  加载器补丁层(insert 声明)
package.json      包清单(dsh.client 声明浏览器端打包)
PRD.md            产品需求文档
legacy/           早期动态版源码

本地联调:改动 lib/ 后 HMR 热载(客户端 CSS/JS 变更约 1s 生效);宿主代码与补丁层变更需重启 dsh web。

更新日志

v0.2.0

  • 新增 GLM Coding Plan 配额检测:智谱官方用量接口 GET {base}/api/monitor/usage/quota/limit(open.bigmodel.cn / api.z.ai 自动按凭据选择),显示套餐档位(data.level)与 5 小时 / 周 / 月(TIME_LIMIT,如有)三窗口剩余 %;会话 token 按供应商 glm(bigmodel / zhipu / glm / zai)分桶。凭据 BIGMODEL_API_KEY(或 ZAI_API_KEY)。
  • 移除 SiliconFlow:余额接口仅为 API-key 旧口径、与网页钱包不一致,相关轮询 / 价格种子 / 入口与区块一并移除;entryVisibility.siliconflow 旧键在下次保存可见性时自动清理。
  • 花费预估仅保留 DeepSeek(GLM 走订阅套餐,不计 token 花费)。

v0.1.3

  • 修复会话花费高估(约 2 倍):单价表改为人民币口径,DeepSeek 走官方定价页自动抓价(api-docs.deepseek.com/zh-cn/quick_start/pricing,正则解析 v4-flash/v4-pro 峰谷价,6h 缓存,随【读取套餐】强制刷新)。此前缓存命中按 ¥0.20/M 计价(实际 ¥0.05–0.1),是 agent 编码会话花费高估的主因。
  • 花费展示改为预估区间:峰谷定价无法按请求时刻归因,显示「会话花费预估:梁文峰 ¥X | 梁文谷 ¥Y」(高峰/空闲各一档);平铺价显示单值。
  • 重试去重:会话 token 统计按 (turn,step) 取最后一次 usage,避免同一逻辑调用(重试/失败重发)被重复计费。
  • SiliconFlow 价格仍为内置种子值(DeepSeek-V4-Flash ¥1/¥2)+ 可在 settings 的 priceTable 覆盖;未知名模型显示「—」。

v0.1.2

  • 修复状态灯方向:周期用量(OpenCode Go / 火山 Coding / 火山 Agent)按**剩余%**上色——剩余 ≤10% 红、≤30% 黄、否则绿(此前按剩余越高越红,与"0% = 用尽"语义相反)。

v0.1.1

  • stale-while-revalidate:数据拉取中或失败时,保留并显示上次成功读取的数据(弱化显示并标注「↑ 显示上次数据(HH:MM 获取)」),恢复成功后自动切回实时。

v0.1.0

  • 首个公开版本:常驻 API 用量监控(DeepSeek / SiliconFlow / OpenCode Go / 火山引擎 余额与配额、会话树 token 与花费,侧边栏入口 + 独立浮动窗)。

许可证

MIT © 2025 jcleener