#Add others providers and models
1 messages · Page 1 of 1 (latest)
OpenAI + Anthropic are built-in providers in OpenClaw — you usually don’t need to “add a provider” unless you’re using a custom proxy/baseUrl. You just add credentials, then pick a provider/model.
1) Add credentials (recommended: run the wizard)
- OpenAI API key:
openclaw onboard --auth-choice openai-api-key
oropenclaw onboard --openai-api-key "$OPENAI_API_KEY" - Anthropic API key:
openclaw onboard(choose Anthropic API key)
oropenclaw onboard --anthropic-api-key "$ANTHROPIC_API_KEY" - Anthropic subscription (no API key): generate a setup-token via
claude setup-token, then paste it with:
openclaw models auth paste-token --provider anthropic
Docs:
2) Pick models (config or in-chat)
Model refs are always provider/model (OpenRouter models keep their full path, e.g. openrouter/anthropic/…).
In Discord: use /model (interactive picker) to switch without restarting.
CLI: openclaw models list / openclaw models set <provider/model>
Verify auth: openclaw models status
Docs:
3) Minimal config example (JSON5)
Your config is ~/.openclaw/openclaw.json (JSON5). Something like:
{
env: {
OPENROUTER_API_KEY: "sk-or-...",
OPENAI_API_KEY: "sk-...",
ANTHROPIC_API_KEY: "sk-ant-...",
},
agents: {
defaults: {
model: {
primary: "anthropic/<pick-from-models-list>",
fallbacks: [
"openai/<pick-from-models-list>",
"openrouter/<pick-from-models-list>",
],
},
},
},
}
If you tell me what openclaw --version shows + whether you’re editing ~/.openclaw/openclaw.json directly or using the dashboard, I can point you to the cleanest exact steps for your setup.
Yes — you can have several providers configured at the same time (OpenRouter + OpenAI + Anthropic, etc.).
A few important details:
- A session uses one active model at a time, but you can:
- switch any time with
/model, and/or - configure fallbacks so if Anthropic rate-limits/errors it automatically tries OpenAI, then OpenRouter, etc.
Example (primary + fallbacks across providers)
{
env: {
OPENROUTER_API_KEY: "sk-or-...",
OPENAI_API_KEY: "sk-...",
ANTHROPIC_API_KEY: "sk-ant-...",
},
agents: {
defaults: {
model: {
primary: "anthropic/claude-sonnet-4-5",
fallbacks: [
"openai/gpt-5.2",
"openrouter/anthropic/claude-sonnet-4-5",
],
},
},
},
}
Common gotcha
If you set agents.defaults.models (the allowlist/catalog), you must include every model you want to be able to select via /model, otherwise you’ll get “Model … is not allowed”.
Quick checks / switching
- Check credentials/providers:
openclaw models status - Switch in Discord:
/model
Docs: