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:
- Uninterrupted conversations โ if one account fails, it falls back to the next
- Credit pooling โ spread usage across accounts
- Billing flexibility โ mix personal and work accounts
Prerequisites
- OpenClaw installed and running
- Multiple Anthropic API keys (from console.anthropic.com)
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:
- Enter a profile name (e.g.,
work,personal,backup) - Paste your API key
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
}
}
}- billingBackoffHours: Initial wait time after a billing failure
- billingMaxHours: Maximum backoff cap
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!