FAQ: models and auth
Model- and auth-profile Q&A. For setup, sessions, gateway, channels, and troubleshooting, see the main FAQ.
Models: defaults, selection, aliases, switching
```agents.defaults.model.primary```
Models are referenced as `provider/model` (example: `openai/gpt-5.5` or `anthropic/claude-sonnet-4-6`). If you omit the provider, OpenClaw first tries an alias, then a unique configured-provider match for that exact model id, and only then falls back to the configured default provider as a deprecated compatibility path. If that provider no longer exposes the configured default model, OpenClaw falls back to the first configured provider/model instead of surfacing a stale removed-provider default. You should still **explicitly** set `provider/model`.MiniMax has its own docs: [MiniMax](/providers/minimax) and[Local models](/gateway/local-models).
Rule of thumb: use the **best model you can afford** for high-stakes work, and a cheapermodel for routine chat or summaries. You can route models per agent and use sub-agents toparallelize long tasks (each sub-agent consumes tokens). See [Models](/concepts/models) and[Sub-agents](/tools/subagents).
Strong warning: weaker/over-quantized models are more vulnerable to promptinjection and unsafe behavior. See [Security](/gateway/security).
More context: [Models](/concepts/models).Safe options:
- `/model` in chat (quick, per-session)- `openclaw models set ...` (updates just model config)- `openclaw configure --section model` (interactive)- edit `agents.defaults.model` in `~/.remoteclaw/remoteclaw.json`
Avoid `config.apply` with a partial object unless you intend to replace the whole config.For RPC edits, inspect with `config.schema.lookup` first and prefer `config.patch`. The lookup payload gives you the normalized path, shallow schema docs/constraints, and immediate child summaries.for partial updates.If you did overwrite config, restore from backup or re-run `openclaw doctor` to repair.
Docs: [Models](/concepts/models), [Configure](/cli/configure), [Config](/cli/config), [Doctor](/gateway/doctor).Quickest setup:
1. Install Ollama from `https://ollama.com/download`2. Pull a local model such as `ollama pull gemma4`3. If you want cloud models too, run `ollama signin`4. Run `openclaw onboard` and choose `Ollama`5. Pick `Local` or `Cloud + Local`
Notes:
- `Cloud + Local` gives you cloud models plus your local Ollama models- cloud models such as `kimi-k2.5:cloud` do not need a local pull- for manual switching, use `openclaw models list` and `openclaw models set ollama/<model>`
Security note: smaller or heavily quantized models are more vulnerable to promptinjection. We strongly recommend **large models** for any bot that can use tools.If you still want small models, enable sandboxing and strict tool allowlists.
Docs: [Ollama](/providers/ollama), [Local models](/gateway/local-models),[Model providers](/concepts/model-providers), [Security](/gateway/security),[Sandboxing](/gateway/sandboxing).```/model sonnet/model opus/model gpt/model gpt-mini/model gemini/model gemini-flash/model gemini-flash-lite```
These are the built-in aliases. Custom aliases can be added via `agents.defaults.models`.
You can list available models with `/model`, `/model list`, or `/model status`.
`/model` (and `/model list`) shows a compact, numbered picker. Select by number:
```/model 3```
You can also force a specific auth profile for the provider (per session):
```/model opus@anthropic:default/model opus@anthropic:work```
Tip: `/model status` shows which agent is active, which `auth-profiles.json` file is being used, and which auth profile will be tried next.It also shows the configured provider endpoint (`baseUrl`) and API mode (`api`) when available.
**How do I unpin a profile I set with @profile?**
Re-run `/model` **without** the `@profile` suffix:
```/model anthropic/claude-opus-4-6```
If you want to return to the default, pick it from `/model` (or send `/model <default provider/model>`).Use `/model status` to confirm which auth profile is active.For example, `qianfan/deepseek-v4-flash` and `deepseek/deepseek-v4-flash` are different model refs even though both contain `deepseek-v4-flash`. OpenClaw should not silently switch from one provider to the other just because the bare model id matches.
A user-selected `/model` ref is also strict for fallback policy. If that selected provider/model is unavailable, the reply fails visibly instead of answering from `agents.defaults.model.fallbacks`. Configured fallback chains still apply to configured defaults, cron job primaries, and auto-selected fallback state.
If a run that started from a non-session override is allowed to use fallback, OpenClaw tries the requested provider/model first, then configured fallbacks, and only then the configured primary. That prevents duplicate bare model ids from jumping directly back to the default provider.
See [Models](/concepts/models) and [Model failover](/concepts/model-failover).- **Native Codex coding agent:** set `agents.defaults.model.primary` to `openai/gpt-5.5`. Sign in with `openclaw models auth login --provider openai-codex` when you want ChatGPT/Codex subscription auth.- **Direct OpenAI API tasks outside the agent loop:** configure `OPENAI_API_KEY` for images, embeddings, speech, realtime, and other non-agent OpenAI API surfaces.- **OpenAI agent API-key auth:** use `/model openai/gpt-5.5` with an ordered `openai-codex` API-key profile.- **Sub-agents:** route coding tasks to a Codex-focused agent with its own `openai/gpt-5.5` model.
See [Models](/concepts/models) and [Slash commands](/tools/slash-commands).- **Per session:** send `/fast on` while the session is using `openai/gpt-5.5`.- **Per model default:** set `agents.defaults.models["openai/gpt-5.5"].params.fastMode` to `true`.
Example:
```json5{ agents: { defaults: { models: { "openai/gpt-5.5": { params: { fastMode: true, }, }, }, }, },}```
For OpenAI, fast mode maps to `service_tier = "priority"` on supported native Responses requests. Session `/fast` overrides beat config defaults.
See [Thinking and fast mode](/tools/thinking) and [OpenAI fast mode](/providers/openai#fast-mode).```Model "provider/model" is not allowed. Use /models to list providers, or /models <provider> to list models.Add it with: openclaw config set agents.defaults.models '{"provider/model":{}}' --strict-json --merge```
That error is returned **instead of** a normal reply. Fix: add the exact model to`agents.defaults.models`, add a provider wildcard such as `"provider/*": {}` for dynamic provider catalogs, remove the allowlist, or pick a model from `/model list`.If the command also included `--runtime codex`, update the allowlist first and then retrythe same `/model provider/model --runtime codex` command.Fix checklist:
1. Upgrade to a current OpenClaw release (or run from source `main`), then restart the gateway.2. Make sure MiniMax is configured (wizard or JSON), or that MiniMax auth exists in env/auth profiles so the matching provider can be injected (`MINIMAX_API_KEY` for `minimax`, `MINIMAX_OAUTH_TOKEN` or stored MiniMax OAuth for `minimax-portal`).3. Use the exact model id (case-sensitive) for your auth path: `minimax/MiniMax-M2.7` or `minimax/MiniMax-M2.7-highspeed` for API-key setup, or `minimax-portal/MiniMax-M2.7` / `minimax-portal/MiniMax-M2.7-highspeed` for OAuth setup.4. Run:
```bash openclaw models list ```
and pick from the list (or `/model list` in chat).
See [MiniMax](/providers/minimax) and [Models](/concepts/models).**Option A: switch per session**
```json5{ env: { MINIMAX_API_KEY: "sk-...", OPENAI_API_KEY: "sk-..." }, agents: { defaults: { model: { primary: "minimax/MiniMax-M2.7" }, models: { "minimax/MiniMax-M2.7": { alias: "minimax" }, "openai/gpt-5.5": { alias: "gpt" }, }, }, },}```
Then:
```/model gpt```
**Option B: separate agents**
- Agent A default: MiniMax- Agent B default: OpenAI- Route by agent or use `/agent` to switch
Docs: [Models](/concepts/models), [Multi-Agent Routing](/concepts/multi-agent), [MiniMax](/providers/minimax), [OpenAI](/providers/openai).- `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`
If you set your own alias with the same name, your value wins.```json5{ agents: { defaults: { model: { primary: "anthropic/claude-opus-4-6" }, models: { "anthropic/claude-opus-4-6": { alias: "opus" }, "anthropic/claude-sonnet-4-6": { alias: "sonnet" }, }, }, },}```
Then `/model sonnet` (or `/<alias>` when supported) resolves to that model ID.```json5{ agents: { defaults: { model: { primary: "openrouter/anthropic/claude-sonnet-4-6" }, models: { "openrouter/anthropic/claude-sonnet-4-6": {} }, }, }, env: { OPENROUTER_API_KEY: "sk-or-..." },}```
Z.AI (GLM models):
```json5{ agents: { defaults: { model: { primary: "zai/glm-5" }, models: { "zai/glm-5": {} }, }, }, env: { ZAI_API_KEY: "..." },}```
If you reference a provider/model but the required provider key is missing, you'll get a runtime auth error (e.g. `No API key found for provider "zai"`).
**No API key found for provider after adding a new agent**
This usually means the **new agent** has an empty auth store. Auth is per-agent andstored in:
```~/.openclaw/agents/<agentId>/agent/auth-profiles.json```
Fix options:
- Run `openclaw agents add <id>` and configure auth during the wizard.- Or copy only portable static `api_key` / `token` profiles from the main agent's auth store into the new agent's auth store.- For OAuth profiles, sign in from the new agent when it needs its own account; otherwise OpenClaw can read through to the default/main agent without cloning refresh tokens.
Do **not** reuse `agentDir` across agents; it causes auth/session collisions.Model failover and “All models failed”
1. **Auth profile rotation** within the same provider.2. **Model fallback** to the next model in `agents.defaults.model.fallbacks`.
Cooldowns apply to failing profiles (exponential backoff), so OpenClaw can keep responding even when a provider is rate-limited or temporarily failing.
The rate-limit bucket includes more than plain `429` responses. OpenClawalso treats messages like `Too many concurrent requests`,`ThrottlingException`, `concurrency limit reached`,`workers_ai ... quota limit exceeded`, `resource exhausted`, and periodicusage-window limits (`weekly/monthly limit reached`) as failover-worthyrate limits.
Some billing-looking responses are not `402`, and some HTTP `402`responses also stay in that transient bucket. If a provider returnsexplicit billing text on `401` or `403`, OpenClaw can still keep that inthe billing lane, but provider-specific text matchers stay scoped to theprovider that owns them (for example OpenRouter `Key limit exceeded`). If a `402`message instead looks like a retryable usage-window ororganization/workspace spend limit (`daily limit reached, resets tomorrow`,`organization spending limit exceeded`), OpenClaw treats it as`rate_limit`, not a long billing disable.
Context-overflow errors are different: signatures such as`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 lengthexceeded` stay on the compaction/retry path instead of advancing modelfallback.
Generic server-error text is intentionally narrower than "anything withunknown/error in it". OpenClaw does treat provider-scoped transient shapessuch as 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`, `backenderror`), and provider-busy errors such as `ModelNotReadyException` asfailover-worthy timeout/overloaded signals when the provider contextmatches.Generic internal fallback text like `LLM request failed with an unknownerror.` stays conservative and does not trigger model fallback by itself.**Fix checklist:**
- **Confirm where auth profiles live** (new vs legacy paths) - Current: `~/.openclaw/agents/<agentId>/agent/auth-profiles.json` - Legacy: `~/.openclaw/agent/*` (migrated by `openclaw doctor`)- **Confirm your env var is loaded by the Gateway** - If you set `ANTHROPIC_API_KEY` in your shell but run the Gateway via systemd/launchd, it may not inherit it. Put it in `~/.remoteclaw/.env` or enable `env.shellEnv`.- **Make sure you're editing the correct agent** - Multi-agent setups mean there can be multiple `auth-profiles.json` files.- **Sanity-check model/auth status** - Use `openclaw models status` to see configured models and whether providers are authenticated.
**Fix checklist for "No credentials found for profile anthropic"**
This means the run is pinned to an Anthropic auth profile, but the Gatewaycan't find it in its auth store.
- **Use Claude CLI** - Run `openclaw models auth login --provider anthropic --method cli --set-default` on the gateway host.- **If you want to use an API key instead** - Put `ANTHROPIC_API_KEY` in `~/.remoteclaw/.env` on the **gateway host**. - Clear any pinned order that forces a missing profile:
```bash openclaw models auth order clear --provider anthropic ```
- **Confirm you're running commands on the gateway host** - In remote mode, auth profiles live on the gateway machine, not your laptop.Fix: either provide Google auth, or remove/avoid Google models in `agents.defaults.model.fallbacks` / aliases so fallback doesn't route there.
**LLM request rejected: thinking signature required (Google Antigravity)**
Cause: the session history contains **thinking blocks without signatures** (often froman aborted/partial stream). Google Antigravity requires signatures for thinking blocks.
Fix: OpenClaw now 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)
```~/.openclaw/agents/<agentId>/agent/auth-profiles.json```
To inspect saved profiles without dumping secrets, run `openclaw models auth list` (optionally `--provider <id>` or `--json`). See [Models CLI](/cli/models#auth-profiles) for details.- `anthropic:default` (common when no email identity exists)- `anthropic:<email>` for OAuth identities- custom IDs you choose (e.g. `anthropic:work`)OpenClaw may temporarily skip a profile if it's in a short **cooldown** (rate limits/timeouts/auth failures) or a longer **disabled** state (billing/insufficient credits). To inspect this, run `openclaw models status --json` and check `auth.unusableProfiles`. Tuning: `auth.cooldowns.billingBackoffHours*`.
Rate-limit cooldowns can be model-scoped. A profile that is cooling downfor one model can still be usable for a sibling model on the same provider,while billing/disabled windows still block the whole profile.
You can also set a **per-agent** order override (stored in that agent's `auth-state.json`) via the CLI:
```bash# Defaults to the configured default agent (omit --agent)openclaw models auth order get --provider anthropic
# Lock rotation to a single profile (only try this one)openclaw models auth order set --provider anthropic anthropic:default
# Or set an explicit order (fallback within provider)openclaw models auth order set --provider anthropic anthropic:work anthropic:default
# Clear override (fall back to config auth.order / round-robin)openclaw models auth order clear --provider anthropic```
To target a specific agent:
```bashopenclaw models auth order set --provider anthropic --agent main anthropic:default```
To verify what will actually be tried, use:
```bashopenclaw models status --probe```
If a stored profile is omitted from the explicit order, probe reports`excluded_by_auth_order` for that profile instead of trying it silently.- **OAuth / CLI login** often leverages subscription access where the provider supports it. For Anthropic, OpenClaw's Claude CLI backend uses Claude Code `claude -p`; Anthropic currently treats that as Agent SDK/programmatic usage, with a separate monthly Agent SDK credit starting June 15, 2026.- **API keys** use pay-per-token billing.
The wizard explicitly supports Anthropic Claude CLI, OpenAI Codex OAuth, and API keys.Related
- FAQ — the main FAQ
- FAQ — quick start and first-run setup
- Model selection
- Model failover