Introduction¶
It is a common configuration in DeepSeek Harness (dsh) to mount multiple provider routes simultaneously: the DeepSeek official API running the main workload, OpenRouter as a supplement, and a third route using OpenAI Codex via ChatGPT subscription. The problem that follows is that the balance, usage, and subscription windows of each provider are scattered across their respective consoles. To know if a session will run out of quota mid-way, you have to log in to the backends one by one.
dsh-provider-usage condenses this into a floating button on the Web GUI. The following sections introduce this plugin in the order of features, installation, typical usage, and notes.
What is this¶
dsh-provider-usage is a DeepSeek Harness plugin maintained by lizhouai. The npm package name is dsh-provider-usage, current version is 0.3.12, license is MIT, and it is categorized as a “Client” in the community directory.
What it does: It enumerates the provider routes registered in the current profile (ctx.llm), adapts the balance/usage/subscription window query interfaces for each provider based on kind, and displays the results centrally in a draggable floating panel on the Web GUI; for routes without public balance interfaces, it also marks them explicitly rather than silently skipping them.
Core Features¶
Auto-detecting Routers¶
The plugin enumerates provider routes registered in ctx.llm. It is known for zero-configuration routing: as long as a route is registered in the profile, a corresponding entry will appear in the panel.
Kind-based Query Adaptation¶
Each kind corresponds to different query endpoints and display content, as shown below (from README):
| kind | Route | Query | Display |
|---|---|---|---|
deepseek |
deepseek-official、deepseek |
GET {baseURL}/user/balance |
total / granted / topped-up balance |
moonshot |
moonshotai-cn、moonshotai |
GET {baseURL}/users/me/balance |
Available / Voucher / Cash balance |
kimi-coding |
kimi-coding |
GET {baseURL}/v1/usages |
Weekly usage + rate limit window + reset countdown |
openrouter |
openrouter |
GET {origin}/api/v1/credits |
credits used / total credit |
github-copilot |
github-copilot |
GET api.github.com/copilot_internal/user |
Paid plan usage snapshot / Free plan monthly usage |
openai-codex |
openai-codex |
GET {baseURL}/wham/usage |
ChatGPT subscription 5h / weekly window + credits + spend control (OAuth login, not API key) |
openai |
openai |
GET {origin}/v1/organization/costs |
Monthly spending (requires admin key, regular key returns 403) |
anthropic |
anthropic |
GET {baseURL}/v1/organizations/cost_report |
Monthly spending (requires admin key, x-api-key authentication) |
minimax |
minimax、minimax-cn |
GET {origin}/v1/api/openplatform/coding_plan/remains |
Coding Plan 5h / weekly remaining percentage |
zai |
zai、zai-coding-cn |
GET {origin}/api/monitor/usage/quota/limit |
GLM Coding Plan window (original key passed directly in Authorization, no Bearer) |
opencode |
opencode、opencode-go |
GET {baseURL}/usage |
Zen Go rolling / weekly / monthly window |
vercel-ai-gateway |
vercel-ai-gateway |
GET {baseURL}/v1/credits |
Team credit balance |
xai |
xai |
GET {baseURL}/billing/credits |
Prepaid balance (USD) |
Routes without public balance/usage APIs (Google, Mistral, Groq, Bedrock, Azure, Qwen Token Plan, etc.) will be listed with an unsupported marker, letting you know which ones cannot be queried rather than silently disappearing.
Credentials not cached or stored on disk¶
API keys are parsed by the harness credentials service on every request (from environment variables or ~/.dsh/.credentials.yaml). The plugin does not cache or write to disk. OAuth-type providers (OpenAI Codex) read the authorization records written by the login process and transparently refresh the token when it is about to expire.
Floating Button and Panel¶
- The floating button can be dragged to any position in the viewport; the position is persisted. It defaults to the bottom-left corner of the chat area (equal margins), and the home button in the panel header can return it to the default position with one click.
- The top edge of the panel can be dragged to adjust the height; the height is persisted; the provider list is scrollable if it exceeds the panel height.
- The halo reflects the health status of the provider currently being used by the focused session in real-time: Green means normal; Yellow indicates that the usage window has less than 30% remaining, or the balance is below the yellow threshold; Red indicates query failure, missing key, usage >= 90%, or balance below the red threshold. The halo only follows the one that is “currently in use”: idle providers with insufficient balance won’t color the ball, and switching to a provider with sufficient balance will turn the ball green immediately. The panel will label the provider in use while listing all numbers.
- The current running plugin version number is displayed next to the panel header title, making it clear which release is loaded.
- Bilingual (Chinese/English), follows the harness language by default, can be switched in the panel header with one click, and the choice is persisted in localStorage.
Adjustable Parameters¶
- Refresh interval: 15s–30min, adjustable in the panel, persisted in localStorage, default value comes from plugin configuration.
- Balance thresholds: Red/Yellow levels are edited and persisted at the bottom of the panel, comparing based on the currency of the balance itself (CNY or USD are handled the same). Defaults are Red < 10, Yellow < 30. Applicable to balance-type providers (DeepSeek, Moonshot, Vercel AI Gateway, xAI) and credits rows of usage-type providers (OpenRouter, OpenAI Codex). When subscription plans and credits coexist (e.g., OpenAI Codex), OR logic is used: if either has remaining quota, it stays green; if both are low, a lighter warning is shown—plans usually get consumed before credits.
- Manual provider: Any gateway can be added via configuration, e.g., a self-hosted DeepSeek-compatible endpoint.
Installation and Usage¶
The reference material for this article does not include the official installation command, so I will not concatenate it here. Two points of information that can be confirmed are:
- The package has been published to npm, package name
dsh-provider-usage, current version 0.3.12; - Node engine requirement is
^22.19.0 || >=24(from theenginesfield in package.json).
For specific installation steps, refer to the GitHub README: https://github.com/lizhouai/dsh-provider-usage
Typical Usage: Querying Subscription Usage via OAuth for OpenAI Codex¶
OpenAI Codex is a ChatGPT subscription-based provider, authenticated via OAuth access token rather than an API key, so there is no key to fill in. dsh itself does not provide an OAuth login button for this route, but the plugin can directly read the authorization records in the harness credential store. The full steps are as follows.
- First, make the route appear in
ctx.llm. The web profile mounts the llm-pi-ai adapter by default; an empty profile is sufficient. Add the following to~/.dsh/settings.yaml:
llm-pi-ai:
providers:
openai-codex: {}
- Complete OAuth login via the harness authorization seam. dsh-llm-pi-ai registers an “OpenAI (ChatGPT Plus/Pro)” process for
openai-codexonctx.authorization(credential keyllm-pi-ai/openai-codex). Use a ChatGPT account to complete browser or device code authorization via any entry point where this process can run. The authorization record is subsequently written to~/.dsh/.credentials.yaml:
records:
llm-pi-ai/openai-codex:
kind: grant
payload:
type: oauth
access: <access token>
refresh: <refresh token>
expires: <epoch ms>
accountId: <chatgpt account id>
- After the above steps, no additional operations are needed. The
openai-codexroute will be automatically detected. The plugin re-reads the authorization record from the credential store on every poll (without caching) and automatically refreshes the token when it is about to expire. The panel displays the 5h / weekly usage window.
A common pitfall: The authorization record must reside in the harness credential store. Self-managed credential files like dsh-codex’s $DSH_HOME/.openai-codex-auth.json or Codex CLI’s ~/.codex/auth.json do not write to this record, so the plugin cannot see them.
Use Cases and Notes¶
Who is it for:
- DSH users who configure multiple provider routes simultaneously and mix metered billing with subscription plans;
- Users using subscription-based quotas (Kimi Coding, MiniMax Coding Plan, GLM Coding Plan, OpenAI Codex, etc.) who want to be aware in advance before windows run out;
- Situations where you want to attach balance display to a self-hosted DeepSeek-compatible gateway (manual provider).
Notes:
- Monthly spending queries for OpenAI and Anthropic require an admin key (regular keys return 403) (Anthropic uses
x-api-keyauthentication); - Queries for the zai route require the original key to be placed directly in the Authorization header, without ‘Bearer’;
- Floating button position/height, refresh interval, balance thresholds, and panel language are all persisted in localStorage, with default values coming from the plugin configuration;
- The plugin runs with the permissions of the current dsh process, can read keys and OAuth authorization records from the harness credential store, and calls the balance interfaces of each provider on your behalf. It is recommended to browse the source code before installation to confirm the behavior meets expectations, and to verify the license (this project is MIT).
Conclusion¶
dsh-provider-usage solves a small but specific problem: no longer needing to log in to various consoles to check “how much quota is left.” If you maintain more than one provider route in DSH, it will save you a lot of round trips.
- Community Directory Page: https://www.skillhub.cn/plugins/lizhouai/dsh-provider-usage
- GitHub: https://github.com/lizhouai/dsh-provider-usage
Note: skillhub.cn is a community-maintained plugin directory and has no official affiliation with DeepSeek / Fanghuang.