Preface

In the DSH plugin ecosystem, quota monitoring is a fairly specific problem: the same workflow may call multiple providers simultaneously, some checking balances, some checking 5h / 7d / 1m windows, along with today’s usage, cache hits, 429 rate-limit events scattered across different endpoints.

deepseek-harness-quota-monitor is a DSH plugin maintained by marisa-4219, licensed under MIT. It consolidates multi-provider quota information into a real-time sidebar card and settings-page configuration, supporting both balance-type and limit-type quota models.

Below we cover its features, installation method, and typical configuration.

What This Is

One-line positioning: a DeepSeek Harness multi-provider quota monitoring plugin that provides a real-time sidebar card and visual configuration in the settings page.

The main problems it solves:

  • Simultaneously monitor balances or window usage for multiple LLM providers.
  • Provide presets for officially registered providers to reduce repetitive configuration.
  • Support self-hosted gateways or custom providers via manual addition.
  • Put today’s usage, input / output / cache breakdown, cache hit rate, and 429 rate-limit events on the same monitoring interface.

Core Features

Two Types of Quota Models

This plugin supports two types of quota models.

Balance type: proactively queries provider balance/usage APIs, supporting API URLs, API Key references, and JS parsers.

Limit type: uses local sliding-window usage statistics, supporting windows such as 5h / 7d / 1m, persisted to:

$DSH_HOME/storages/quota-monitor-usage.jsonl

Note the boundaries of local metering: it only counts requests that pass through DSH. Usage from other tools using the same API Key will not be counted in these local window statistics.

Today’s Usage and Line Chart

The plugin provides “Today’s Used” statistics:

  • Bucketed by natural day.
  • Persisted across restarts.
  • Includes input / output / cache breakdown.
  • Includes cache hit rate.

The “Today’s Used” area in the sidebar supports flip cards to view hourly line charts for input / output / cache.

Provider Discovery and Enablement

Automatic discovery only covers officially registered providers with defined presets. Self-hosted gateways or custom providers without presets will not be automatically discovered and need to be added manually.

Supported preset one-click additions include:

deepseek-official
opencode-go
new-api
sub2api

In the “Add Provider” dropdown on the settings page, LLM providers already registered in the system are listed first, and configuration key names automatically use their route IDs.

Each provider can be individually enabled or disabled for monitoring.

Amounts and Rate Limiting

Amount display uses the price returned by the provider’s usage response. If a provider does not return a price table, no amount is inferred.

For rate limiting, the plugin records the retry-after from 429 rate-limit events.

Currently, response-header-level quotas like x-ratelimit-* are not retrievable; rate-limit information mainly comes from 429 errors.

Installation and Enablement

It is recommended to review the source code and license before installation. The plugin runs with the current dsh process permissions; confirm you trust its code behavior before installing.

Official installation command:

dsh plugin --profile web add deepseek-harness-quota-monitor

After installation, restart the dsh web service.

If developing from a local repository, you can install in development mode:

dsh plugin --profile web add <path-to-this-repo>

Typical Usage

Zero Configuration

If the current default provider is deepseek-official, the plugin automatically uses the built-in balance parser to query. The API Key is retrieved from the DEEPSEEK_API_KEY credential reference.

Configuration Entry

Configuration can be placed in the “Quota Monitor” section of the settings page, or in the profile’s cordis.patch.yml.

Configurable items include:

refreshMs
cacheTtlMs
lowBalanceThreshold
showTodayUsed
windows
providers

Where:

  • refreshMs sets the polling interval.
  • cacheTtlMs sets the balance query cache.
  • lowBalanceThreshold sets the low balance threshold.
  • showTodayUsed controls whether to display today’s usage.
  • windows sets the limit windows.
  • providers configures individual providers.

API Keys and Parsers

API Keys use environment variable names as credential references; values are stored in the credentials domain and not written directly into the configuration.

JS parsers can be configured as:

builtin
source
file

This accommodates different JSON structures returned by various providers.

Query API

You can retrieve a snapshot array of the current provider and all configured providers via the following endpoint:

GET /api/quota-monitor

Testing

The repository provides test scripts:

cd test
node verify-quota-e2e.mjs
node verify-patch-rewrite.mjs

The e2e test requires real credentials and reads:

~/.dsh/.credentials.yaml

Which uses:

OPENCODE_API_KEY
DEEPSEEK_API_KEY

Applicable Scenarios and Notes

Suitable for developers using the DSH web profile who need a centralized view of quota status across multiple providers.

Things to note:

  • Local metering only counts requests that pass through DSH.
  • Response-header-level quotas like x-ratelimit-* are currently not retrievable; rate-limit information comes from 429 errors.
  • The collapsed sidebar state only shows urgent information from the first default provider.
  • Balance query results have a 60s cache; configuration changes take effect within at most 60s.
  • Self-hosted/custom gateways without presets will not be automatically discovered and need to be added manually.

Links

GitHub:

https://github.com/marisa-4219/deepseek-harness-quota-monitor

Directory page lead:

https://www.skillhub.cn/plugins/marisa-4219/deepseek-harness-quota-monitor

This directory page URL comes from the plugin lead; please refer to the actual site when visiting.