🦞OpenClaw Guide
← All guides
Easy⏱️ 2 minutes

How to Change AI Model in OpenClaw (Claude, GPT-4, Gemini)

Switch AI models in OpenClaw with /model or edit openclaw.json. Supports Claude Opus, Sonnet, GPT-4, Gemini, MiniMax, and 20+ models. Change per-session or set a default.

😫 The Problem

You want to use a different AI model in OpenClaw — maybe Claude for coding, GPT-4 for writing, or a cheaper model for simple tasks. But you're not sure how to switch.

The Solution

OpenClaw makes model switching simple. Use the /model command in any chat to switch instantly, or edit your config for a permanent change. You can even set different models per agent or per session.

Step by Step

1

Quick switch via chat: Type /model in any OpenClaw chat (WhatsApp, Telegram, Discord, or CLI). You'll see a list of configured models. Select the one you want. This changes the model for your current session only.

2

Switch with command: Send /model claude-opus-4-6 or /model gpt-4 to switch directly. Use /model default to reset to your configured default.

3

Per-session model: Each conversation can use a different model. Your Telegram chat can use Claude while your WhatsApp uses GPT-4.

4

Change default model: Edit ~/.openclaw/openclaw.json and set agent.model to your preferred model ID. Example: { "agent": { "model": "anthropic/claude-sonnet-4" } }. Restart the gateway for changes to take effect.

5

Add new providers: To use models from different providers, add API keys in your config under models.providers. OpenClaw supports Anthropic, OpenAI, Google, MiniMax, OpenRouter, and more.

6

Model aliases: Set up short aliases like opus, sonnet, gpt4 for quick switching. Configure in models.aliases in your config.

7

Cost optimization: Use expensive models (Opus) for complex tasks and cheaper models (MiniMax, Sonnet) for simple queries. The /model command makes switching instant.

8

Best models by task: Claude Opus for complex reasoning, Claude Sonnet for coding, GPT-4 for creative writing, Gemini for speed, MiniMax M2.1 for cost-effective general use.

9

Easiest option: Use OpenClaw Cloud at cloud.getopenclaw.ai — all models pre-configured, switch with one click, no API keys to manage.

🔥 Your AI should run your business, not just answer questions.

We'll show you how.Free to join.

Join Vibe Combinator →

🐙 Your AI should run your business.

Weekly live builds + template vault. We'll show you how to make AI actually work.Free to join.

Join Vibe Combinator →