GooDAnDReaDY/dsh-key-rotation ↗★ 3
@goodandready/dsh-key-rotation
Per-provider API key rotation for DeepSeek Harness: a key pool per provider, auto-created clone routes, and switching to the next key on quota/rate-limit errors. Includes a Settings section (Key Rotation) to edit the key pools, cooldown and switch codes.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:GooDAnDReaDY/dsh-key-rotation说明文档
阅读完整 README ↗⚙️ Configuration Reference (settings.yaml)
dsh-key-rotation:
switchCodes:
- QUOTA
- RATE_LIMIT
- SERVER
- TIMEOUT
- TRANSPORT
- EMPTY_RESPONSE
- UNKNOWN_MODEL
- AUTH
cooldownMs: 60000
# v0.8.0 circuit breaker
circuitBreakerEnabled: true
circuitBreakerThreshold: 5
circuitBreakerOpenMs: 30000
circuitBreakerHalfOpenProbes: 1
concurrencyLimit: 5
quotaResetWindow:
type: midnight_utc
hour: 0
cascade:
- provider: backup-provider-id
model: your-backup-model-id
webhookUrl: "https://api.telegram.org/bot/sendMessage?chat_id="
providers:
- provider: your-primary-provider
rpmLimit: 60
tpmLimit: 100000
keys:
- PRIMARY_API_KEY
- PRIMARY_API_KEY_2
- PRIMARY_API_KEY_BACKUP
- provider: secondary-provider
keys:
- SECONDARY_API_KEY
- SECONDARY_API_KEY_2
Parameter Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
switchCodes | string[] | [QUOTA, RATE_LIMIT, ...] | List of error codes that immediately trigger failover. |
cooldownMs | number | 60000 (1 min) | Base penalty duration (in ms) for quarantined keys. |
circuitBreakerEnabled | boolean | true | Enable per-provider circuit breaker (v0.8.0). |
circuitBreakerThreshold | number | 5 | Consecutive failures before opening the circuit. |
circuitBreakerOpenMs | number | 30000 | How long the circuit stays open (ms). |
circuitBreakerHalfOpenProbes | number | 1 | Probe requests allowed in half-open state. |
verboseLogging | boolean | false | Per-request rotation logs (noisy; off by default). |
concurrencyLimit | number | 0 (disabled) | Max concurrent in-flight streams per key (0 = unlimited). |
quotaResetWindow | object | null | Calendar reset alignment (midnight_utc, midnight_pst, rolling_24h). |
cascade | array | [] | Fallback provider chain when primary pool is completely exhausted. |
webhookUrl | string | "" | Target URL for interactive Telegram, Discord, Slack, or generic alerts. |
providers | array | [] | List of { provider, keys, rpmLimit, tpmLimit, modelPools } definitions. |