In the development workflow of DeepSeek Harness (DSH), managing routing and quota across multiple model providers is a common requirement. Checking account balances usually requires jumping to external platforms or calling APIs, lacking a direct monitoring entry point. The dsh-provider-billing plugin displays account balances inline in each provider row on the model settings page and provides refresh controls. Queries are performed through a loopback-pinned RPC channel, ensuring that API keys always remain on the host side.

Core Features

The plugin mainly implements the following capabilities:

  1. Inline display: Shows a line of balance information inline in each provider row on the model settings page.
  2. Manual refresh: Provides refresh controls for each route, allowing manual updates of balance data.
  3. Security: API keys never leave the host. The browser only sends the route ID, while the host is responsible for resolving endpoints and credentials from the configuration plane.
  4. Standard interface: Queries the provider’s OpenAI-compatible /user/balance endpoint.

Installation and Configuration

The plugin can be installed via npm, GitHub, or a local path. After installation, the providers to monitor must be specified in the configuration plane.

Installation

Install it using one of the following commands:

dsh plugin --profile web add dsh-provider-billing

Or install it via GitHub:

dsh plugin --profile web add github:ZeroingIn/dsh-provider-billing

Configuration

Add the plugin instance to the DSH configuration plane and specify the providers list to check:

- id: provider-billing
  name: dsh-provider-billing
  config:
    providers: [deepseek-official]

How It Works

The plugin consists of a host-side component and a browser-side component:

  • Host side: Registers a loopback-pinned RPC channel (/provider-billing) that provides list and query endpoints. It resolves the route’s endpoint and credentials from the configuration plane, then sends requests to the provider’s /user/balance endpoint.
  • Browser side: Injects content into the settings.models.row slot on the model settings page and renders a balance card (supports Chinese and English display). If the current Harness build does not support this slot, the plugin explicitly reports a loading failure.

Notes

  • Version requirement: The plugin depends on the Harness settings.models.row slot, so a relatively new Harness build is required. Older versions are not supported and will report errors directly.
  • Build artifacts: The npm-published tarball does not include the lib/types directory by default (unless pnpm build is executed on the release machine), but this does not affect runtime functionality.
  • API compatibility: The plugin calls the /user/balance endpoint and is compatible only with the official DeepSeek API specification. Other custom endpoints will return error messages.

Summary

dsh-provider-billing simplifies quota monitoring for multi-provider routing by providing intuitive balance display and refresh controls on the model settings page. All sensitive operations are performed on the host side, resulting in higher security. The plugin was developed by community maintainer ZeroingIn and follows the MIT license.