OpenClaw Setup Guide: Choosing the Right Models for Your Agent
Step-by-step guide to configuring OpenClaw with the right AI models for your workflow. Includes budget, balanced, and premium configuration templates.
OpenClaw Setup Guide: Choosing the Right Models for Your Agent
OpenClaw has exploded in popularity since its launch, with 40,000+ GitHub stars in under three months. If you're setting it up for the first time, one of the most important decisions is which AI models to use, and it's not as simple as picking the "best" one.
Different tasks need different models. Your email agent doesn't need a $15/M-token frontier model. Your coding agent probably does need something better than a free model. Getting this right can save you hundreds of dollars per month.
Understanding the OpenClaw Config
OpenClaw's configuration lives in a JSON5 file. The key model settings are:
model.primary: The default model for most tasksmodel.fallbacks: Backup models if the primary is unavailablesubagents.model: Model for delegated sub-tasks (cheaper is better)imageModel.primary: Model for image analysis tasksthinkingDefault: How much reasoning the model does (affects cost and quality)
Three Configuration Templates
1. Budget Config (Under $10/month)
For personal use, hobby projects, or getting started:
{
agents: {
defaults: {
model: {
primary: "openrouter/deepseek/deepseek-v3.2",
fallbacks: ["openrouter/deepseek/deepseek-r1:free"]
},
imageModel: {
primary: "openrouter/qwen/qwen-2.5-vl-72b-instruct:free"
},
subagents: {
model: "openrouter/meta-llama/llama-3.3-70b-instruct:free",
maxConcurrent: 1
},
thinkingDefault: "off",
maxConcurrent: 2,
timeoutSeconds: 300
}
}
}
Why this works: DeepSeek V3.2 is remarkably capable at $0.25/$0.38 per 1M tokens. The free fallbacks handle simple tasks at zero cost. Total monthly cost for moderate usage: $5-10.
2. Balanced Config (Developer Sweet Spot)
For active developers who need reliable quality:
{
agents: {
defaults: {
model: {
primary: "anthropic/claude-sonnet-4-5",
fallbacks: ["openrouter/deepseek/deepseek-v3.2"]
},
imageModel: {
primary: "openrouter/google/gemini-3-flash"
},
subagents: {
model: "openrouter/deepseek/deepseek-v3.2",
maxConcurrent: 2,
archiveAfterMinutes: 60
},
thinkingDefault: "medium",
maxConcurrent: 3,
timeoutSeconds: 600,
contextTokens: 200000
}
}
}
Why this works: Claude Sonnet 4.5 handles complex coding and analysis tasks excellently, while DeepSeek V3.2 handles subagent work at 1/50th the cost. Total monthly cost: $30-80.
3. Premium Config (Maximum Quality)
For professional use, agency work, or critical tasks:
{
agents: {
defaults: {
model: {
primary: "anthropic/claude-opus-4-5",
fallbacks: ["anthropic/claude-sonnet-4-5"]
},
imageModel: {
primary: "openrouter/google/gemini-3-pro"
},
subagents: {
model: "openrouter/minimax/MiniMax-M2.1",
maxConcurrent: 3
},
thinkingDefault: "high",
maxConcurrent: 5,
timeoutSeconds: 900,
contextTokens: 200000
}
}
}
Why this works: Opus 4.5 is the quality leader with Sonnet as a capable fallback. MiniMax handles subagent tasks affordably. Total monthly cost: $100-300.
Setting Up OpenRouter
All configurations above use OpenRouter for model access. Here's how to set it up:
- Create an account at openrouter.ai
- Generate an API key
- Add it to your OpenClaw config:
{
env: { OPENROUTER_API_KEY: "sk-or-your-key-here" },
agents: {
// ... your config
}
}
OpenRouter gives you access to 200+ models through a single API key, making it easy to switch between providers without changing credentials.
Tips for Optimizing Costs
- Use tiered models. Don't use your primary model for simple tasks. Set a cheap subagent model.
- Lower thinking for simple tasks. Set
thinkingDefault: "off"for email and simple queries. Use"medium"or"high"only for complex reasoning. - Set reasonable timeouts. Longer timeouts = more tokens burned. 300 seconds is fine for most tasks.
- Limit concurrency. More concurrent agents = more parallel API calls = higher costs.
- Monitor usage. Check OpenRouter's dashboard to see which models and tasks consume the most tokens.
What's Next
Use our Config Generator to build a custom OpenClaw configuration based on your specific needs, or try the AI Model Selector to find the best models for your task mix.
For cost estimates before you commit, the Cost Calculator shows side-by-side comparisons across budget, balanced, and premium setups.
For a detailed breakdown of model quality and pricing, see our Best AI Models for Coding in 2026. And to understand how token usage drives your bill, read the Token Counting guide.