dsh-quota
Multi-provider quota, balance and Token-cost dashboard for DeepSeek Harness Web, with a draggable widget, usage analytics, local pricing and route diagnostics. 适合需要监控和分析多模型API使用成本与路由状态的用户。
インストール
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Lottle7/dsh-quotaドキュメント
README 全文を読む ↗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
customProviders:
# Local accounting only: no remote request and no extra credential.
- id: my-company-relay
displayName: My Company Relay
kind: local
description: Internal model gateway
region: Global
brandColor: "#2563eb"
routeAliases: [my-relay, company-llm]
modelVendors: [deepseek, qwen]
# Restricted public HTTPS JSON account endpoint.
- id: acme-billing
displayName: ACME Billing
kind: http-json
endpoint: https://billing.example.com/v1/account
credentialRef: ACME_API_KEY
auth: bearer # bearer | x-api-key | none
balancePath: data.balance
usagePath: data.usage
limitPath: data.limit
remainingPath: data.remaining
currency: USD
valueScale: 1
routeAliases: [acme, acme-relay]
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.
Custom providers
Use kind: local for a relay or private route without an account endpoint. It makes no remote request and attributes DSH Tokens and local prices to that billing provider.
Use kind: http-json to map a restricted JSON account endpoint into balance, provider usage, and a spending limit. The four mapping fields are safe dot paths: for {"data":{"balance":"42.5"}}, use balancePath: data.balance. Configure at least one path. Numeric strings are accepted, and valueScale multiplies every mapped value (for example, use 0.001 when the upstream unit is one-thousandth of the configured currency).
credentialRef names a DSH Host credential/environment reference; it is never the literal key. Store the same reference through DSH credentials or provide it to the Host environment that starts dsh web. Custom IDs can also be used in providerEnabled and routeMappings. Live Host-settings changes rebuild the registry and provider cards without changing the current Session model.
Prices and budgets are estimates/alerts only: they never block a model call or modify a provider bill. An empty peakHours.windows disables time-based discounts. Browser price and budget overrides stay in localStorage; model prices take precedence over matching Host prices and neither preference contains credentials.