How to Add Multiple Anthropic Accounts to OpenClaw
Running out of credits on one Anthropic account? Here's how to connect multiple accounts to OpenClaw for automatic failover.
Why Multiple Accounts?
OpenClaw can automatically switch between Anthropic accounts when one hits rate limits or runs out of credits. This gives you:
Prerequisites
Step 1: Add Your API Keys
Run this for each account you want to add:
clawdbot models auth setup-token --provider anthropicYou'll be prompted to:
work, personal, backup)Repeat for each account. Each gets a unique profile ID like anthropic:work.
Step 2: Check Your Profiles
Verify your profiles were added:
clawdbot models auth listYou should see something like:
anthropic:personal token โ
anthropic:work token โ
anthropic:backup token โStep 3: Set Failover Order
Edit your config to control which account is tried first:
clawdbot config editFind the auth section and add/update the order field:
{
"auth": {
"profiles": {
"anthropic:personal": { "provider": "anthropic", "mode": "token" },
"anthropic:work": { "provider": "anthropic", "mode": "token" },
"anthropic:backup": { "provider": "anthropic", "mode": "token" }
},
"order": {
"anthropic": [
"anthropic:personal",
"anthropic:work",
"anthropic:backup"
]
}
}
}The order array sets the priority โ OpenClaw tries the first profile, and if it fails (rate limit, billing, etc.), it moves to the next.
Step 4: Configure Backoff (Optional)
Control how long OpenClaw waits before retrying a failed profile:
{
"auth": {
"cooldowns": {
"billingBackoffHours": 5,
"billingMaxHours": 24
}
}
}Step 5: Restart and Test
clawdbot gateway restartSend a message to your agent. Check the logs to confirm which profile is being used:
clawdbot logs -fMixing OAuth and API Keys
You can also use Claude CLI's OAuth alongside API keys:
# Add OAuth profile (opens browser)
clawdbot models auth login --provider anthropic
# This creates an 'anthropic:claude-cli' profileThen include it in your order:
"order": {
"anthropic": [
"anthropic:claude-cli",
"anthropic:personal",
"anthropic:work"
]
}Troubleshooting
"Invalid API key" errors: Double-check the key at console.anthropic.com
Profile not being used: Check the order array โ profiles not listed won't be used for automatic failover
Stuck on one profile: Check cooldowns โ a billing failure triggers backoff. See current state with clawdbot status
---
That's it! Your OpenClaw agent now has redundant Anthropic access. No more conversations dying mid-thought because of rate limits. ๐
Comments (0)
No comments yet. Be the first to comment!