Back to home@Lottle7

dsh-quota

Multi-provider quota, balance and Token-cost dashboard for DeepSeek Harness Web.

Stars
1
Language
TypeScript
Created
Aug 25, 2026
Updated
Aug 25, 2026
GitHub repo

Introduction

dsh-quota

English | 简体中文

CI Release License: MIT DeepSeek Harness

Multi-provider quota, balance, and Token-cost dashboard for DeepSeek Harness (DSH) Web.

dsh-quota follows the active DSH Session and distinguishes the model vendor from the route that actually bills it. If a Session runs a MiniMax model through OpenRouter, usage remains attributed to OpenRouter. It combines five native account integrations, six local-accounting routes, a draggable always-on widget, usage analytics, local model pricing, and safe route diagnostics.

dsh-quota quota center

Install

Install the prebuilt release into the DSH Web profile, then restart DSH Web:

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

The prebuilt archive does not require a local TypeScript build. To install the tagged source instead, use the command below and follow pnpm's allowBuilds prompt if pnpm 10 or later asks for it:

dsh plugin --profile web add "github:Lottle7/dsh-quota#v0.6.1"

Highlights

  • Follows the active Session's route, model, reasoning effort, and official tokenUsage projection.
  • Shows the provider's balance, quota windows, key spending limit, and provider-side usage when its API exposes them.
  • Persists a deduplicated per-call usage ledger in DSH Host storage and backfills existing Session logs without resuming Agents.
  • Tracks current-Session, daily, and rolling 30-day Tokens and estimated CNY cost by billing platform and model, using complete Host aggregates independently of history-page size.
  • Keeps a draggable mini dashboard visible while you work; switch it to icon-only mode, hide it, or reset its position.
  • Migrates the pre-v0.6 browser aggregates as uncovered remainders, so upgrades preserve history without double-counting Session logs.
  • Shows historical-sync progress and pageable call-level model, route, Token, cost, time, turn, and step details.
  • Filters call history by billing provider, exact model, source or search text, and exports every matching row as CSV.
  • Displays a gap-free seven-day trend and a 30-day provider/model breakdown, with summary JSON export.
  • Lets you edit per-model CNY-per-million-Token prices in the browser and restore Host defaults at any time.
  • Explains route resolution, billing provider, model vendor, confidence, and cache state in a credential-free diagnostic report.
  • Supports desktop drawers, a responsive mobile bottom sheet, light/dark themes, and Chinese/English UI copy.

Supported platforms

Native account queries:

PlatformWhat is displayedHost credential
MiniMax ChinaCoding Plan quota windowsMINIMAX_CN_API_KEY or MINIMAX_CN_COOKIE
MiniMax InternationalCoding Plan quota windowsMINIMAX_INTL_API_KEY or MINIMAX_INTL_COOKIE
DeepSeek OfficialMulti-currency account balanceDEEPSEEK_API_KEY
OpenRouterKey usage, spending limit, remaining allowance, and reset cadenceOPENROUTER_API_KEY or OPENROUTER_KEY
SiliconFlowRecharge, gifted, and total balanceSILICONFLOW_API_KEY or SILICONFLOW_KEY

Local Token and cost accounting, without an additional provider credential:

PlatformRoute aliases
Moonshot / Kimimoonshot, kimi
Zhipu GLMzhipu, bigmodel, glm
Alibaba Bailiandashscope, bailian
Volcengine Arkvolcengine, ark, doubao
Together AItogether, together-ai
Fireworks AIfireworks, fireworks-ai

Local-accounting integrations never invent a balance. They report only the Token projection supplied by DSH and the price table configured by the user.

Interface

  • Overview — active billing-platform balance/quota, today's Token cost and connection summary.
  • Usage — Session, today and 30-day totals, Host history sync, seven-day chart, provider/model rankings, filtered call history, pagination, and CSV export.
  • Providers — inspect all 11 integrations or pin one for viewing without changing the Session model.
  • Settings — control the floating widget, edit local prices, inspect route resolution, copy diagnostics, and export usage.

The floating widget's mode and position are browser-local. It temporarily yields while the full quota center is open and returns when the drawer closes.

Configuration

The Host settings namespace is dsh-quota:

dsh-quota:
  enabled: true
  refreshIntervalMs: 60000
  warningBalanceBelow: 10
  warningQuotaRemainingBelow: 0.2
  usageRetentionDays: 90

  # Use an explicit mapping when a custom route name cannot be identified.
  routeMappings:
    my-company-openrouter: openrouter

  providerEnabled:
    minimax-cn: true
    minimax-intl: true
    deepseek-official: true
    openrouter: true
    siliconflow: true
    moonshot: true
    zhipu: true
    alibaba-bailian: true
    volcengine-ark: true
    together: true
    fireworks: true

  pricing:
    default:
      inputCacheHitPerMTokCNY: 0
      inputCacheMissPerMTokCNY: 0
      outputPerMTokCNY: 0
    overrides: {}
    peakHours:
      weekdays: []
      windows: []
      timezone: Asia/Shanghai

usageRetentionDays accepts 30–3650 days and controls the Host ledger retention window. The dashboard queries the latest 30 days by default.

Prices are estimates only and never modify a provider bill. An empty peakHours.windows disables time-based discounts. Browser price overrides stay in localStorage, take precedence over the matching Host model price, and contain no credentials.

Privacy and security

  • API keys and cookies are resolved only through the DSH Host credential service.
  • Credentials are not sent to the browser, stored in the usage ledger, or included in diagnostics.
  • The Host ledger stores only Session identity, turn/step, timestamp, route/model, and Token buckets in DSH's storage domain; it never stores prompts, replies, tool payloads, API keys, or cookies.
  • The browser keeps UI preferences, local price overrides, and a compatibility aggregate mirror; message content is never persisted by this plugin.
  • Provider API responses and quota snapshots are recursively redacted; usage responses are emitted only from a closed, validated numeric ledger shape.
  • Write routes require JSON and validate Host, Origin, and Sec-Fetch-Site.
  • Arbitrary custom URLs with bearer tokens are intentionally unsupported to avoid an SSRF and credential-exfiltration surface.

Please report security issues privately as described in SECURITY.md.

Compatibility

  • Node.js 22 or later.
  • DeepSeek Harness 0.1.1-rc.2 or later Web profile (requires the official storage-domain and Session inspection services).
  • CI verifies Node.js 22 and 24 with type checking, unit tests, a client Loader smoke test, and package-content validation.

DSH is still evolving through release candidates. Run the Loader smoke test after upgrading DSH before deploying the plugin broadly.

Update or remove

Install a newer prebuilt archive with the same dsh plugin command and its new version URL. To remove the bundle:

dsh plugin --profile web remove dsh-quota

Restart dsh web after adding, updating, or removing a bundle.

Development

npm install
npm run test:ci

To link a local checkout into the Web profile, run this from the repository root:

dsh plugin --profile web add .

The package declares cordis.patch.yml as a DSH bundle. The patch mounts both the Host provider registry and the browser client. See CONTRIBUTING.md for adapter and pull-request guidance.

The prepared DSH registry submission records the marketplace entry, prebuilt tarball URL, screenshot, and required GitHub topics.

License

MIT