dsh-quota-board: View provider quotas and local usage in the Harness sidebar

Introduction

When configuring multiple model providers simultaneously in DeepSeek Harness, balances, plan quotas, and local token consumption are often scattered across different backends or settings pages. During a conversation, confirming “do I still have quota” typically requires switching out to check billing or opening each provider’s console individually. Below we introduce the community plugin dsh-quota-board (maintainer Anixuil, categorized as a client plugin): it adds an entry point at the bottom of the sidebar, above the account row. Clicking it opens a floating window to view the quota and local usage of all configured providers in the current profile without leaving the current session.

Note: This article describes a third-party community plugin. The project has no affiliation with DeepSeek officially and is not part of the official plugin marketplace. The plugin runs with the current DSH process permissions. Before installing, please review the GitHub repository source code and MIT license yourself.

What Is This

dsh-quota-board is a “model provider quota board” for the DeepSeek Harness desktop client. It centrally displays the balances, plan quotas, and local token usage of all configured model providers in the current profile. When quotas expire or run low, you can quickly verify in the sidebar without leaving an ongoing conversation.

Where Providers Come From

The plugin does not directly read raw configuration files or guess directory structures. The Harness Loader has already merged the profile’s bundle layer, profile layer, and !!js expressions. The plugin reads the already-merged lines:

Line What is read
llm-pi-ai config.providers.<id>: displayName / api / baseURL / apiKeyEnv / models[]
llm-deepseek* The official DeepSeek adapter’s baseURL / apiKeyEnv (default DEEPSEEK_API_KEY)
agent-default-model config.provider, used to mark the “current default” provider

Therefore, adding a provider to your profile in the Harness in the original way (modifying the llm-pi-ai line) will be immediately reflected on the board, without needing to register it again in the plugin. The providers field in the plugin configuration is only used to supplement “gateways not declared in the profile” or to override already-discovered entries.

Core Features

Built-in DeepSeek and Additional Providers

Who How to check quota
Built-in DeepSeek (llm-deepseek line) After login, reads the Harness account wallet (same source as “Settings → Account & Balance”); falls back to GET {base}/user/balance when not logged in
Additional Everything else (including Volcengine, relay services, self-hosted gateways) Generic probe tries endpoints on demand; binds and remembers once discovered

After logging into Harness, the DeepSeek top-up balance and gift balance on the board are consistent with the settings page: the plugin calls the host’s deepseekAccount service (getState() to check login, getBalance() to get the wallet). The wallet sums top-ups and gifts, displays details side by side, and marks negative values in red. Only api.deepseek.com / api.deepseek.ai are treated as official DeepSeek; relays on other domains always use their own API keys and will never mistakenly use the account balance.

Keys are not persisted: each provider’s apiKeyEnv is merely a reference name. The host resolves it via “credential service → startup environment → process environment variables”, so plaintext is not accessible from the browser side.

Quota APIs: Generic Probing and Binding

Except for DeepSeek and Volcengine which have dedicated adapters, others go through the generic probe, trying common balance paths in order (relative to the API root; paths ending in /v1 are normalized):

/v1/usage  →  /user/balance  →  /v1/credits  →  /v1/dashboard/billing/usage  →  /usage  →  /api/usage

401/403 aborts immediately; 404/405 continues to the next; a single timeout stops further attempts. On first successful probe, the path and response type are written to:

~/.dsh/storages/quota-board/bindings.json

Next time, the bound endpoint is queried first, and only on failure does a full re-probe. To force re-probing, delete the corresponding key or pin the path via fields.endpoint in the configuration.

Volcengine uses the OpenAPI signed with account AK/SK (Ark API keys cannot query billing). Providers hitting the skip list are marked as unsupported, with the card explaining that billing cannot be queried via API Key.

Above the “Additional Providers” section in the settings page, discovered additional providers are listed (read-only). When you need to override, click “Override” to generate an entry in the configuration. Each provider entry has a “Test Connection” button that makes a request using unsaved values first.

Local Token Usage

Without replaying session logs, it directly reads the session projection cache:

~/.dsh/storages/session_projcache/sessions/<sessionId>.json

It reads rows.tokenUsage.totals and rows.sessionStats, and attributes usage using rows.modelSelection.lastUsed.provider. This section requires no network and is viewable offline; the metrics may differ from provider billing (cache pricing, gifted quotas, etc.).

Board Interaction

There is a “Quota Board” button at the bottom-left of the sidebar, above the account row. The floating window portals to <body> and expands edge-aligned based on the button’s position. Ways to close: click the button again, click outside the window, or press Esc. The sidebar button displays the name and remaining quota of the “default display provider” by default (plan windows show percentages, wallets show amounts); if not configured, it follows the model’s default provider.

Polling by refreshSeconds only occurs while the floating window is open; it stops when closed. On mount, there is one quiet initial read so the button has numbers even when not expanded (host caches for approximately 20 seconds).

Configuration entry: gear icon in the top-right of the floating window → Settings → Plugins → Quota Board.

Installation and Activation

Desktop client: Sidebar “Plugins” → “+ Add Plugin” → Enter one of the following in the input field → Install → Enable immediately → Restart Harness (bundle-type plugins do not hot-reload).

Input Effect
github:Anixuil/dsh-quota-board Install the current code from GitHub main; upgrades require uninstall/reinstall
git+https://github.com/Anixuil/dsh-quota-board.git#v0.1.0 Pin to tag v0.1.0
dsh-quota-board (after publishing to npm) Use npm version management; pin version with @0.1.0

The [WARN] Issues with peer dependencies found message during installation can be ignored: peerDependencies point to Harness’s own @deepseek-ai/* packages, which are not published to npm. This is the same situation as official plugins.

For local development, you can enter the absolute path of the directory in the same input field; pnpm records it as link:. After modifying index.js / client.js, restart Harness to apply changes. Link and physical installation are mutually exclusive. Before switching, handle the link in the profile’s node_modules to avoid ERR_PNPM_EPERM on Windows.

Typical Usage

Manually Specifying Unrecognized Gateways

Add a card in Settings → Plugins → Quota Board → “Additional Providers” (no need to hand-write JSON). Example written to the profile’s cordis.patch.yml:

providers:
  - id: my-gw
    displayName: My Gateway
    baseURL: https://gw.example.com/v1
    apiKeyEnv: MY_GW_KEY
    fields:
      endpoint: /api/me/quota
      remaining: data.credit
      unit: data.currency
    authHeader: x-api-key
    authPrefix: ''

Common fields: adapter (generic / deepseek / volcengine / unsupported), fields.endpoint / remaining / used / unit / scale, authHeader / authPrefix; Volcengine entries additionally use accessKeyEnv / secretKeyEnv to reference AK/SK credential names.

Common Configuration Options (all have default values)

Field Default Description
providers [] List of additional or override providers
defaultProvider '' Which provider the sidebar button displays (empty = follow model default)
lowThreshold 5 Mark amounts in red when below this value
refreshSeconds 60 Polling interval while the floating window is open (minimum 10 seconds)
usageDays 14 Days for the local usage bar chart (3–60)
timeoutMs 10000 Per-provider API timeout (minimum 2000)
deepseekBaseURL '' Fallback when all DeepSeek lines omit baseURL
skipHosts '' Domain fragments not to probe (comma-separated)

The available quota uses DeepSeek brand blue #4d6bfe as the primary color; remaining ≤30% shows amber, ≤10% shows red.

Use Cases and Notes

Suitable for: Developers who use DeepSeek accounts alongside multiple OpenAI-compatible gateways, relays, or Volcengine providers in Harness, and want to quickly verify balances, plan quotas, and local usage curves alongside conversations.

Notes:

  1. When requesting billing APIs from providers, the plugin uses your configured API keys or Volcengine AK/SK. Ensure the key permissions and sources are trusted.
  2. OpenAI official has no public /v1/usage; the generic probe falls back in the order described in the README. Gateways that don’t match require manual mapping via fields.
  3. Community plugins may need updates as Harness and upstream APIs change; to pin a version, use git+https://github.com/Anixuil/dsh-quota-board.git#v0.1.0 or a subsequent npm version number.

Conclusion

dsh-quota-board connects the existing provider discovery logic in your profile, the DeepSeek account wallet, and local session usage projections into a single sidebar entry, using probe binding to reduce repeated trial and error. If you maintain a multi-provider Harness profile, you can first enable it via the installation command above, then verify in the floating window whether the default display provider and polling interval match your preferences.

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

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

Xiaoye