Introduction¶
DeepSeek Harness (DSH) provides a web interface for agent development. During use, developers often need to monitor DeepSeek API balance, Kimi For Coding plan quota (including weekly limit and 5-hour window), and ChatGPT (Codex) subscription rate limits at the same time. The dsh-quota-status plugin aggregates this information in a minimal card, providing balance status, progress bars, reset countdowns, and peak and off-peak electricity price reminders, and solves the problem of scattered checks across multiple windows.
Plugin Overview¶
Name: dsh-quota-status
Maintainer: ruby1304
Category: Networking tool
License: MIT
This is a DeepSeek Harness (DSH) web plugin. It displays DeepSeek API balance, Kimi For Coding plan quota (weekly limit + 5-hour rolling window), and ChatGPT (Codex) subscription rate limit windows in real time within a minimal card. The card includes remaining quota values, progress bars, reset countdowns, and provides price reminders for DeepSeek peak and off-peak time periods.
Core Features¶
The plugin has the following features:
- Works out of the box: By default, it reads environment variables
DEEPSEEK_API_KEYandKIMI_CODING_API_KEY. Credentials are passed through the dsh credentials seam, and keys never enter the browser. - Minimal card: Fixed width of 260px. Each account is one line (status dot + name + value), and the width remains unchanged when details are expanded. The card supports a hover lift shadow effect.
- Balance-based coloring: Automatically colors based on the DeepSeek balance value. Green ≥100, yellow 20–99, red 1–19, gray <1.
- Peak and off-peak reminders: Embeds time-period badges inline (such as peak hours). Expanding the details shows the current period and the countdown until the period switches, refreshed every second in sync with the system clock.
- Click interaction: Clicking a row expands the account details in place (DeepSeek top-up/gift breakdown; Kimi per-window progress bars, remaining amounts, and reset countdowns). Click again to collapse.
- Countdown display: When a Kimi or ChatGPT window is exhausted (0%) and the server provides a reset time, a real-time countdown is appended directly in the collapsed state; non-exhausted windows retain the percentage format.
- Draggable: Press and hold an empty area of the card to drag it to any position. The position is remembered locally in the browser.
- Automatic refresh: Refreshes once every 60 seconds by default. It pauses while the page is hidden and immediately refreshes when it returns to the foreground.
- Bilingual support: Follows the interface language and automatically adapts to light and dark themes.
- Loopback RPC only: The RPC channel is only accessible via loopback (
authority: loopback), ensuring data security. - Plugin configuration card: In DSH’s “Settings → Plugins → Plugin Configuration”, you can directly check the status of the three account types and handle ChatGPT OAuth login here.
Installation and Enablement¶
Installing the plugin requires the DeepSeek Harness CLI.
dsh plugin --profile web add dsh-quota-status
dsh web
After installation, dsh-quota-status is automatically inserted as a bundle via cordis.patch.yml as the quota-status line.
Typical Usage¶
After the default installation, it can be used without configuration. If you need to adjust the refresh frequency, color thresholds, or add ChatGPT monitoring, you must override the configuration in ~/.dsh/profiles/web/cordis.patch.yml.
Configuration Example¶
Override the quota-status node line by line in the configuration file:
- id: quota-status
config:
refreshMs: 30000 # 默认 60000,刷新间隔毫秒
timeoutMs: 15000 # 上游查询超时
warnBalance: 30 # DeepSeek 余额低于 30 变黄
criticalBalance: 10 # 低于 10 变红
warnUsagePercent: 40 # Kimi 余量低于 40% 变黄
criticalUsagePercent: 15 # 低于 15% 变红
codexBinary: cliproxyapi # 设置页「登录 ChatGPT」调用的程序
codexConfigPath: ~/.cli-proxy-api/config.yaml
providers:
- id: deepseek
label: DeepSeek
kind: deepseek-balance
credential: DEEPSEEK_API_KEY
endpoint: https://api.deepseek.com/user/balance
- id: kimi-coding
label: Kimi Coding
kind: kimi-usage
credential: KIMI_CODING_API_KEY
endpoint: https://api.kimi.com/coding/v1/usages
# ChatGPT 订阅(可选,需本地 CLIProxyAPI 网关已登录 codex):
- id: codex-sub
label: ChatGPT
kind: codex-usage
credential: '' # codex-usage 无需 env 凭证
endpoint: https://chatgpt.com/backend-api/wham/usage
authDir: ~/.cli-proxy-api # codex-*.json 所在目录
Data Source Notes¶
- DeepSeek:
GET https://api.deepseek.com/user/balance(available balance, no reset time). - Kimi For Coding:
GET https://api.kimi.com/coding/v1/usages(plan weekly limit + per-window details). - ChatGPT (Codex):
GET https://chatgpt.com/backend-api/wham/usage(subscription rate limit windows; credentials come from CLIProxyAPI local auth files).
Applicable Scenarios and Notes¶
This plugin is suitable for developers who need to frequently monitor API balances and subscription rate limits. Before installing, ensure that the DeepSeek Harness profile is correctly configured.
Security Mechanisms:
* API keys are only resolved in the host process; they are not written to responses, logs, or the browser.
* Codex subscription OAuth tokens are only read from CLIProxyAPI local auth files in the host process.
* The RPC channel is only accessible via loopback.
Development and Maintenance:
If you want to contribute to development, you can run the following commands:
npm install
npm run typecheck
npm test
npm run build
Conclusion¶
dsh-quota-status aggregates key quota information from DeepSeek, Kimi, and ChatGPT through a minimal card view and automatic refresh mechanism. It follows DeepSeek Harness’s “everything is a plugin” philosophy, uses loopback RPC to ensure key security, and is suitable as a standard development-environment component.