openclawmodelsconfiguration

How to Switch AI Models on OpenClaw Without Redeploying

April 1, 2026·4 min read

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

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:

{
  "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

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:

openclaw config get agents.defaults.model.primary

Switching Back

Same process — update the model primary and restart:

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 entirely

SimplifyClaw deploys your OpenClaw agent in 60 seconds. No server, no terminal, no config files.

Deploy your agent →

$39/month · 7-day money-back guarantee