OpenClaw Skill: AI model provider manager — auto-discover models, track quota exhaustion across agents, and auto-switch on failure.
- Auto Model Discovery - Query any OpenAI-compatible
/v1/modelsendpoint to list all available models - Quota Tracking - Mark exhausted models, share state across multiple agents (file-lock safe)
- Auto Failover - When a model's quota runs out, automatically pick the next available one
- Batch Config Sync - Update all agent configs in one command
- Multi-Provider - Built-in support for Alibaba Cloud Bailian, DeepSeek, Zhipu, Kimi, OpenAI, SiliconFlow, plus any custom OpenAI-compatible endpoint
- Health Check - JSON-based health status for proactive monitoring (healthy / warning / critical)
- OpenClaw Skill - Drop into any OpenClaw agent's skill directory; the agent reads
SKILL.mdand gains full model management capability
- 模型自动发现 - 通过
/v1/modelsAPI 自动获取供应商所有可用模型 - 额度追踪 - 标记耗尽的模型,多 Agent 间共享状态(文件锁保证并发安全)
- 自动切换 - 模型额度用完后,自动选择下一个可用模型
- 批量同步 - 一条命令更新所有 Agent 的配置文件
- 多供应商 - 内置阿里云百炼、DeepSeek、智谱、Kimi、OpenAI、SiliconFlow,支持任何 OpenAI 兼容端点
- 健康检查 - JSON 格式健康状态输出,支持主动监控(healthy / warning / critical)
- OpenClaw Skill - 放入 Agent 的 skill 目录即可使用,Agent 读取
SKILL.md自动获得模型管理能力
| Provider | Endpoint |
|---|---|
| Alibaba Cloud Bailian (bailian) | https://dashscope.aliyuncs.com/compatible-mode/v1 |
| DeepSeek | https://api.deepseek.com/v1 |
| Zhipu (zhipu) | https://open.bigmodel.cn/api/paas/v4 |
| Kimi / Moonshot | https://api.moonshot.cn/v1 |
| OpenAI | https://api.openai.com/v1 |
| SiliconFlow | https://api.siliconflow.cn/v1 |
| Custom | Any OpenAI-compatible endpoint via --base-url |
npm install -g openclaw-provider-managergit clone https://github.com/jeouly3-bot/openclaw-provider-manager.git
cd openclaw-provider-manager
npm install# Clone into your OpenClaw skills directory
git clone https://github.com/jeouly3-bot/openclaw-provider-manager.git \
~/.openclaw/skills/openclaw-provider-manager
cd ~/.openclaw/skills/openclaw-provider-manager && npm installnpm run setup
# or: openclaw-pm setup (if installed globally)node scripts/registry.js add-key \
--provider bailian \
--key sk-your-api-key \
--label "my-account"node scripts/registry.js statusnode scripts/health-check.js
# Output: { "status": "healthy", "summary": "0/95 text models exhausted (0%)", ... }node scripts/registry.js mark-exhausted \
--provider bailian \
--model qwen3.5-plus \
--by "Agent-XiaoYi"node scripts/registry.js next-model --provider bailian --type text
# Output: { "model": "deepseek-v3", "type": "text", "fallback": false }# Single agent
node scripts/sync-config.js \
--format agent --provider bailian \
--config ./openclaw.json --key-label "XiaoYi"
# All agents in a directory
node scripts/sync-config.js \
--format agent --provider bailian \
--config-dir ./agents/When a user provides keys from a new account with fresh quota:
node scripts/registry.js reset --provider bailian
node scripts/registry.js add-key --provider bailian --key sk-new-key --label "new-account"node scripts/discover.js --provider <name> --key <api-key> [--base-url <url>]| Subcommand | Description |
|---|---|
add-key |
Add API key and auto-discover models |
status |
Show model availability statistics |
mark-exhausted |
Mark a model as quota exhausted |
next-model |
Get next available model of a given type |
reset |
Reset all exhausted models to available |
blacklist-add |
Add a model to the blacklist |
blacklist-remove |
Remove a model from the blacklist |
# Gateway format
node scripts/sync-config.js --format gateway --provider bailian --config ./gateway.json
# Agent format
node scripts/sync-config.js --format agent --provider bailian --config ./openclaw.jsonnode scripts/health-check.js [--registry <path>]Returns JSON with status (healthy | warning | critical | no-registry), model counts by type, and recently exhausted models.
Clone this repo into your OpenClaw skills directory. The agent reads SKILL.md and automatically gains:
- First-run setup - detects missing registry, asks user for API key
- 403/quota error handling - marks model exhausted, switches to next, syncs config, retries
- Proactive health checks - monitors quota status, alerts user when running low
- Key management - adds new keys, resets exhaustion on new accounts
The skill is platform-agnostic: it does not prescribe any notification channel. Each agent decides how to communicate with its user based on available tools.
openclaw-provider-manager/
├── SKILL.md # OpenClaw Skill definition (agent decision tree)
├── package.json
├── lib/
│ ├── providers.js # Provider presets + model type classification
│ ├── file-lock.js # File locking (concurrent-safe writes)
│ └── utils.js # JSON I/O, atomic writes, backup
├── scripts/
│ ├── discover.js # Model auto-discovery
│ ├── registry.js # Shared registry management
│ ├── sync-config.js # Config file synchronization
│ ├── health-check.js # Health status (JSON output)
│ ├── setup.js # Interactive first-time setup
│ └── proxy-server.js # Local proxy with auto-switch
└── references/
├── blacklist.json # Models with no free quota
└── providers.md # Provider endpoint reference
All agents share one registry file. Set the path via:
- Environment variable:
PROVIDER_REGISTRY_PATH=/shared/.provider-registry.json - CLI flag:
--registry /shared/.provider-registry.json
When one agent marks a model exhausted, all other agents see it immediately. File-locking ensures safe concurrent writes.
Issues and PRs welcome! This project is in early stage - feedback on real-world usage is especially valuable.