DeepSHPlugins
dsh-model-balance 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-model-balance

安全與運維JavaScriptMIT

自動識別當前模型廠商(內建 7 家),在輸入框內顯示餘額或配額,未內建廠商可配置自定義介面。

1 Starsjacujay 更新時間 2026-08-20
訪問 GitHub 倉庫
dsh-model-balance 專案預覽

專案介紹

中文

自動識別當前模型廠商(內建 7 家),在輸入框內顯示餘額或配額,未內建廠商可配置自定義介面。

English

Auto-detect the current model vendor (7 built-in) and show its balance or quota in the composer input row, with custom endpoints for unsupported vendors.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
jacujay
倉庫
jacujay/dsh-model-balance
GitHub Stars
1
Forks
0
開發語言
JavaScript
許可證
MIT
最近推送
2026-08-20
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

51/ 100
維護活躍
85
文件與實用資訊
99
生態關注度
9
安裝便捷訊號
55
專案宣告訊號
100

近 22 天仍在更新;README 含完整安裝與使用說明;關注度尚低(1)。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

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

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

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

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

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案