DSH provides plugin extension capabilities. During agent development or debugging, the remaining quota of a DeepSeek account needs to be monitored in real time. The dsh-balance plugin embeds balance information directly in the input box toolbar (next to the model selector), so it can be viewed without switching pages.
Plugin Description¶
- Project Name:
wyxcn445/dsh-balance - Maintainer: Wyxcn445
- License: MIT
Core Features¶
- Balance Capsule: Displays the main wallet balance (preferring RMB) in the input box toolbar, with a status color dot.
- Details Panel: Click the capsule to expand a panel where you can view top-up balances (by currency), granted credits, usage details, a top-up entry, and the last updated time.
- Auto Refresh: Auto-refreshes every 20 seconds; refreshes immediately when the tab becomes visible again; force-refreshes when the panel is opened.
- Graceful Degradation: When not logged in, the service is missing, or the query fails, it displays a readable message without causing input box errors.
Data Source and Security¶
- Request Path Design: The browser does not directly access platform APIs. Account credentials are visible only on the host side.
- Request Routing: Data is retrieved via the read-only route
GET /api/dsh-balanceregistered on the host side. - Access Restrictions: The route accepts requests only from loopback addresses (127.0.0.1 / ::1).
- Authentication Mechanism: This route does not use DSH token authentication and relies only on loopback restrictions.
- Performance Notes: Balance queries are external network requests and may incur a brief delay on first load.
Prerequisites¶
This plugin reads account data from the DSH built-in deepseekAccount service.
A DeepSeek account (platform session) must already be logged in to DSH. If you only configured
DEEPSEEK_API_KEYbut have not logged in to an account in DSH, the capsule will display “Balance not logged in”.
Installation and Enablement¶
dsh plugin --profile <你的profile名> add github:Wyxcn445/dsh-balance
After installation, refresh the browser page to see the balance capsule.
Usage¶
- No Configuration Required: The endpoint is read-only and requires no configuration.
- View Balance: After refreshing the page, view the balance capsule in the input box toolbar (next to the model selector).
- View Details: Click the capsule to expand the panel and view detailed top-up, granted credit, and usage information.
Notes¶
- Credential Security: The browser does not directly access platform APIs; credentials are visible only on the host side.
- Network Requests: Balance queries are external network requests and may incur a brief delay on first load.
- Access Scope: Requests are accepted only from loopback addresses (127.0.0.1 / ::1).
- Authentication Method: This route does not use DSH token authentication and relies only on loopback restrictions.