插件目录 / UI & Skins / dsh-plugin-api-quota
dsh-plugin-api-quota
已验证 · 实测可装 ganfne123
功能简介
DSH Web UI plugin: check your DeepSeek API key balance from the sidebar
可用 — 实测通过,早期项目
DSH Web UI plugin: check your DeepSeek API key balance from the sidebar 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-plugin-api-quota
DSH Web UI plugin — check your DeepSeek API key balance from the sidebar.
What It Does
Adds an API Quota entry to the Web sidebar footer (next to Settings). Clicking it opens a panel that queries the DeepSeek official balance endpoint (GET /user/balance) and shows:
- Total balance, granted balance, topped-up balance
- Currency and availability
- Query time, with a refresh button
The API key never crosses into the browser: the browser half fetches a same-origin route (/api-quota/balance) served by the plugin's host half, which resolves the key through the credential seam (ctx.credentials) and talks to DeepSeek server-side.
How It Works
| Half | Responsibility |
|---|---|
Host (src/index.ts) |
Registers GET /api-quota/balance on the web server; resolves DEEPSEEK_API_KEY via ctx.credentials, calls https://api.deepseek.com/user/balance |
Browser (src/client/) |
Registers the sidebar.footer.action slot entry; fetches the route and renders the balance panel (Modal) |
The credential reference and endpoint are configurable via the plugin config (apiKeyEnv, baseURL, balancePath), defaulting to DEEPSEEK_API_KEY / https://api.deepseek.com / /user/balance.
Quick Start
DSH plugins install into a profile (dsh web → web profile). Install, restart dsh web, done.
# from the plugin repo root
npm install && npm run build
# register in the profile patch layer (~/.dsh/profiles/web/cordis.patch.yml):
# - insert:
# - id: plugin-api-quota
# name: dsh-plugin-api-quota
# symlink into the profile's node_modules:
# ln -s "$PWD" ~/.dsh/profiles/web/node_modules/dsh-plugin-api-quota
Configuration
| Field | Default | Meaning |
|---|---|---|
apiKeyEnv |
DEEPSEEK_API_KEY |
Credential reference (environment-variable-shaped) holding the API key |
baseURL |
https://api.deepseek.com |
DeepSeek API base URL |
balancePath |
/user/balance |
Balance endpoint path appended to baseURL |
License
MIT
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-plugin-api-quota」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:ganfne123/dsh-plugin-api-quota Headless(CLI)profile:
dsh plugin --profile headless add github:ganfne123/dsh-plugin-api-quota 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。