
linshule/dsh-balance
40Last commit Aug 14, 2026
dsh-balance DSH plugin
This plugin adds a draggable badge at the bottom-left corner of the DSH Web GUI that displays both DeepSeek API account balance (CNY/USD) and OpenCodeGo plan usage (rolling, weekly, monthly windows). Clicking the badge opens a detail panel where you can view breakdowns, manage API keys, and trigger manual refresh. It also provides dedicated settings sections for both indicators.
How to install the dsh-balance DSH plugin
dsh plugin --profile web add github:linshule/dsh-balanceCopying does not run this command. Review the repository and version before installing the dsh-balance DSH plugin.
dsh-balance DSH plugin data source
dsh-balance DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-balance DSH plugin can do
- Shows DeepSeek balance and OpenCodeGo usage in a single draggable badge
- Displays status dot (green/yellow/red/white) based on remaining percentages
- Opens detail panel on click with per-indicator breakdowns, progress bars, and reset times
- Supports inline API key save/clear for both DeepSeek and OpenCodeGo
- Auto-refreshes at configurable intervals (30s, 1min, 5min) with interval persistence across restarts
- Network resilience: uses HTTP/1.1, auto-retry, and concurrent request deduplication
- All API routes restricted to loopback addresses (127.0.0.1/localhost) for security
Where the dsh-balance DSH plugin fits
- Monitor DeepSeek API balance from the DSH Web GUI without leaving the interface
- Track OpenCodeGo plan usage across three time windows (rolling, weekly, monthly)
- Receive visual alerts when balance or usage drops below thresholds
- Manage API keys for both services directly from the badge or settings page
- Adjust refresh interval to balance update frequency and API call overhead
Who the dsh-balance DSH plugin is for
- DSH Web GUI users who need to monitor DeepSeek API account balance
- Developers using OpenCodeGo (opencode.ai Go plan) who want to track usage alongside DeepSeek balance
dsh-balance DSH plugin limitations
- Only supports DeepSeek account balance and OpenCodeGo plan usage; no other monitoring targets
- Requires self-provided API keys for both services (DeepSeek key mandatory; OpenCodeGo key optional, auto-reads from credentials)
- Depends on external network access to api.deepseek.com and opencode.ai
- Plugin is at early version (v0.3.0) and may have limited testing
- Browser cache may cause stale client-side updates; hard refresh may be needed
- OpenCodeGo usage requires an active Go plan subscription on opencode.ai
dsh-balance DSH plugin: from the repository README
Quoted from the linshule/dsh-balance README, the upstream source of the dsh-balance DSH plugin. Copyright remains with the original authors.
> DeepSeek API 账户余额 + OpenCodeGo(opencode.ai Go 计划)余量 · dsh web GUI 常驻插件 一个为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)Web GUI 打造的**双指标监控插件**: 左下角悬浮徽章同时显示 **DeepSeek 账户余额**(人民币/美元)与 **OpenCodeGo 计划余量**(近 5 小时 / 近 7 天 / 近 30 天三窗口),点击可展开详情、就地管理 Key,并支持自动刷新。  > 上图为示意渲染。实际徽章位于左侧边栏左下角、设置按钮上方,可拖拽。 --- ## 功能特性 ### 徽章(左下角悬浮,可拖拽) - **双段显示**:`DeepSeek 余量 ¥4.92 · Go 余量 100%` - **状态圆点**:🟢 可用 / 🟡 偏低(剩余 20–50%)/ 🔴 不可用或出错 / ⚪ 未配置 - **可拖拽**:按住拖动调整位置,松手记忆(浏览器 localStorage,默认 `left:12, bottom:110`) - **点击弹层**:DeepSeek 余量明细(总余额 / 充值 / 赠金、可用状态)+ OpenCodeGo 三窗口进度条(已用 % · 剩余 % · 重置时间)+ Key 内联保存 / 清除 + 立即刷新 ### 设置页(设置 → 两个独立分区) - **DeepSeek 余额**:API Key 管理(保存 / 清除)、自动刷新间隔(30 秒 / 1 分钟 / 5 分钟)、余额明细 - **OpenCodeGo 余量**:Key 管理(选填,留空自动读取 DSH 凭据)、三窗口余量明细与重置时间 ### 刷新策略 - 模块级轮询:插件存活期间始终按设定间隔刷新**余额 + 余量**(与哪个界面挂载无关) - 默认 1 分钟,可调;刷新间隔跨重启记忆 - 网络抖动自愈:curl 走 HTTP/1.1 + 自动重试(规避 Windows schannel 瞬时断连 exit 56) ### 安全 - 所有 `/api/ds-balance/*` 路由**仅回环地址(127.0.0.1 / localhost)可访问**,Key 绝不离开本机 - Key 以 `0600` 权限持久化在 `~/.dsh/ds-balance.json`(仅本机可读) - 设置页在线保存后重启不丢失 --- ## 安装 ### 方式一:从 GitHub 仓库安装(推荐) ```bash dsh plugin --profile web add github:linshule/
Read the full READMERepository license: MIT
dsh-balance DSH plugin questions
How do I configure the DeepSeek API key?
Click the badge in the bottom-left corner of the DSH Web GUI, then paste your DeepSeek API key (sk-...) in the inline field and save. Alternatively, go to Settings > DeepSeek Balance to manage the key. The key is persisted to ~/.dsh/ds-balance.json with 0600 permissions and will survive restarts.
Why does the badge show 'Not configured'?
This means neither DeepSeek nor OpenCodeGo API keys are configured. Click the badge to open the detail panel, then enter your DeepSeek key. For OpenCodeGo, the plugin automatically reads the key from DSH credentials (~/.dsh/.credentials.yaml) if the default provider is opencode-go; otherwise, you can set it manually in the settings page.
How do I change the refresh interval?
Open the settings page (Settings > DeepSeek Balance or OpenCodeGo Usage) and select a new interval from the dropdown: 30 seconds, 1 minute, or 5 minutes. The interval is saved in browser localStorage and persists across restarts.
What does the colored dot on the badge mean?
The dot indicates the overall status of both indicators. Green means >50% remaining for both, yellow means 20-50% remaining, red means <20% or rate-limited/error, and white means no key configured. The color is based on the lowest remaining percentage across all three OpenCodeGo windows and the DeepSeek balance.
Can I use this plugin without an OpenCodeGo subscription?
Yes. The plugin will still show the DeepSeek balance correctly. For OpenCodeGo, it will display an error or 'Not configured' if no key is provided or if the key lacks a Go plan. You can simply ignore the OpenCodeGo section if you don't use it.