DeepSeek Harness (DSH) uses a plugin-based architecture, allowing users to extend functionality in the Web UI. When developing or debugging with proxies such as CLIProxyAPI (CPA), it is not always intuitive to view the remaining quota for the current model or account. The dsh-client-ui-cpa-quota plugin addresses this pain point by providing a visual ring next to the model selector.
Plugin Introduction¶
- Name: dsh-client-ui-cpa-quota
- Owner: wkscc310
- Category: Network Tools
- License: MIT
Core Features¶
The plugin runs client-side in the browser and uses the DSH provider configuration to automatically discover models and endpoint addresses, eliminating the need to maintain an additional model list.
- Auto-Discovery and Identification: Reads the
modelsandbaseURLvalues from DSH providers. The plugin fingerprints eachbaseURLto confirm it is CLIProxyAPI, avoiding empty rings on generic OpenAI-compatible endpoints. - Multi-Instance and Account Support: Supports multiple CLIProxyAPI instances and accounts. Hover tooltips are filtered by the selected model, while the settings panel always displays quotas for all accounts.
- Quota Window Logic: Quota windows are ordered by 5 hours → week → month → day, and the ring display prioritizes the first available window.
- Upstream Query: Supports querying quotas for Codex, Claude, Antigravity, Gemini CLI, Kimi, and xAI/Grok via upstream quota APIs. For other CPA providers, the plugin still displays account status and recent activity.
- In-Use Detection: The plugin builds a local 7-day ledger from CPA’s per-request usage queue. During refresh cycles, the hover tooltip shows the accounts actually serving the selected model, sorted by last use and marked with in-use indicators and request/token count statistics. Other accounts are collapsed into “Other accounts”.
- Stability and Fault Tolerance: Account probes run in a bounded pool with per-request timeouts, preventing a single upstream hang from blocking the entire refresh cycle. The plugin retains the last successful snapshot before a refresh failure and reuses the ring when the DSH screen remounts.
- Visual Feedback: The quota color changes based on remaining amount: green (≥20%), amber (<20%), red (exhausted/error), and gray (loading or missing admin key).
Installation and Enablement¶
Install and activate the plugin using the official command-line tool:
dsh plugin --profile web add dsh-client-ui-cpa-quota
After installation, restart the DSH Web host and then open the following in the interface:
* Settings → Plugins → CliProxyAPI Quota.
In the expanded settings card, paste the admin key for each instance.
Configuration and Notes¶
- Key Storage: Keys entered in the settings card are stored in the current browser’s
localStorage. If the admin key is managed via YAML, it is stored in the YAML file. Browser settings card entries override YAML configuration. - Refresh Interval:
refreshMinutesis capped at a minimum of one minute. - Security: Never commit admin keys to public repositories.
Dependencies and Limitations¶
- DSH Version: The plugin requires the DSH Web profile that matches the current plugin contract (verified versions: 0.1.1-rc.2, 0.1.2-rc.1, 0.1.5-rc.2, 0.1.6-alpha.1).
- Network Dependency: Requires an accessible CLIProxyAPI instance with its admin API enabled.
- Registration Scope: This plugin registers only in the Web UI.
Summary¶
dsh-client-ui-cpa-quota provides a lightweight quota monitoring solution for the DSH Web UI. It is suitable for users who need to manage multiple CLIProxyAPI instances and accounts simultaneously, helping them quickly identify currently available resources.