Models: defaults, selection, aliases, switching
What is the "default model"?
What is the "default model"?
provider/model refs (example: openai/gpt-5.5,
anthropic/claude-sonnet-4-6). Always set provider/model explicitly. If
you omit the provider, OpenClaw tries an alias match first, then a unique
configured-provider match for that model id, then falls back to the
configured default provider (deprecated compatibility path). If that
provider no longer has the configured default model, OpenClaw falls back
to the first configured provider/model instead of a stale default.What model do you recommend?
What model do you recommend?
How do I switch models without wiping my config?
How do I switch models without wiping my config?
/modelin chat (per-session, see Slash commands)openclaw models set ...(updates just model config)openclaw configure --section model(interactive)- edit
agents.defaults.modelin~/.openclaw/openclaw.jsondirectly
config.schema.lookup first (normalized
path, shallow schema docs, child summaries), then prefer config.patch
over config.apply with a partial object. If you did overwrite config,
restore from backup or run openclaw doctor to repair.Docs: Models, Configure,
Config, Doctor.Can I use self-hosted models (llama.cpp, vLLM, Ollama)?
Can I use self-hosted models (llama.cpp, vLLM, Ollama)?
- Install Ollama from
https://ollama.com/download - Pull a local model, e.g.
ollama pull gemma4 - For cloud models too, run
ollama signin - Run
openclaw onboard, chooseOllama, thenLocalorCloud + Local
Cloud + Local gives you cloud models plus your local Ollama models;
cloud models such as kimi-k2.5:cloud need no local pull. To switch
manually: openclaw models list, then openclaw models set ollama/<model>.Smaller/heavily quantized models are more vulnerable to prompt injection.
Use large models for any bot with tool access; if you use small models
anyway, enable sandboxing and strict tool allowlists.Docs: Ollama, Local models,
Model providers, Security,
Sandboxing.How do I switch models on the fly (without restarting)?
How do I switch models on the fly (without restarting)?
/model <name> as a standalone message. See
Slash commands for the
full command list, including the numbered picker (/model, /model list, /model 3), /model default to clear a session override, and
/model status for endpoint/API-mode detail.Force a specific auth profile per session with @profile:@profile, re-run /model without the
suffix (e.g. /model anthropic/claude-opus-4-6), or pick the default from
/model. Use /model status to confirm the active auth profile.If two providers expose the same model id, which one does /model use?
If two providers expose the same model id, which one does /model use?
/model provider/model selects that exact provider route. For example,
qianfan/deepseek-v4-flash and deepseek/deepseek-v4-flash are different
refs even though the model id matches — OpenClaw does not silently switch
providers on a bare id match.A user-selected /model ref is strict for fallback: if that
provider/model becomes unavailable, the reply fails visibly instead of
falling back to agents.defaults.model.fallbacks. Configured fallback
chains still apply to configured defaults, cron job primaries, and
auto-selected fallback state. When a non-session-override run is allowed
to use fallback, OpenClaw tries the requested provider/model first, then
configured fallbacks, then the configured primary — so duplicate bare
model ids never jump straight back to the default provider.See Models and Model failover.Can I use GPT 5.5 for daily tasks and Codex 5.5 for coding?
Can I use GPT 5.5 for daily tasks and Codex 5.5 for coding?
- Native Codex coding agent: set
agents.defaults.model.primarytoopenai/gpt-5.5. Sign in withopenclaw models auth login --provider openaifor ChatGPT/Codex subscription auth. - Direct OpenAI API tasks outside the agent loop: configure
OPENAI_API_KEYfor images, embeddings, speech, realtime, and other non-agent OpenAI API surfaces. - OpenAI agent API-key auth:
/model openai/gpt-5.5with an orderedopenaiAPI-key profile. - Sub-agents: route coding tasks to a Codex-focused agent with its
own
openai/gpt-5.5model.
How do I configure fast mode for GPT 5.5?
How do I configure fast mode for GPT 5.5?
- Per session: send
/fast onwhile usingopenai/gpt-5.5. - Per model default: set
agents.defaults.models["openai/gpt-5.5"].params.fastModetotrue. - Automatic cutoff:
/fast autoorparams.fastMode: "auto"runs new model calls fast until the cutoff, then runs later retry, fallback, tool-result, or continuation calls without fast mode. Cutoff defaults to 60 seconds; override withparams.fastAutoOnSecondson the model.
service_tier = "priority" on native OpenAI Responses
requests; existing service_tier values are preserved and fast mode does
not rewrite reasoning or text.verbosity. Session /fast overrides beat
config defaults.See Thinking and fast mode and the Fast mode section
under Advanced configuration on the OpenAI provider
page.Why do I see "Model ... is not allowed" and then no reply?
Why do I see "Model ... is not allowed" and then no reply?
agents.defaults.models is set, it becomes the allowlist for
/model and session overrides. Picking a model outside that list returns
this instead of a normal reply:agents.defaults.models, add a provider
wildcard such as "provider/*": {} for dynamic catalogs, remove the
allowlist, or pick a model from /model list. If the command also
included --runtime codex, update the allowlist first, then retry the
same /model provider/model --runtime codex command.Why do I see "Unknown model: minimax/MiniMax-M3"?
Why do I see "Unknown model: minimax/MiniMax-M3"?
main) and restart the gateway — MiniMax-M3 may not be in your
installed release’s catalog yet. Otherwise the MiniMax provider is not
configured (no provider entry or auth profile found), so the model can’t
resolve. See the Troubleshooting section on the
MiniMax provider page for the full fix checklist,
provider/model id table, and config-block example.Can I use MiniMax as my default and OpenAI for complex tasks?
Can I use MiniMax as my default and OpenAI for complex tasks?
/model or a separate agent.Option A: switch per session/model gpt.Option B: separate agents — Agent A defaults to MiniMax, Agent B
defaults to OpenAI; route by agent or use /agent to switch.Docs: Models, Multi-Agent Routing,
MiniMax, OpenAI.Are opus / sonnet / gpt built-in shortcuts?
Are opus / sonnet / gpt built-in shortcuts?
agents.defaults.models:| Alias | Resolves to |
|---|---|
opus | anthropic/claude-opus-4-8 |
sonnet | anthropic/claude-sonnet-4-6 |
gpt | openai/gpt-5.4 |
gpt-mini | openai/gpt-5.4-mini |
gpt-nano | openai/gpt-5.4-nano |
gemini | google/gemini-3.1-pro-preview |
gemini-flash | google/gemini-3-flash-preview |
gemini-flash-lite | google/gemini-3.1-flash-lite |
How do I define/override model shortcuts (aliases)?
How do I define/override model shortcuts (aliases)?
agents.defaults.models.<modelId>.alias:/model sonnet (or /<alias> when supported) resolves to that
model id.How do I add models from other providers like OpenRouter or Z.AI?
How do I add models from other providers like OpenRouter or Z.AI?
No API key found for provider "zai").No API key found for provider after adding a new agentA new agent has an empty auth store — auth is per-agent, stored at:openclaw agents add <id> and configure auth in the wizard, or
copy only portable static api_key/token profiles from the main
agent’s store. For OAuth, sign in from the new agent when it needs its
own account. See Multi-Agent Routing for the
full agentDir reuse and credential-sharing rules — never reuse
agentDir across agents.Model failover and “All models failed”
How does failover work?
How does failover work?
- Auth profile rotation within the same provider.
- Model fallback to the next model in
agents.defaults.model.fallbacks.
429: Too many concurrent requests, ThrottlingException, concurrency limit reached, workers_ai ... quota limit exceeded, resource exhausted, and periodic
usage-window limits (weekly/monthly limit reached) all count as
failover-worthy rate limits.Billing responses aren’t always 402, and some 402s stay in the
transient/rate-limit bucket rather than the billing lane. Explicit
billing text on 401/403 can still route to billing; provider-specific
text matchers (e.g. OpenRouter Key limit exceeded) stay scoped to their
own provider. A 402 that reads like a retryable usage-window or
org/workspace spend limit (daily limit reached, resets tomorrow,
organization spending limit exceeded) is treated as rate_limit, not a
long billing disable.Context-overflow errors stay off the fallback path entirely — signatures
like request_too_large, input exceeds the maximum number of tokens,
input token count exceeds the maximum number of input tokens, input is too long for the model, or ollama error: context length exceeded go to
compaction/retry instead of advancing model fallback.Generic server-error text is narrower than “anything with unknown/error
in it”. Provider-scoped transient shapes that do count as failover
signals: Anthropic bare An unknown error occurred, OpenRouter bare
Provider returned error, stop-reason errors like Unhandled stop reason: error, JSON api_error payloads with transient server text (internal server error, unknown error, 520, upstream error, backend error),
and provider-busy errors like ModelNotReadyException when the provider
context matches. Generic internal fallback text like LLM request failed with an unknown error. stays conservative and does not trigger fallback
by itself.What does "No credentials found for profile anthropic:default" mean?
What does "No credentials found for profile anthropic:default" mean?
anthropic:default has no credentials in the
expected auth store.Fix checklist:- Confirm where profiles live — current:
~/.openclaw/agents/<agentId>/agent/auth-profiles.json; legacy:~/.openclaw/agent/*(migrated byopenclaw doctor). - Confirm the Gateway loads your env var.
ANTHROPIC_API_KEYset only in your shell won’t reach a Gateway run via systemd/launchd — put it in~/.openclaw/.envor enableenv.shellEnv. - Confirm you’re editing the right agent — multi-agent setups have
multiple
auth-profiles.jsonfiles. - Run
openclaw models statusto see configured models and provider auth state.
-
Use Claude CLI: run
openclaw models auth login --provider anthropic --method cli --set-defaulton the gateway host. -
Prefer an API key instead: put
ANTHROPIC_API_KEYin~/.openclaw/.envon the gateway host, then clear any pinned order that forces the missing profile: - Remote mode: auth profiles live on the gateway machine, not your laptop — confirm you’re running commands there.
Why did it also try Google Gemini and fail?
Why did it also try Google Gemini and fail?
No API key found for provider "google". Fix: add Google auth, or remove Google models from
agents.defaults.model.fallbacks/aliases.LLM request rejected: thinking signature required (Google Antigravity)Cause: session history has thinking blocks without signatures (often
from an aborted/partial stream); Google Antigravity requires signatures
on thinking blocks. OpenClaw strips unsigned thinking blocks for Google
Antigravity Claude; if it still appears, start a new session or set
/thinking off for that agent.Auth profiles: what they are and how to manage them
Related: /concepts/oauth (OAuth flows, token storage, multi-account patterns)What is an auth profile?
What is an auth profile?
openclaw models auth list (optionally --provider <id> or --json). See
Models CLI.What are typical profile IDs?
What are typical profile IDs?
anthropic:default (common when no email identity
exists), anthropic:<email> for OAuth identities, or a custom id you
choose (e.g. anthropic:work).Can I control which auth profile is tried first?
Can I control which auth profile is tried first?
auth.order.<provider> config sets rotation order per provider
(metadata only — no secrets stored).OpenClaw may skip a profile in a short cooldown (rate limits,
timeouts, auth failures) or a longer disabled state
(billing/insufficient credits). Inspect with openclaw models status --json and check auth.unusableProfiles. Tune with
auth.cooldowns.billingBackoffHours*. Rate-limit cooldowns can be
model-scoped — a profile cooling down for one model can still serve a
sibling model on the same provider; billing/disabled windows block the
whole profile.Set a per-agent order override (stored in that agent’s auth-state.json):openclaw models status --probe. A
stored profile omitted from an explicit order reports
excluded_by_auth_order instead of being tried silently.OAuth vs API key - what is the difference?
OAuth vs API key - what is the difference?
- OAuth / CLI login often uses subscription access where the
provider supports it. For Anthropic, OpenClaw’s Claude CLI backend
uses Claude Code
claude -p, which Anthropic currently treats as Agent SDK/programmatic usage drawing from subscription usage limits — see Anthropic for the current billing-pause status and source links. - API keys use pay-per-token billing.
Related
- FAQ — the main FAQ
- FAQ — quick start and first-run setup
- Model selection
- Model failover