DeepSeek Harness (DSH) has a core design philosophy of “everything is a plugin,” enhancing the Web UI’s functionality through extension components. dsh-client-ui-token-billing is a client plugin that injects a floating panel to display Token usage, context pressure, reasoning-level controls, and cost estimates directly in the DeepSeek Harness Web UI. It does not modify model input or read API keys, and it runs entirely in the browser.
Features¶
This plugin primarily addresses the problem that developers cannot intuitively monitor Token consumption, context pressure, and real-time costs when using DSH for agent development.
- Data Display: Reads projection data returned by the official
session.listRPC and displaystokenUsage(input/output/cache read/cache write),contextPressure(pressure and window occupancy), andsessionStats(step count and duration). - Reasoning Controls: Displays the current model and supported reasoning levels, and provides a drag bar to switch among the
off,high, andmaxlevels; internally calls thesession.selectModelRPC. - Cost Estimation: The host side fetches DeepSeek’s official pricing page and provides a same-origin route for the browser to read. It supports automatic peak/off-peak price switching (peak: 9:00-12:00 / 14:00-18:00) and allows manual price overrides.
- Automatic Refresh: The panel automatically refreshes data every 4 seconds.
- Security: Purely browser-side display; it does not read API keys or modify model input.
Installation and Enablement¶
This plugin is a standard dsh.client bundle and must be resolvable from the profile’s ctx.baseUrl (usually located in the profile’s own node_modules directory).
Method 1: Install as a profile bundle (recommended)¶
- Copy the plugin directory to
<DSH_HOME>/profiles/web/node_modules/dsh-client-ui-token-billing. - Edit
<DSH_HOME>/profiles/web/package.jsonand add the dependency:
{
"dependencies": {
"dsh-client-ui-token-billing": "github:LucasleeCN/dsh-token-api"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"dsh-client-ui-token-billing"
]
}
}
}
- Restart DeepSeek Harness Web.
Method 2: Install via cordis.patch.yml¶
- Copy the plugin directory to
<DSH_HOME>/profiles/web/node_modules/dsh-client-ui-token-billing. - Edit
<DSH_HOME>/profiles/web/cordis.patch.yml:
- insert:
- id: ui-token-billing
name: 'dsh-client-ui-token-billing'
config:
enabled: true
- Restart DeepSeek Harness Web.
Usage¶
After installation and restart, a Token pill button appears in the bottom-right corner of DeepSeek Harness Web. Click the button to expand the panel and view the current session’s usage and cost estimate.
Verifying the Data Source¶
You can also call the RPC directly to verify whether the data source is available:
POST /api/session.list
Content-Type: application/json
{
"type": "client-request",
"rpcId": "manual-check",
"method": "session.list",
"payload": {}
}
items[].projections.values.tokenUsage in the returned data is the raw data displayed by this plugin.
Price Configuration¶
The host side re-fetches the official pricing page every 30 minutes. The top-right corner of the panel displays the current pricing period (current / peak / off-peak / manual). Click the ⚙ icon in the top-right corner to manually override the price of an individual model. Overridden prices are saved in the browser’s localStorage (key: dsh-client-ui-token-billing.prices.v1).
Use Cases¶
This plugin is suitable for DSH users who need to monitor Token consumption and context window pressure in real time during development and want to precisely control reasoning levels and costs.
Notes:
* Check the source code and license (MIT) before installing the plugin.
* The plugin runs with the permissions of the current DSH process; ensure that the profile’s ctx.baseUrl can correctly resolve the plugin directory.