DeepSeek Harness 插件

dsh-model-balance

自动识别当前模型厂商(内置 7 家),在输入框内显示余额或配额,未内置厂商可配置自定义接口。

跳到安装方式

来源信息

GitHub 仓库
jacujay/dsh-model-balance
最近更新
2026年8月20日
分类
用量与账单
GitHub stars
0

安装

默认先复制一段 Prompt,让 Agent 读页面和仓库;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读页面和仓库。

请先不要安装。阅读这个 DeepSeek Harness 插件,说明它解决什么问题、会访问哪些文件、网络或密钥,以及如何安装和卸载。

插件页面:https://deepseekplugins.org/zh/plugins/jacujay/dsh-model-balance
GitHub:https://github.com/jacujay/dsh-model-balance
插件名:dsh-model-balance
作者:jacujay
安装命令:dsh plugin --profile web add github:jacujay/dsh-model-balance

确认前不要执行安装命令。

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-model-balance

Auto-detect the current model vendor and show its balance / quota right in the composer input row — a small button left of the model name, hover to peek, click to refresh. A settings page covers vendors without a public balance endpoint via custom endpoints.

Built for DeepSeek Harness (DSH web).

![License: MIT](./LICENSE)

Features

  • Auto vendor detection — reads the current default model's provider from DSH configuration and identifies the vendor by provider id, then by baseURL hostname as a fallback. Custom provider ids (e.g. minimax-cn) still match.
  • Built-in vendors — DeepSeek, Moonshot/Kimi, MiniMax, StepFun, Zhipu (quota only), SiliconFlow, OpenRouter.
  • Two result kinds — monetary balance (with granted/topped-up breakdown where the API provides it) and quota (MiniMax / Zhipu, which expose usage plans instead of money).
  • Input-row button — a small icon before the model name in the native composer row. Hover opens a peek panel; click refreshes. Error / unsupported / quota states get their own colors.
  • Settings page — Settings → Balance lookup: lists supported vendors and lets you add a custom balance endpoint for any provider (URL + response field path + bearer/raw auth + display name).
  • Key-safe — API keys are resolved host-side through the DSH credentials store and never reach the browser. Custom endpoint config persists at ~/.dsh/dsh-model-balance.json without any secrets.
  • Live in seconds — the host answers over same-origin HTTP routes; no restart needed after a page refresh.

Install

Requires DSH web. From the plugin market or:

# from GitHub
dsh plugin --profile web add github:jacujay/dsh-model-balance

Then refresh the browser page.

Supported vendors

VendorEndpointKind
DeepSeek/user/balancebalance (CNY)
Moonshot / Kimi/v1/users/me/balancebalance
MiniMax/v1/token_plan/remainsquota (per-model %)
StepFun/v1/accountsbalance
Zhipu GLM/api/monitor/usage/quota/limitquota only
SiliconFlow/v1/user/infobalance
OpenRouter/api/v1/auth/keybalance (USD) / unlimited

New API-compatible proxies

New API exposes token usage at /api/usage/token, authenticated with the same API key used for model calls. Add a custom endpoint for the matching DSH provider (often openai) in Settings → Balance lookup:

  • URL: https://your-relay.example.com/api/usage/token
  • Response path: data.total_available
  • Authentication: Bearer Token
  • Display name: optional

The plugin recognizes New API's token_usage response automatically. It shows unlimited quota when unlimited_quota is true, otherwise it reports the remaining amount, total granted amount, and usage.

Anything else: add a custom endpoint in Settings → Balance lookup. The API key still comes from DSH credentials (apiKeyEnv of the provider), and the custom URL is called host-side with it.

Privacy & security notes

  • Balance requests are issued by the local DSH host with the provider's API key; the key never leaves this machine and never enters the browser.
  • The settings page stores only endpoint metadata (~/.dsh/dsh-model-balance.json), no secrets.
  • The host routes are same-origin HTTP on the existing DSH web server; mutating routes (custom endpoint save/delete) carry a same-origin check.
  • Custom endpoint URLs are user-provided and may point anywhere; review them before saving.

Development

# no build step — host is plain ESM (lib/index.js), client is a plain
# __ModuleLoader__ bundle (client/client.js)
node --check lib/index.js
node --check client/client.js

License

MIT