When developing agents in the DeepSeek Harness (DSH) web interface with OpenCodex as the underlying provider, developers often need to check API quotas, rate limits, and cost statistics frequently. Constantly switching tabs or opening a terminal in the chat window reduces development efficiency and interrupts flow. The dsh-opencodex-usage plugin aims to solve this pain point by providing a persistent on-screen floating monitoring component that turns complex API data into an intuitive card view.
Plugin Positioning¶
This is a DSH client plugin maintained by Walvez, used to display OpenCodex usage data in the DeepSeek Harness web interface. By reading local OpenCodex endpoints and configuration files, it consolidates multi-provider rate limits, remaining quotas, and cost statistics into a freely draggable floating card, allowing the latest status to be viewed without manually refreshing the page.
Core Features¶
1. Free Dragging and Position Memory¶
The plugin generates a floating capsule on the main chat interface. Users can hold the capsule and drag it anywhere on the screen; after release, its position is automatically saved in the browser’s localStorage. Even after refreshing the page or restarting the service, the capsule reappears where it last was. The plugin includes mistouch prevention logic that distinguishes minor movement (a click that opens the panel) from deliberate dragging.
2. Comprehensive Rate and Quota Monitoring for Five Providers¶
The plugin connects directly to official OpenCodex endpoints to retrieve data. Supported providers include OpenCode Go, Google Antigravity, OpenAI (Codex login), xAI Grok, and DeepSeek. For each provider, the plugin displays different key metrics, such as OpenCode Go’s 5-hour rolling limit, Google Antigravity’s Gem/Cla usage percentage, OpenAI’s account pool capacity recovery hints, and DeepSeek’s real-time API balance.
3. Usage and Cost Statistics¶
The plugin offers both 7-day and 30-day reporting periods. The panel displays total requests, total tokens, cache hit rate, and estimated costs based on API data. It also lists the currently most active models in a leaderboard, helping developers quickly understand resource consumption.
4. Zero-Configuration Auto-Detection¶
The plugin does not require manual configuration of the OpenCodex runtime port or authentication token. It automatically reads ~/.opencodex/runtime-port. to obtain the dynamic port and reads ~/.opencodex/admin-api-token to complete authentication. It also adapts to DSH design tokens and automatically supports dark, light, and custom theme skins.
Installation and Enablement¶
- Clone the repository
cd ~/.dsh/profiles/web/plugins
git clone https://github.com/Walvez/dsh-opencodex-usage.git
- Modify the configuration file
Open~/.dsh/profiles/web/package.json, add the plugin dependency todependencies, and add the plugin name todsh.profile.bundles.
{
"dependencies": {
"dsh-opencodex-usage": "link:plugins/dsh-opencodex-usage"
},
"dsh": {
"profile": {
"bundles": [
"dsh-opencodex-usage"
]
}
}
}
- Restart the service
After installation, you must restart thedsh webservice for the plugin to take effect.
Typical Usage¶
After installing and restarting the service, a floating capsule will appear on the main DSH chat interface. Clicking the capsule expands the monitoring panel, and dragging it changes its position on the screen. The top of the panel provides 7-day and 30-day toggle buttons for viewing usage and cost statistics over different time periods.
Use Cases and Notes¶
This plugin runs with the privileges of the DSH process and therefore depends on a locally installed and running OpenCodex service. Ensure that the OpenCodex runtime port (default 10100) and authentication token are configured correctly. In addition, the plugin is licensed under the MIT License; please review the source code and license terms yourself before use.
For developers who need to frequently manage OpenCodex resources in DSH, dsh-opencodex-usage provides an intuitive and low-disruption monitoring solution. It converts complex API data into a visual floating card, reducing the need to shift attention back and forth between windows and terminals.
Plugin catalog: https://www.skillhub.cn/plugins/Walvez/dsh-opencodex-usage
Source code: https://github.com/Walvez/dsh-opencodex-usage