Anthropic (Claude) with OpenClaw
Configure Claude Opus, Sonnet, and Haiku — OAuth or API key
Configure Claude Opus, Sonnet, and Haiku — OAuth or API key
Anthropic's Claude is the recommended LLM for OpenClaw: strong long-context handling, better resistance to prompt injection, and high-quality responses. OpenClaw supports Claude Pro and Claude Max subscriptions via OAuth (no API key needed) or API keys for pay-as-you-go or team access.
This guide covers model selection, OAuth vs API key authentication, and typical configuration.
Anthropic Pro or Max (100 or 200 requests per day) combined with Opus 4.6 gives the best balance of quality and cost. Use Opus 4.5 or Claude Sonnet for lighter workloads; Claude Haiku for fast, cheap tasks (heartbeats, simple lookups).
Configure model in your Gateway config, e.g. anthropic/claude-opus-4-6. Use tiered routing: reserve Opus for important conversations; use Haiku for scheduled checks and heartbeats. See Example Setups & Cost for patterns.
OAuth (subscription): If you have Claude Pro or Claude Max, you can authenticate with your subscription—no API key. Uses your subscription limits. More convenient for personal use. Set up during openclaw onboard or in the Setup Wizard.
API key: Create an API key at console.anthropic.com. Use for pay-as-you-go, team plans, or when you prefer key-based auth. Store in ~/.openclaw/credentials or via openclaw secrets.
{
"agent": {
"model": "anthropic/claude-opus-4-6"
}
}
Authentication is typically configured during onboarding or via environment variables. See Configuration guide for full options.