插件目录 / Developer / dsh-account-balance
dsh-account-balance
已验证 · 实测可装 ls-cool-123
功能简介
DeepSeek account balance dashboard plugin for dsh web — shows your DeepSeek API balance above the chat window.
可用 — 实测通过,早期项目
DeepSeek account balance dashboard plugin for dsh web — shows your DeepSeek API balance above the chat window. 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-account-balance
一个给 dsh Web 界面实时显示 DeepSeek 模型账户余额的插件。余额以一个小胶囊显示在聊天窗口上方(会话头部的工具区),鼠标悬停可查看「总余额 / 赠送余额 / 充值余额」明细,支持手动刷新,并每 60 秒自动刷新。
工作原理
- Host 半(
lib/index.js):在 Web 服务器上注册一个本地路由/api/account-balance。它通过凭证服务(ctx.credentials,也就是 web 模型设置页 /DEEPSEEK_API_KEY环境变量写入的那个来源)解析 API Key,再代理 DeepSeek 官方的GET /user/balance接口。API Key 只留在本机进程里,绝不暴露给浏览器。 - Client 半(
lib/client.js):在conversation.session.header.utilities槽位注册余额组件,轮询/api/account-balance并渲染。
安装
在插件目录(本目录)下运行:
dsh plugin --profile web add .
等价于手动方式:把 dsh-account-balance 加进 $DSH_HOME/profiles/web/package.json 的 dependencies 与 dsh.profile.bundles。
生效
重启 web 服务即可看到余额:
# 停掉当前 dsh web,再启动
dsh web
配置
插件复用 DeepSeek 官方适配器的凭证来源,无需额外配置:
| 配置 | 说明 |
|---|---|
DEEPSEEK_API_KEY |
API Key(web 模型设置页写入的托管凭证、.env、或环境变量均可) |
DEEPSEEK_BASE_URL |
可选,覆盖余额接口基地址,默认 https://api.deepseek.com |
余额接口返回格式以 DeepSeek 官方文档 为准。
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-account-balance」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:ls-cool-123/dsh-account-balance Headless(CLI)profile:
dsh plugin --profile headless add github:ls-cool-123/dsh-account-balance 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。