Introduction

DeepSeek Harness (DSH) focuses on agent routing management and session control. In practical development, when underlying models are invoked through third-party relay providers such as OpenRouter, the native DSH interface usually cannot display the relay-side balance, quota windows, or specific token costs. The dsh-quota plugin solves this problem by decoupling billing providers from route names and providing a visual dashboard to track token usage, cost budgets, and provider status.

Core Features

  1. Session and Cost Tracking: The plugin follows the active session’s route, model, reasoning effort, and official tokenUsage projection. It persistently stores deduplicated per-call usage logs in DSH Host storage and tracks token counts and estimated CNY costs for the current session, daily, and rolling 30-day windows.
  2. Multi-Provider Integration: Supports displaying provider balance, quota windows, spending limits, and provider-side usage. Local accounting integration supports platforms such as Moonshot, Zhipu, Alibaba Bailian, Volcengine Ark, Together AI, and Fireworks AI, and can track usage without additional credentials.
  3. Data Migration and Persistence: The plugin automatically migrates browser-aggregated data from before v0.6 to avoid duplicate counting after upgrades. It also supports CSV export and allows editing the CNY-per-million-token price for each model in browser settings.
  4. Visual Dashboard: Provides a draggable floating widget, with support for icon mode, hiding, and position reset. The dashboard includes a gapless 7-day trend chart and a 30-day breakdown, and supports a desktop drawer and a mobile bottom form.

Installation and Enablement

The plugin is provided as a prebuilt archive, so no local TypeScript build is required. The installation commands are as follows:

dsh plugin --profile web add "https://github.com/Lottle7/dsh-quota/releases/download/v0.8.0/dsh-quota.tgz"
dsh web

Configuration and Usage

The Host settings namespace is dsh-quota. Key configuration items include enabled, refreshIntervalMs, warningBalanceBelow (warn when the balance falls below this value), and usageRetentionDays (data retention period in days, range 30-3650).

Local Accounting and Custom Providers

For local accounting, no additional credentials are required; the plugin reports DSH-provided token projections based on the configured price list. For custom providers, you can use kind: local (no remote requests) or kind: http-json (maps to a public HTTPS JSON settlement endpoint).

Route Mapping

When custom route names cannot be recognized automatically, you can configure routeMappings to explicitly specify the mapping between routes and billing providers.

Notes

  1. Local accounting integration does not fabricate balances; it only reports token projections and user-configured prices.
  2. After installing the prebuilt archive, no local build step is required.
  3. The plugin provides credential-free diagnostic reports for checking route resolution and cache status.

Summary

dsh-quota provides DSH users with a complete view from the routing layer to the billing layer. Through persistent logs, budget management, trend analysis, and CSV export, it helps developers more clearly understand resource consumption and costs in multi-provider environments.