One of the first things you need to do after setting up OpenClaw is configure Model Providers. There are several options but these are the most common ones (and the ones that I have personally used):
- Configure OpenAI Codex provider – done via Codex OAuth. Run
openclaw onboard --auth-choice openai-codexoropenclaw models auth login --provider openai-codexand follow instructions to set it up. - Configure Anthropic API Key – set
ANTHROPIC_API_KEY=<your_key>in the openclaw.envfile. You can get your key from platform.claude.com. Restart gateway and it should pick this up automatically. - Configure Google Gemini API Key – Get your key from aistudio.google.com and configure it as
GEMINI_API_KEY=<your_key>in the openclaw.envfile. Restart gateway and it should pick this up automatically as well. - Configure Local Models via Ollama – Follow instructions for setting up Ollama on your local host. Then add the section to your
openclaw.jsonand restart the gateway – adjust to match the models you have setup in your ollama instance and context window, maxTokens for your hardware.
"models": {
"mode": "merge",
"providers": {
"ollama": {
"baseUrl": "http://127.0.0.1:11434/v1",
"apiKey": "ollama_secret",
"api": "openai-completions",
"models": [
{
"id": "qwen3.5:9b-q4_K_M",
"name": "Local Qwen3.5 9B (Q4)",
"reasoning": false,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 32768,
"maxTokens": 8192
}
]
}
}
}
- Other Popular Providers
- Claude OAuth with a Pro/Max subscription. This is a grey area as to whether or not your account will get banned for using it in this manner. I have not attempted this.
- Anti-Gravity OAuth with a Google AI Pro or other subscription. Definitely will get banned – do not attempt this.
Comparison Of Model Providers
OpenAI Codex
- Cost: $
- Availability: Excellent
- Capability: Very Good
- Limits: Generous — has 5-hour and weekly limits (seems to be separate from ChatGPT usage limits).
- Notes: Best value with great response times and reliable responses without throttling or errors.
Anthropic API Key
- Cost: $$$
- Availability: Good
- Capability: Excellent
- Limits: N/A
- Notes: Expensive, and you should expect rate limits and errors during peak times. However, it allows you to set the budget ahead of time to avoid billing surprises.
Gemini API Key
- Cost: $$
- Availability: OK
- Capability: Very Good
- Limits: N/A
- Notes: Good capabilities. The server-side logging and datasets feature is quite useful, although you can get the same (plus a lot more) from the session
.jsonlfiles as well. Expect rate limiting and errors during peak times. It does not have a set budget feature, but you do get a $10 credit per month with an AI Pro subscription.
Ollama Providers
- Cost: N/A
- Availability: N/A
- Capability: Low
- Limits: N/A
- Notes: Heavily dependent on your hardware. I have 12 GB VRAM – with this, I find running even basic back and forth for OpenClaw on any of the models listed above does not work well. In general, I think most consumer hardware is unlikely to be able to run a good enough model for general purpose OpenClaw like Agent usage.