How to Integrate Anthropic Models in Openclaw
Quick Start
Anthropic models power Openclaw with advanced reasoning and tool capabilities. This guide covers the fastest way to connect Claude to your Openclaw agent.
For other model integrations, check our guides on OpenAI Models Openclaw and LiteLLM Models Openclaw.
Option 1: Anthropic API Key (Recommended)
This is the safest and most reliable path for accessing Anthropic models and supports usage-based billing.
Interactive Setup
Run the onboarding wizard by typing Openclaw onboard and choosing "Anthropic API key":
Openclaw onboard --auth-choice anthropic-api-key
Non-Interactive Setup
For automated deployments or CI/CD pipelines, configure it directly:
Openclaw onboard --anthropic-api-key "$ANTHROPIC_API_KEY"
Manual Configuration
Alternatively, you can directly edit your ~/.Openclaw/Openclaw.json to define the key and set your primary model:
{
"env": { "ANTHROPIC_API_KEY": "sk-ant-..." },
"agents": {
"defaults": {
"model": { "primary": "anthropic/claude-opus-4-6" }
}
}
}
Available Claude Models
Openclaw supports the full Anthropic model lineup:
- claude-opus-4-6 — Most capable model for complex tasks
- claude-sonnet-4-5 — Balanced performance and speed
- claude-haiku-4-2 — Fastest responses for simple queries
Testing Your Setup
Once configured, test the connection:
Openclaw models test anthropic/claude-opus-4-6
Or start a quick chat:
Openclaw chat --model anthropic/claude-opus-4-6
Best Practices & Troubleshooting
Rate Limits: Anthropic enforces tiered rate limits. Monitor your usage in the Anthropic console to avoid throttling.
Cost Control: Set spending alerts in your Anthropic dashboard. Claude Opus is powerful but more expensive than Sonnet or Haiku.
Thinking Mode: Claude 4.6 models automatically enable adaptive thinking. Use --thinking off to disable if you need faster responses.
Token Errors: If you see authentication errors, verify your API key starts with sk-ant- and has not expired.
Next Steps
Your Openclaw agent now has access to industry-leading AI capabilities. Explore Elevated Mode Openclaw for advanced permissions, or configure additional channels to interact with your agent.
