xiaozhe7772222/dsh-api-key-pool
dsh-api-key-pool
API Key rotation pool for DeepSeek Harness: multi-key round-robin, failover on 401/403/429, cooldown & recovery, Web UI management panel
Install
npx @deepseek-ai/dsh plugin --profile web add github:xiaozhe7772222/dsh-api-key-poolRestart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/dsh-api-key-pool)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from xiaozhe7772222/dsh-api-key-pool, cleaned of badges and images.
dsh-api-key-pool
API Key 轮换池插件 · API Key Rotation Pool Plugin for DeepSeek Harness (DSH)
🐧 Designed & built by 小哲 (@xiaozhe7772222)
多 Key 自动轮换 · 失败自动切换 · 冷却恢复 · Web 管理面板
Multi-key round-robin · Automatic failover · Cooldown & recovery · Web UI panel
English | 中文
English
✨ Features
| Feature | Description |
|---|---|
| 🔄 Round-robin rotation | Multiple keys per provider, rotated per request for load balancing |
| 🛡️ Automatic failover | Key fails with 401 / 403 / 429 → automatically marked unhealthy, next key takes over |
| ⏱️ Cooldown & recovery | Failed keys enter exponential-backoff cooldown (30s default), auto back in rotation when expired |
| 🌐 Web management panel | DSH Web UI → Settings → Plugins → API Key Pool: add/remove keys, view health, reset cooldowns |
| 🔒 Key masking | REST API only exposes masked keys (sk-abc****1234), never full secrets |
| 💾 Persistent config | Keys added via Web UI persist to pool-config.json, survive restarts |
📦 Installation
# Clone the repo
git clone https://github.com/xiaozhe7772222/dsh-api-key-pool.git
cd dsh-api-key-pool
# Copy into your DSH profile's plugins directory
mkdir -p ~/.dsh/profiles/web/plugins/dsh-api-key-pool
cp -r lib package.json cordis.patch.yml ~/.dsh/profiles/web/plugins/dsh-api-key-pool/
Then declare the bundle in ~/.dsh/profiles/web/package.json:
{
"dsh": {
"profile": {
"bundles": [
{
"name": "dsh-api-key-pool",
"platform": ["web"],
"optional": false
}
]
}
}
}
Restart DSH:
npx @deepseek-ai/dsh web
⚙️ Configuration
Option 1: Static config via cordis.patch.yml
- insert:
- id: api-key-pool
name: dsh-api-key-pool
inject: [llm, webServer]
config:
pools:
provider-a:
apiKeyEnv: PROVIDER_A_API_KEY
keys:
- sk-your-first-key
- sk-your-second-key
- sk-your-third-key
cooldownMs: 30000
provider-b:
apiKeyEnv: PROVIDER_B_API_KEY
keys:
- sk-key2-1
- sk-key2-2
cooldownMs: 60000
defaultCooldownMs: 30000
| Field | Type | Description |
|---|---|---|
pools.<provider>.apiKeyEnv | string | Env var name for this provider's API key (must match apiKeyEnv in settings.yaml) |
pools.<provider>.keys | string[] | List of API keys to rotate |
pools.<provider>.cooldownMs | number | Cooldown per key after failure (ms) |
defaultCooldownMs | number | Global default cooldown (ms), default 30000 |
Option 2: Web management panel (runtime)
After starting DSH, open Settings → Plugins → API Key Pool:
- View each provider's key health (green = healthy, orange = cooling)
- Paste a new key and click Add
- Click
✕to remove a key - Click Reset cooldown to clear cooling state for a provider
- Click Refresh to reload status
Keys added via the panel persist to pool-config.json automatically.
…

