Remote OpenClaw Blog
OpenClaw Setup Model: How to Choose and Configure Your First AI Model
What changed
This post was reviewed and updated to reflect current deployment, security hardening, and operations guidance.
What should operators know about OpenClaw Setup Model: How to Choose and Configure Your First AI Model?
Answer: The AI model is the brain of your OpenClaw agent. It determines how well your agent understands messages, how accurately it responds, how quickly it generates replies, and how much it costs to operate. Choosing the right model is arguably the most important configuration decision you will make. This guide covers practical deployment decisions, security controls, and operations.
Complete guide to choosing and configuring your first AI model in OpenClaw. Model comparison table, pricing breakdown, setup wizard walkthrough, and how to switch models later.
Marketplace
Free skills and AI personas for OpenClaw — deploy a pre-built agent in 15 minutes.
Browse the Marketplace →Join the Community
Join 500+ OpenClaw operators sharing deployment guides, security configs, and workflow automations.
Why Model Selection Matters
The AI model is the brain of your OpenClaw agent. It determines how well your agent understands messages, how accurately it responds, how quickly it generates replies, and how much it costs to operate. Choosing the right model is arguably the most important configuration decision you will make.
The good news: you are not locked in. You can switch models at any time with a simple environment variable change. So the goal during initial setup is to pick a reasonable starting point, not to make a permanent decision. You can always optimize later based on real-world performance and cost data.
OpenClaw supports models from four categories of providers: Anthropic (Claude), OpenAI (GPT), DeepSeek, and local models via Ollama. Each has different strengths, speeds, and price points.
Model Comparison Table
Here is a head-to-head comparison of the most popular models for OpenClaw as of March 2026:
| Model | Provider | Quality | Speed | Cost/100 msgs | Best For |
|---|---|---|---|---|---|
| Claude Opus 4 | Anthropic | Exceptional | Slow | $2.40 | Complex analysis, research |
| Claude Sonnet 4 | Anthropic | Excellent | Fast | $0.60 | General purpose, business |
| Claude Haiku 3.5 | Anthropic | Very Good | Very Fast | $0.16 | Best balance for most users |
| GPT-4o | OpenAI | Excellent | Fast | $0.43 | General purpose, coding |
| GPT-4o mini | OpenAI | Good | Very Fast | $0.03 | Simple tasks, high volume |
| DeepSeek V3 | DeepSeek | Very Good | Fast | $0.05 | Budget quality balance |
| Gemini 2.0 Flash | Good | Very Fast | $0.02 | Ultra-cheap, fast responses | |
| Llama 3 8B | Ollama (local) | Good | Variable | $0.00 | Privacy, zero API cost |
| Phi-3 Mini | Ollama (local) | Decent | Variable | $0.00 | Low-resource hardware |
Cost per 100 messages assumes 500 input tokens and 300 output tokens per message on average. Actual costs vary based on conversation length and complexity.
Best Model by Use Case
Different use cases have different requirements. Here are recommendations based on what your agent will do:
Personal assistant (calendar, reminders, simple queries): Claude Haiku 3.5 or GPT-4o mini. These tasks do not require deep reasoning. Speed and cost matter more than quality. Haiku gives better quality for the price; GPT-4o mini is cheaper if budget is the primary concern.
Customer support bot (WhatsApp, Telegram): Claude Sonnet 4 or DeepSeek V3. Customer-facing bots need reliable, accurate responses. Sonnet is the premium choice with excellent nuance and instruction following. DeepSeek V3 is the budget alternative that still produces professional-quality responses.
Business operations (CRM updates, email processing, reporting): Claude Sonnet 4. Business tasks require accurate data extraction, reliable formatting, and consistent output quality. Sonnet excels at following complex instructions precisely, which is critical for automated business processes.
Content creation (social media, blog drafts, newsletters): Claude Sonnet 4 or GPT-4o. Both produce high-quality creative content. Claude tends to be better at matching specific tones and styles. GPT-4o is slightly better at creative variation.
Code generation and technical tasks: Claude Sonnet 4 or GPT-4o. Both are strong at code generation. Claude has a slight edge in understanding complex codebases; GPT-4o is slightly faster for quick snippets.
Maximum privacy (no external API calls): Ollama with Llama 3 8B or Phi-3 Mini. All processing happens locally. No data leaves your server. The tradeoff is lower quality and slower speed compared to cloud models.
Ultra-budget (minimize spend): Gemini 2.0 Flash or GPT-4o mini for cloud. Ollama for zero cost. These models handle simple tasks well but struggle with complex reasoning or nuanced instructions.
Model Selection in the Setup Wizard
When you first access the OpenClaw web UI after deployment, the setup wizard walks you through initial configuration. The model selection step is the third screen (after setting the gateway token and admin password).
The wizard presents a simplified list of recommended models grouped by priority:
- Recommended: Claude Sonnet 4 — labeled as the best general-purpose option
- Budget-Friendly: DeepSeek V3 — labeled as the best value
- Fast & Cheap: GPT-4o mini — labeled for high-volume, simple tasks
- Local (No API Key): Ollama — labeled for privacy and zero cost
Select your provider, enter your API key (or Ollama URL for local models), and the wizard validates the connection by sending a test prompt. If the test succeeds, you see a green checkmark and can proceed.
The wizard only configures your primary model. To set up fallback models or multi-model routing, you need to edit the environment variables directly after completing the wizard. This is covered in the multi-model routing section below.
Manual Model Configuration
If you prefer to configure the model directly via environment variables (skipping the wizard), here are the settings for each provider:
Anthropic (Claude):
OPENCLAW_MODEL_PROVIDER=anthropic
OPENCLAW_MODEL_NAME=claude-sonnet-4-20250514
ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
OpenAI (GPT):
OPENCLAW_MODEL_PROVIDER=openai
OPENCLAW_MODEL_NAME=gpt-4o
OPENAI_API_KEY=sk-your-key-here
DeepSeek:
OPENCLAW_MODEL_PROVIDER=deepseek
OPENCLAW_MODEL_NAME=deepseek-chat
DEEPSEEK_API_KEY=your-key-here
Ollama (local):
OPENCLAW_MODEL_PROVIDER=ollama
OPENCLAW_MODEL_NAME=llama3:8b
OLLAMA_BASE_URL=http://host.docker.internal:11434
Add these to your docker-compose.yml environment section and restart the container.
Multi-Model Routing Setup
Multi-model routing is one of OpenClaw's most powerful features. It lets you use different models for different purposes — cheap models for simple tasks, expensive models for complex ones. This can reduce your API costs by 60-80% while maintaining quality where it matters.
Configure fallback models:
# Primary model for complex tasks
OPENCLAW_MODEL_PROVIDER=anthropic
OPENCLAW_MODEL_NAME=claude-sonnet-4-20250514
ANTHROPIC_API_KEY=sk-ant-api03-your-key
# Fallback 1 for when primary is rate-limited
OPENCLAW_FALLBACK_1_PROVIDER=openai
OPENCLAW_FALLBACK_1_MODEL=gpt-4o
OPENAI_API_KEY=sk-your-key
# Fallback 2 for ultra-cheap routing decisions
OPENCLAW_FALLBACK_2_PROVIDER=deepseek
OPENCLAW_FALLBACK_2_MODEL=deepseek-chat
DEEPSEEK_API_KEY=your-key
OpenClaw uses the primary model by default. If it hits a rate limit or encounters an error, it automatically falls back to the next model in the chain. You can also configure task-based routing where specific task types always use a specific model, but this requires editing the agent's persona prompt to include routing instructions.
How to Switch Models Later
Switching models is simple and non-destructive. Your conversation history, memory, skills, and all other configuration remain intact. Only the model processing new messages changes.
- Edit your
docker-compose.ymland change theOPENCLAW_MODEL_PROVIDERandOPENCLAW_MODEL_NAMEvalues - Add the new provider's API key if switching providers
- Restart:
docker compose down && docker compose up -d
The switch takes effect immediately. The next message your agent processes will use the new model. There is no migration, no data conversion, no downtime beyond the few seconds of container restart.
One thing to be aware of: different models have different strengths, so your agent's behavior may change slightly when you switch. A persona prompt optimized for Claude may produce slightly different results on GPT-4o. If you notice quality differences after switching, review and tune your persona prompt for the new model.
Using Local Models with Ollama
Ollama lets you run AI models locally on your own hardware with zero API costs. This is ideal for privacy-focused deployments, offline operation, or operators who want to eliminate recurring API expenses.
Install Ollama on your server:
curl -fsSL https://ollama.com/install.sh | sh
Pull a model:
ollama pull llama3:8b
Configure OpenClaw to use Ollama:
OPENCLAW_MODEL_PROVIDER=ollama
OPENCLAW_MODEL_NAME=llama3:8b
OLLAMA_BASE_URL=http://host.docker.internal:11434
The host.docker.internal hostname allows the OpenClaw Docker container to reach Ollama running on the host machine. If Ollama is running in its own container, use the container name instead.
Local model quality depends on your hardware. On a VPS with 4-8GB RAM, models up to 8B parameters run well. On a Raspberry Pi 5, stick to models under 4B parameters. On a powerful desktop or workstation, you can run models up to 70B parameters.
The hybrid approach is popular: use Ollama for simple, frequent tasks (message routing, quick lookups) and route complex tasks to a cloud API. This gives you the cost savings of local models for the majority of interactions while maintaining high quality for important tasks.
Frequently Asked Questions
What is the best AI model for OpenClaw beginners?
Claude Haiku 3.5 offers the best balance of quality, speed, and cost. It is capable enough for most tasks, fast enough for real-time conversations, and costs roughly $0.16/day for 100 messages. If cost is the top priority, DeepSeek V3 at $0.05/day is excellent. If quality is the top priority, Claude Sonnet 4 is the best available.
Can I change the AI model in OpenClaw after setup?
Yes. Changing the model is a simple environment variable change. Update OPENCLAW_MODEL_PROVIDER and OPENCLAW_MODEL_NAME in your docker-compose.yml and restart. You can switch models at any time without losing conversation history, memory, or configuration.
Can OpenClaw use multiple AI models at the same time?
Yes. OpenClaw supports multi-model routing, where different models handle different types of tasks. You configure a primary model and one or more fallback models. You can also route specific task types to specific models. This is configured through environment variables.
Does OpenClaw work with local AI models?
Yes. OpenClaw supports local models through Ollama integration. Set OPENCLAW_MODEL_PROVIDER=ollama and OPENCLAW_MODEL_NAME to any model available in your Ollama instance. Local models have zero API cost but require sufficient hardware to run.
