Skip to main content
๐ŸฆžSimplifyClaw/Blog
April 1, 2026 ยท 4 min read
openclaw

How to Switch AI Models on OpenClaw Without Redeploying

Step-by-step guide to changing your OpenClaw agent's AI model from Claude to Gemini, GPT-4o, or back โ€” without touching your server setup.

SimplifyClawยท4 min readยทApril 1, 2026

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:

  1. The active model config โ€” tells OpenClaw which model to use for new conversations
  2. 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

bash
openclaw config set agents.defaults.model.primary "PROVIDER/MODEL_ID"

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:

json
{
  "version": 1,
  "profiles": {
    "anthropic:default": {
      "type": "api_key",
      "provider": "anthropic",
      "key": "sk-ant-..."
    },
    "google:default": {
      "type": "api_key",
      "provider": "google",
      "key": "AIza..."
    },
    "openai:default": {
      "type": "api_key",
      "provider": "openai",
      "key": "sk-..."
    }
  }
}

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

bash
openclaw gateway restart

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:

bash
openclaw config get agents.defaults.model.primary

Switching Back

Same process โ€” update the model primary and restart:

bash
openclaw config set agents.defaults.model.primary "anthropic/claude-sonnet-4-6"
openclaw gateway 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.

Skip the setup

Deploy your OpenClaw agent in 60 seconds.

SimplifyClaw handles the server, watchdog, SSL, and Telegram setup. Sign in with Google, add your API key, and your agent is live.

โœ“ Zero server setup
โœ“ 24/7 uptime + auto-restart
โœ“ Bring your own API key
โœ“ Cancel anytime
Deploy my agent โ†’Plans from $9.99/mo