Picking a provider
OpenClaw doesn't care which brain it uses, which is the whole point. The trade-off is quality versus cost versus privacy:
- Claude — the default for a reason. Strong at long tasks and following multi-step instructions, which is exactly what an agent does. Mid-priced.
- OpenAI — the all-rounder. Broad and fast, slightly cheaper than Claude at some tiers.
- OpenRouter — one API key that fronts many models. Useful if you want to swap providers without reconfiguring every time.
- Gemini — cheap at the low end, with a generous free tier. Good for high-volume simple tasks.
- Ollama — a local model on your own hardware. Zero API cost and nothing leaves your machine. Slower and less capable for hard tasks. Covered in its own guide.
Getting a key
Whatever provider you pick, the flow is the same: create an account, go to the API or keys page, create a key, and copy it once. Most providers show the key exactly once, so store it in a password manager before you click away. Set a billing cap on the account too — a runaway agent can burn through credit faster than you'd expect.
Wiring it in
Set the provider and key in config, then restart:
openclaw config set model.provider "anthropic"
openclaw config set model.apiKey "sk-ant-..."
The exact key names differ between releases, so if model.apiKey errors, check the current config docs. The important thing is that the key ends up in the config file, not pasted into a chat message where it leaks into the conversation log.
What it costs
Don't guess at this — an agent makes far more calls than a chatbot, because every step in a multi-step task is another round trip. A "cheap" per-token rate can still add up fast when the agent loops. Start on the cheapest model that does the job, watch your usage dashboard for a week, and only step up if the output quality is actually holding you back. For most people, the bottleneck is the task definition, not the model.