When developing with DeepSeek Harness (DSH), you often need to check the current model’s balance or quota. Manually switching to the provider’s official website is cumbersome and disrupts your flow. The dsh-model-balance plugin is designed to solve this problem: it displays the balance or quota directly in the DSH composer input row, without requiring you to leave the current page.
It is a plugin maintained by jacujay. It automatically identifies the current model provider and shows a balance/quota button to the left of the input row. It supports multiple mainstream providers and provides a settings page for custom endpoints.
Core Features¶
- Automatic provider detection: Reads the provider id or baseURL hostname in the DSH configuration to identify the provider, even when a custom provider id is used.
- Multi-provider support: Built-in support for DeepSeek, Moonshot/Kimi, MiniMax, StepFun, Zhipu (quota only), SiliconFlow, and OpenRouter.
- Input row interaction: Displays an icon before the model name; hover to view details; click to refresh.
- Host-side key security: The API Key is handled by the local DSH host and does not enter the browser, ensuring privacy and security.
- Custom endpoints: Supports configuring a custom query URL for providers that do not expose a public balance API.
Installation and Activation¶
- Make sure DSH Web is installed.
- Run the following command to install the plugin:
dsh plugin --profile web add github:jacujay/dsh-model-balance
- After installation, refresh the browser page for it to take effect.
Typical Usage¶
Basic Usage¶
An ◈ icon appears to the left of the model name in the DSH composer input row. Hover over it to view the current balance or quota, and click it to refresh the data.
Configuring a New API-Compatible Proxy¶
If you use a New API relay service, you can add a custom endpoint in the plugin settings to recognize its returned token_usage.
Go to Settings → Balance lookup and configure the following parameters for the corresponding DSH provider (usually openai):
- URL:
https://your-relay.example.com/api/usage/token - Response path:
data.total_available - Authentication:
Bearer Token - Display name: Optional
The plugin automatically recognizes the token_usage response format of New API. If the response contains unlimited_quota: true, it displays unlimited quota; otherwise, it displays the remaining quota, total granted quota, and used amount.
Application Scenarios and Notes¶
- Application scenarios: Suitable for users who do daily development and debugging with DSH Web and need to check resource usage frequently.
- Security mechanism: All balance lookup requests are initiated by the local DSH host using credentials in DSH. The API Key is not sent to the browser or any third-party server.
- Privacy notes: The plugin settings file stores only endpoint metadata (
~/.dsh/dsh-model-balance.json) and does not contain any secrets. Custom endpoint URLs are provided by the user, so ensure they point to trusted addresses. - License: The plugin is open-sourced under the MIT License. It is recommended to review the source code before installation.
Summary¶
With this plugin, you can integrate balance lookups into your development workflow and reduce context switching. The project is available on GitHub.