Cloud Models
Cloud-hosted models are the fastest way to get started with OpenClaw. They require no local hardware beyond an internet connection and an API key from the provider.
OpenAI
Available Models
| Model | Identifier | Context Window | Best For |
|---|---|---|---|
| GPT-4o | openai/gpt-4o | 128K tokens | General-purpose, tool calling |
| GPT-4o Mini | openai/gpt-4o-mini | 128K tokens | Cost-efficient tasks |
| o1 | openai/o1 | 200K tokens | Complex reasoning |
| o3 | openai/o3 | 200K tokens | Advanced reasoning, code |
| o3-mini | openai/o3-mini | 200K tokens | Efficient reasoning |
Setup
- Create an account at platform.openai.com.
- Navigate to API Keys and create a new key.
- Add the key to your environment:
openclaw secrets set OPENAI_API_KEY - Configure in
config.yaml:models:
openai:
api_key: ${OPENAI_API_KEY}
default_model: gpt-4o
organization: org-abc123 # Optional
Rate Limits
OpenAI enforces rate limits based on your account tier. OpenClaw automatically retries with exponential backoff when rate limited. Configure retry behavior:
models:
openai:
api_key: ${OPENAI_API_KEY}
retry:
max_attempts: 3
backoff: exponential
Anthropic
Available Models
| Model | Identifier | Context Window | Best For |
|---|---|---|---|
| Claude Opus 4.6 | anthropic/claude-opus-4-6 | 200K tokens | Complex analysis, coding |
| Claude Sonnet 4.6 | anthropic/claude-sonnet-4-6 | 200K tokens | Balanced performance/cost |
| Claude Haiku 4.5 | anthropic/claude-haiku-4-5 | 200K tokens | Fast, cost-efficient tasks |
Setup
- Create an account at console.anthropic.com.
- Navigate to API Keys and generate a key.
- Add the key:
openclaw secrets set ANTHROPIC_API_KEY - Configure:
models:
anthropic:
api_key: ${ANTHROPIC_API_KEY}
default_model: claude-sonnet
Extended Thinking
Claude models support extended thinking for complex reasoning tasks. Enable it per agent:
agents:
reasoning-agent:
model: anthropic/claude-sonnet-4.6
model_options:
extended_thinking: true
budget_tokens: 10000
Google Gemini
Available Models
| Model | Identifier | Context Window | Best For |
|---|---|---|---|
| Gemini 2.5 Pro | google/gemini-2.5-pro | 1M tokens | Large context, complex reasoning |
| Gemini 2.5 Flash | google/gemini-2.5-flash | 1M tokens | Fast, cost-efficient |
Setup
- Go to aistudio.google.com.
- Click Get API Key and create a key.
- Add the key:
openclaw secrets set GOOGLE_API_KEY - Configure:
models:
google:
api_key: ${GOOGLE_API_KEY}
default_model: gemini-2.5-pro
Gemini 2.5's 1-million-token context window is ideal for agents that process very large documents.
Other Providers
Mistral AI
models:
mistral:
api_key: ${MISTRAL_API_KEY}
default_model: mistral-large
Available models: mistral-large, mistral-medium, mistral-small, codestral.
Cohere
models:
cohere:
api_key: ${COHERE_API_KEY}
default_model: command-r-plus
Available models: command-r-plus, command-r.
OpenRouter
OpenRouter provides access to many models through a single API key:
models:
openrouter:
api_key: ${OPENROUTER_API_KEY}
base_url: https://openrouter.ai/api/v1
default_model: anthropic/claude-sonnet-4.6
Pricing Comparison
Approximate pricing per 1 million tokens (as of early 2026):
| Model | Input Cost | Output Cost | Relative Cost |
|---|---|---|---|
| GPT-4o | $2.50 | $10.00 | Medium |
| GPT-4o Mini | $0.15 | $0.60 | Very Low |
| Claude Opus 4.6 | $5.00 | $25.00 | High |
| Claude Sonnet 4.6 | $3.00 | $15.00 | Medium |
| Claude Haiku 4.5 | $1.00 | $5.00 | Low |
| Gemini 2.5 Pro | $1.25 | $10.00 | Low-Medium |
| Gemini 2.5 Flash | $0.30 | $2.50 | Low |
Prices change frequently. Check each provider's pricing page for current rates.
Model Selection Tips
- Start with a mid-tier model (Claude Sonnet 4.6, GPT-4o) and optimize later.
- Use mini/flash models for high-volume, simple tasks (classification, extraction).
- Reserve premium models (Claude Opus 4.6, o3) for complex reasoning and analysis.
- Configure fallbacks so your agents stay operational during provider outages.
- Monitor costs with
openclaw usageto catch unexpected spending.
Model Aliases & Fallbacks
In production environments, hardcoding specific model versions (like claude-3-5-sonnet-20261022) across dozens of agents can be risky. If a model endpoint is deprecated or experiences an outage, your agents will fail. OpenClaw solves this using Aliases and Fallbacks.
Aliases
You can map a human-readable alias (e.g., smart, fast, cheap) to a specific model identifier using the CLI.
# Map the 'smart' alias to the latest Claude model
openclaw models aliases add smart anthropic/claude-sonnet-4.6
# Map the 'fast' alias to GPT-4o Mini
openclaw models aliases add fast openai/gpt-4o-mini
Inside your config.yaml, you can now use these aliases instead of the full model path:
agents:
customer-support:
model: alias/smart
When Anthropic releases Claude 3.6, you simply update the alias once via the CLI, and all agents using alias/smart will instantly swap to the new model without needing a config file change.
Fallbacks
If a primary provider goes down, OpenClaw can automatically route prompts to a fallback model.
# Set GPT-4o as the fallback if Claude Sonnet fails
openclaw models fallbacks add anthropic/claude-sonnet-4.6 openai/gpt-4o
Custom API Endpoints
For providers that offer OpenAI-compatible APIs, use the base_url override:
models:
custom:
api_key: ${CUSTOM_API_KEY}
base_url: https://my-company-api.example.com/v1
default_model: my-custom-model
This works with Azure OpenAI, AWS Bedrock (with a proxy), and self-hosted inference servers.
Next Steps
- Set up Local Models with Ollama for offline and private use.
- Review Model Overview for selection strategy.
- Manage your API keys securely with API Key Management.