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.

  1. Data Display: Reads projection data returned by the official session.list RPC and displays tokenUsage (input/output/cache read/cache write), contextPressure (pressure and window occupancy), and sessionStats (step count and duration).
  2. Reasoning Controls: Displays the current model and supported reasoning levels, and provides a drag bar to switch among the off, high, and max levels; internally calls the session.selectModel RPC.
  3. 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.
  4. Automatic Refresh: The panel automatically refreshes data every 4 seconds.
  5. 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).

  1. Copy the plugin directory to <DSH_HOME>/profiles/web/node_modules/dsh-client-ui-token-billing.
  2. Edit <DSH_HOME>/profiles/web/package.json and 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"
      ]
    }
  }
}
  1. Restart DeepSeek Harness Web.

Method 2: Install via cordis.patch.yml

  1. Copy the plugin directory to <DSH_HOME>/profiles/web/node_modules/dsh-client-ui-token-billing.
  2. Edit <DSH_HOME>/profiles/web/cordis.patch.yml:
- insert:
    - id: ui-token-billing
      name: 'dsh-client-ui-token-billing'
      config:
        enabled: true
  1. 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.