Back
48/65
Lesson 48
6 min
CAAM: Account Rotation
Manage multi-provider API accounts with automatic rate limit rotation
Ready to level up?
Mark complete to track your learning progress.
Manage multi-provider API accounts with automatic rate limit rotation
Mark complete to track your learning progress.
Manage multiple AI provider accounts and automatically rotate when rate limits hit to keep your agents running continuously.
CAAM (Coding Agent Account Manager) manages multiple API accounts across AI providers (Anthropic, OpenAI, Google) and automatically switches between them when rate limits hit. Instead of waiting for cooldowns, your agents keep working on the next available account.
When running agent swarms with NTM, each agent consumes API quota fast. CAAM tracks per-account rate limit state and rotates credentials so agents experience near-zero downtime from throttling.
Rotate across multiple API keys per provider
Per-account rate limit state with TTL
Track tokens and costs per account
Anthropic, OpenAI, Google in one system
Account Rotation Control Panel
Step through scenarios to see how CAAM manages accounts, rate limits, and emergency failover
All accounts healthy. Active account handling requests at moderate load. Rate limits well within safe range.
work-primary
Anthropicwork-backup
Anthropicopenai-main
OpenAIgemini-pro
GoogleRegister your accounts, then let CAAM handle switching.
# Add an Anthropic accountcaam add --provider anthropic --name "work-account" --key sk-ant-...# Add a second account for the same providercaam add --provider anthropic --name "personal" --key sk-ant-...# Add an OpenAI accountcaam add --provider openai --name "openai-main" --key sk-...# List all registered accountscaam list# Check which account is activecaam status
caam rotate in your agent startup scripts. It picks the account with the lowest recent usage and longest time since last rate limit.CAAM tracks three signals per account to make intelligent rotation decisions:
# View rate limit details for all accountscaam status --verbose# Example output:# PROVIDER ACCOUNT STATUS COOLDOWN TOKENS/24H# anthropic work-account active -- 142,000# anthropic personal ready -- 23,000# openai openai-main cooldown 4m 32s 89,000# Auto-rotate picks "personal" (lowest usage, no cooldown)caam rotate# When an agent hits a rate limit, mark the accountcaam cooldown work-account --ttl 5m# CAAM automatically skips accounts still in cooldowncaam rotate # → switches to "personal"
When NTM spawns multiple agents, each one can be assigned a different CAAM account to maximize throughput.
# In your NTM spawn config, assign accounts per agent:# Agent 1 uses work-account, Agent 2 uses personal, etc.# Check which agents are using which accountscaam status --by-session# Monitor aggregate usage across all agentscaam usage --period 1h# Set a budget ceiling (CAAM refuses to rotate when exceeded)caam budget --daily 100 --provider anthropic
Assign accounts per spawned agent for parallel throughput
Track per-account costs alongside usage metrics
Require approval before switching to expensive accounts
Back up account configs across machines with ASB