One of OpenClaw's best features is model flexibility โ you can run Claude today, switch to Gemini tomorrow, and go back to GPT-4o next week without reinstalling anything or changing your Telegram setup.
Here's the complete process for switching models on a self-hosted OpenClaw instance.
What Changes When You Switch Models
Switching models touches two things:
- The active model config โ tells OpenClaw which model to use for new conversations
- The auth-profiles.json โ contains the API key for the new provider (if you're switching providers)
Your Telegram setup, gateway service, and all other config stay exactly the same.
Step 1: Update the Model Config
Model IDs:
- Claude Sonnet:
anthropic/claude-sonnet-4-6 - Claude Opus:
anthropic/claude-opus-4-6 - GPT-4o:
openai/gpt-4o - Gemini Flash:
google/gemini-2.0-flash - Gemini Pro:
google/gemini-2.0-pro
Important: Use model.primary, not model. Using model directly causes a type validation error โ it expects an object, not a string.
Step 2: Add the New Provider's API Key (If Switching Providers)
If you're switching to a different AI company (e.g., from Anthropic to Google), you need to add the new API key to your auth profiles. Existing keys stay in the file.
Edit ~/.openclaw/agents/main/agent/auth-profiles.json:
You can have all three providers configured simultaneously. OpenClaw uses whichever one matches the model you set in Step 1.
Step 3: Restart the Gateway
The change takes effect immediately after restart. No need to clear sessions, reinstall anything, or reconfigure Telegram.
Step 4: Test the New Model
Send a quick message to your bot to confirm the switch worked:
"What AI model are you running on right now?"
A correctly configured agent will identify its current model. If it still says the old one, check that the config was saved:
Switching Back
Same process โ update the model primary and restart:
Why You Might Switch Models
Switch to Gemini Flash when:
- You're doing high-volume tasks (lots of emails, frequent lookups)
- Speed matters more than reasoning depth
- You want to reduce API costs significantly
Switch to Claude when:
- You have complex reasoning tasks, writing projects, or nuanced decisions
- You want the best agentic behavior for multi-step tasks
Switch to GPT-4o when:
- You need the broadest compatibility with OpenClaw plugins and integrations
- You're doing a lot of coding or technical tasks
The SimplifyClaw Way
With SimplifyClaw, model switching happens from your dashboard in one click โ no terminal, no config file editing, no manual restart. Select the model from a dropdown, hit save, and your agent picks it up in seconds.
If you don't have an agent yet, start with SimplifyClaw and you can experiment with all three providers without touching a config file.