Real-time DeepSeek account balance in the composer dock, auto-refreshing every 15 seconds with hover details.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:CN-Leo/dsh-deepseek-balance
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time. Only install sources you trust, and pin a commit (github:owner/repo#sha).
README
DeepSeek 账户余额实时显示插件(DeepSeek Harness / DSH)。
在 DSH Web 界面的输入框下方(conversation.composer.dock)常驻显示 DeepSeek 官方账户余额,每 15 秒自动刷新。数据来自官方接口 GET https://api.deepseek.com/user/balance,API Key 由 Host 端从 DSH 凭据库解析,绝不会进入浏览器。
安装
# 从 Git 仓库(发布后)
dsh plugin add https://github.com/<你的用户名>/dsh-deepseek-balance
# 或从本地目录
dsh plugin add /path/to/dsh-deepseek-balance
安装后重启 dsh web(当前进程不会热加载新插件)。
配置(必需)
插件通过 credentials 服务解析 DEEPSEEK_API_KEY,按以下顺序查找(任选其一):
环境变量
DEEPSEEK_API_KEY$DSH_HOME/.credentials.yaml:DEEPSEEK_API_KEY: sk-xxxxxxxxxxxxxxxx
配置后无需重启插件:每次请求都会重新解析凭据。
使用
- 余额条显示在会话输入框下方,绿点 = 正常,黄点 = 加载中,红点 = 获取失败
- 悬停(hover)余额条可查看各币种明细:总额 / 赠送 / 充值 / 账户可用状态
- 每 15 秒自动刷新一次
原理
| 端 | 职责 |
|---|---|
| Host | credentials.resolve('DEEPSEEK_API_KEY') → subprocess 调用 curl 请求官方余额接口 → 通过 webServer 暴露 GET /api/deepseek-balance |
| Client | 浏览器 fetch('/api/deepseek-balance') 每 15s 轮询 → slots 注册常驻 UI |
API Key 只存在于 Host 进程的 curl 子进程参数中,浏览器端只能拿到余额 JSON。
卸载
dsh plugin remove dsh-deepseek-balance
依赖
- Host:
credentials、subprocess、sandboxPolicy、webServer(DSH 基础服务,Web 模式均有) - Client:
slots服务,react(由 DSH Web 模块表提供) - 系统:
curl(Windows 自带curl.exe;其他平台需 PATH 中有 curl)
License
MIT
Links
More in this category
Han-1413141/dsh-cost-meter★ 57
Per-session and daily API cost, budget with usage %, official balance, history dashboard, and one-click official price sync with peak/off-peak pricing.
Ychris12138/dsh-usage-stats★ 56
Multi-provider usage dashboard with provider/model token breakdowns, calendar drill-downs, account balances, and OpenCode Go / Z.ai subscription quota tracking.
zh667/TokenLedger★ 22
Sidebar usage panel that attributes tokens to the relay site that served each request, read from your existing provider config: today/month/all-time totals, per-site and per-model breakdowns, a year activity heatmap, and New API / Sub2API / DeepSeek balances.
feibi-mochi/deepseek-harness-control-center★ 21
DeepSeek Harness control center for official balance monitoring, per-session costs and tokens, third-party token totals, completion alerts, official recharge, flexible layouts, and agent-assisted session controls.
SenmuuuuW/dsh-whale-report★ 19
DeepTrace — deterministic agent reports from session logs (daily/weekly/monthly/yearly/custom): cost & token breakdown, 8 insight rules, collaboration review, live provider balance, PDF/PNG/HTML export; read-only, never rewrites history.
Ghost011118/dsh-balance-meter★ 16
DeepSeek account balance and session cost in the composer dock, with auto-fetched official pricing and peak/off-peak support.