dsh-quota-inline: Balance and Usage Window Readings in DeepSeek Harness

Introduction

The composer toolbar of DeepSeek Harness (DSH) reserves a small amount of space to the left of the model selector. The dsh-quota-inline plugin turns that space into a compact quota readout: it displays the current model’s balance or the remaining percentage of a subscription window. It doesn’t occupy a panel or popup—instead, it sits right next to the model selector, with hover and click interactions to reveal more information.

What It Is

A client-side plugin maintained by pidongqianqian. It reads the balance or usage window of the current session’s model and displays one of those readouts directly in the composer toolbar. The readout follows model switching: selecting deepseek-account shows the account wallet, selecting deepseek-official shows the balance for that API key, and pointing at a relay that supports weekly or monthly quotas shows the remaining percentage of the tightest window.

Core Features

  • Compact display: 12px text, 28px click area, borrowing the ghost chrome style from the model chip. No strip or panel is used.
  • Follows the model: The readout content changes with the model selected in the current session. The same provider may display different quota sources (wallet, API key balance, or a usage window) depending on the model.
  • Hover to view all: Hovering over or keyboard-focusing the readout shows a tooltip listing all balances, all windows, and the last update time.
  • Click to switch readout: Clicking the readout opens a small menu where you can choose auto (switches based on settings), balance, a specific window, or “balance + percentage.” Each provider’s preference is saved in the settings file and automatically restored after switching models.
  • Read-only local credentials: Keys are resolved in the Host process via DSH’s credentials service and are only referenced as read-only. The browser side receives only labels, amounts, currency, and percentages—nothing is written to logs or sent back to the browser.
  • Percentage display: Supports declaring used/limit path pairs via templates. When “Quota Display” is set to left, the remaining percentage (100 − used) is shown.
  • Fault tolerance: On a refresh failure, the readout for the same provider dims rather than displaying another provider’s data or disappearing. The “Test” button on the settings page can diagnose issues.

Installation and Enabling

Install with the following command:

dsh plugin --profile desktop add dsh-quota-inline

After installation, restart DeepSeek Harness (or reload the window) so that both the Host-side and client-side packages are fully loaded. This plugin requires DeepSeek Harness 0.2.2-rc.3 or later.

Settings

Open Settings → Quota badge:

  1. Refresh interval: The interval (in seconds, 10–3600) between refreshes while idle. Switching models or clicking the readout triggers an immediate refresh.
  2. Quota display: Usage windows display as left (default) or used. Balance is unaffected. The readout itself is chosen by clicking the readout: auto, balance, a specific window, or balance+percentage. This choice is saved per provider in the settings file.
  3. Custom providers: Collapsed by default; expand to edit name, URL, credential reference, balance path, and windows (one per line: label | usedPath | limitPath). Provider id, auth method, currency path, and timeout are under “Advanced.” Click “Test” to issue a real request from the Host and display the extracted values.

The settings file is located at $DSH_HOME/dsh-quota-inline/settings.json (defaults to ~/.dsh/dsh-quota-inline/settings.json).

Built-in Queries

Provider id Reads Endpoint
deepseek-account Wallet balance + credits DSH account service (OAuth)
deepseek-official (and deepseek-*) API key balance GET https://api.deepseek.com/user/balance

Custom templates using the same provider id override the built-in queries.

Template Example

A forwarding service template supporting DeepSeek-compatible balances and weekly/monthly USD windows:

{
  "label": "My relay",
  "match": { "providerIds": ["my-relay"] },
  "request": { "method": "GET", "url": "https://relay.example.com/v1/usage" },
  "auth": { "type": "bearer", "credentialRefs": ["MY_RELAY_API_KEY"] },
  "extract": {
    "balance": { "label": "余额", "amountPath": "remaining", "currencyPath": "unit" },
    "windows": [
      { "label": "本周", "usedPath": "subscription.weekly_usage_usd", "limitPath": "subscription.weekly_limit_usd" },
      { "label": "本月", "usedPath": "subscription.monthly_usage_usd", "limitPath": "subscription.monthly_limit_usd" }
    ]
  }
}

Paths use dot notation, [n] to access array elements, and [*] to expand all elements (used for balance_infos[*]). A window requires two numbers; if the response omits a window, it simply isn’t displayed.

Use Cases and Notes

Suited for developers who need to quickly check balances or usage windows in the composer toolbar. The plugin runs with the permissions of the current DSH process—review the source code and license before installing.

Closing

dsh-quota-inline condenses quota information into a single line to the left of the model selector, with hover and click interactions for additional details. It relies on local credentials, involves no data reporting, and is well suited for quickly verifying balances and windows. For more details, refer to the plugin directory page and the GitHub repository.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye