Skip to main content

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

ModelIdentifierContext WindowBest For
GPT-4oopenai/gpt-4o128K tokensGeneral-purpose, tool calling
GPT-4o Miniopenai/gpt-4o-mini128K tokensCost-efficient tasks
o1openai/o1200K tokensComplex reasoning
o3openai/o3200K tokensAdvanced reasoning, code
o3-miniopenai/o3-mini200K tokensEfficient reasoning

Setup

  1. Create an account at platform.openai.com.
  2. Navigate to API Keys and create a new key.
  3. Add the key to your environment:
    openclaw secrets set OPENAI_API_KEY
  4. 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

ModelIdentifierContext WindowBest For
Claude Opus 4.6anthropic/claude-opus-4-6200K tokensComplex analysis, coding
Claude Sonnet 4.6anthropic/claude-sonnet-4-6200K tokensBalanced performance/cost
Claude Haiku 4.5anthropic/claude-haiku-4-5200K tokensFast, cost-efficient tasks

Setup

  1. Create an account at console.anthropic.com.
  2. Navigate to API Keys and generate a key.
  3. Add the key:
    openclaw secrets set ANTHROPIC_API_KEY
  4. 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

ModelIdentifierContext WindowBest For
Gemini 2.5 Progoogle/gemini-2.5-pro1M tokensLarge context, complex reasoning
Gemini 2.5 Flashgoogle/gemini-2.5-flash1M tokensFast, cost-efficient

Setup

  1. Go to aistudio.google.com.
  2. Click Get API Key and create a key.
  3. Add the key:
    openclaw secrets set GOOGLE_API_KEY
  4. 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):

ModelInput CostOutput CostRelative Cost
GPT-4o$2.50$10.00Medium
GPT-4o Mini$0.15$0.60Very Low
Claude Opus 4.6$5.00$25.00High
Claude Sonnet 4.6$3.00$15.00Medium
Claude Haiku 4.5$1.00$5.00Low
Gemini 2.5 Pro$1.25$10.00Low-Medium
Gemini 2.5 Flash$0.30$2.50Low

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 usage to 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