dsh-deepseek-balance
Manifest validDeepSeek API 余额监视器:DSH 右下角悬浮徽章 + 7天/30天用量费用图表
dsh-deepseek-balance
右下角悬浮的 DeepSeek API 余额监视器 —— 为 DeepSeek Harness (DSH) 实时显示账户余额与用量费用。
功能
- 🟢 右下角常驻悬浮徽章:状态色圆点 + 实时余额,任何页面/会话下都可见
- 📊 用量费用图表:7 天 / 30 天柱状图,悬停查看每日金额
- 🔄 每 60 秒自动刷新,也可手动刷新
- 🎨 自动适配深浅色主题(使用 DSH 主题变量)
- 🔑 自动读取已配置的
DEEPSEEK_API_KEY凭证,无需手动填写 - 🔒 Key 安全:通过环境变量传给 curl,命令行/日志不出现明文
余额数据来自官方接口 GET https://api.deepseek.com/user/balance;
用量数据来自本机 DSH 会话日志的真实 token 统计(按官方价格换算费用),
更早的历史因本地无账单记录以灰色示意柱展示。
安装
dsh plugin --profile web add "github:<你的用户名>/dsh-deepseek-balance#main"
然后重启 dsh --profile web,右下角即可看到余额徽章。
凭证配置
在 ~/.dsh/.credentials.yaml 中配置:
DEEPSEEK_API_KEY: sk-xxxxxxxxxxxxxxxxxxxxxxxx
开发
pnpm install
pnpm build # tsc 编译 Host + tsdown 打包 Client
产物结构:
lib/index.js— Host 半(RPC handler:余额/用量查询)lib/client.js— Client 半(悬浮徽章 UI,__ModuleLoader__bundle)
工作原理
┌──────────────┐ connection.rpc.call ┌──────────────────────────┐
│ Browser UI │ ──────────────────────▶ │ Host (Node) │
│ shell.overlay│ /deepseek-balance │ ├─ credentials.resolve │
│ 悬浮徽章+图表 │ ◀────────────────────── │ ├─ shell curl 余额 API │
└──────────────┘ RpcResult │ └─ sessionQuery 用量统计 │
└──────────────────────────┘
License
MIT
Comments
Loading…
Similar plugins
by Jianwen-Xu
DSH 插件:在 Web 侧边栏显示 DeepSeek API 余额与高峰/空闲计费时段
★ 0
MIT
TypeScript
Sep 18, 2026
dsh plugin --profile web add dsh-deepseek-balanceby EasyTZ
余额与费用:DeepSeek 余额、日/周/月花费、各模型用量与实时单价。Balance and cost panel for DeepSeek Harness: balance, spend, per-model usage, live pricing.
★ 0
MIT
JavaScript
Oct 19, 2026
dsh plugin --profile web add @easytz/dsh-ui-balanceby jieguanya
DeepSeek Harness (DSH) 余额插件:实时余额/今日消耗/7-30天趋势图
★ 0
MIT
JavaScript
Aug 22, 2026
dsh plugin --profile web add tugu-dsh-balance-widgetby zlZayn
DSH 插件:在左侧栏底部显示 DeepSeek 账户余额(原生 UI),设置页提供连接、展示币种、预警阈值与刷新节奏的配置卡片。(原生嵌入“设置-插件-插件配置”)
★ 2
↓ 362/wk
MIT
TypeScript
Sep 19, 2026
dsh plugin --profile web add dsh-ds-balanceby sixtysevenlf
省钱+余额监控悬浮窗(DSH Web UI 插件):DeepSeek / OpenCode Go 双标签余额、限额监控(金额/tok/小时)、语音提醒、超限断点截断
★ 2
BSD-3-Clause
JavaScript
Aug 18, 2026
dsh plugin --profile web add dsh-save-balance-monitorby Rainronin
DeepSeek Harness 插件:DeepSeek API 余额实时监测(官方 /user/balance 快照 + ds_balance 工具 + 峰谷计价状态 + 单会话费用估算 + dsh 原生风格侧边栏徽章)
★ 3
↓ 66/wk
MIT
JavaScript
Aug 31, 2026
dsh plugin --profile web add @rainronin/dsh-balance-monitor