Preface¶
DeepSeek Harness (DSH) adopts a plugin-based architecture. When managing multiple API Keys or coding plans, quickly checking the remaining quota of each channel is a common need. The dsh-balance-inquiry plugin provides a balance dashboard at the bottom of DSH’s left sidebar, supporting native interfaces, coding plans (Token Plan), and custom script adaptations.
Installation and Activation¶
After installing the plugin, you must restart the DSH desktop app or dsh web to load the configuration.
dsh plugin --profile desktop add dsh-balance-inquiry
After restarting, a balance row appears at the bottom of the sidebar.
Core Features¶
Native Balance Interfaces¶
Supports directly querying balance data from multiple vendors.
* Pay-as-you-go: New API / One API, DeepSeek, StepFun, SiliconFlow (Domestic / International), OpenRouter, Novita AI.
* Coding Plans (Token Plan / Coding Plan): Supports 8 vendors, querying used and remaining percentages for each time window (5 hours / week / month).
Custom Scripts¶
For sites that do not directly support native interfaces, adaptation can be done via custom scripts.
Scripts allow the use of placeholders such as {{baseUrl}}, {{apiKey}}, {{accessToken}}, {{userId}}. The extractor function must return an object or array containing fields like planName, remaining, used, total, unit, isValid. Scripts are restricted to HTTPS only (except for localhost).
Sidebar Dashboard¶
The sidebar displays the most urgent item (lowest quota or matching the current provider) among all plans by default.
* View Details: Left-click the balance row to open the dashboard detail page, displaying cards for all plans (name, balance, time).
* Go to Official Site: Left-click a card in the dashboard to open the official website address bound to that plan.
Fault Tolerance and Integration¶
- Request Method: By default, requests are issued by the DSH host process, avoiding browser cross-origin restrictions. If the host channel is unavailable, it automatically falls back to direct browser connection.
- Transient Failures: In case of network errors or timeouts, the last successful value is retained for 10 minutes to prevent balance display flickering.
- Provider Linkage: After binding a Provider ID, when switching models in DSH, the sidebar automatically displays the corresponding provider’s plan balance.
Configuration and Usage¶
Adding Plans¶
Enter Settings → Balance Inquiry. The plugin does not preset any sites; they must be added manually.
1. Click “Add Plan”.
2. Select “Pay-as-you-go (API Key)” or “Token Plan / Coding Plan”.
3. Select the vendor (e.g., New API, DeepSeek, etc.).
4. Fill in the necessary parameters (Interface URL, Token, User ID, etc.).
5. Optional configuration: Official site URL, Provider ID (for model switching linkage), Quota conversion ratio (New API only).
New API Configuration Key Points¶
- Token: Must use the console “System Access Token”, not an API Key.
- Conversion Ratio: Defaults to 500000 (i.e., 1¥ = 500000 quota). Plans billed by points/credits do not display this field.
- Interface URL: Defaults to
GET {baseUrl}/api/user/self.
Coding Plan Configuration Key Points¶
- Endpoints: Each vendor has specific endpoints (e.g., Kimi, Zhipu GLM, MiniMax, etc.).
- Timeout: Coding plan request timeout is uniformly set to 15 seconds.
- Display: Only displays percentages; turns yellow when remaining is less than 10%.
- Volcano Ark (火山方舟): Queries Agent Plan first; if no active subscription, falls back to querying Coding Plan.
Notes¶
- Script Security: Custom scripts are restricted to HTTPS only (except for
localhost). - Color Feedback: Balance turns red only when it is 0; Coding plans only display percentages and do not provide a yellow warning for less than 10% remaining.
- Restart Dependency: Configuration changes require a restart of DSH to take effect.
Summary¶
This plugin quickly displays multi-channel balances through the sidebar, supports native interfaces and custom scripts, and solves cross-domain issues via host process requests. It is suitable for developers managing multiple API Keys or coding plans.
- GitHub: https://github.com/Deanyu148/dsh-balance-inquiry
- SkillHub Directory: https://www.skillhub.cn/plugins/Deanyu148/dsh-balance-inquiry