ganfne123 / dsh-plugin-api-quota

已收录

DSH Web UI plugin: check your DeepSeek API key balance from the sidebar

main工具 查看源代码

安装

npx -y @deepseek-ai/dsh plugin --profile web add github:ganfne123/dsh-plugin-api-quota

此安装命令根据 GitHub 仓库地址生成,是未经验证的安装起点。

README

维护者编写的文档快照。

在 GitHub 查看 ↗
提交版本 a571a35同步于 2026年8月18日

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

HalfResponsibility
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 webweb 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

FieldDefaultMeaning
apiKeyEnvDEEPSEEK_API_KEYCredential reference (environment-variable-shaped) holding the API key
baseURLhttps://api.deepseek.comDeepSeek API base URL
balancePath/user/balanceBalance endpoint path appended to baseURL

License

MIT

项目文件与信号

以下项目是目录快照中检测到的公开仓库信号。

测试已检测

仓库信息

开发语言
JavaScript
许可证
MIT
最新发布
v0.1.0
最后更新
2026年8月15日 07:25

谨慎安装

请检查源代码、权限、生命周期脚本、依赖与网络访问;不受信任的插件应先在隔离环境中测试。