skip to content

In OpenClaw, which `openclaw models` commands set the default model and check that its credentials work, and what does each one prove?

level: juniorimportance: should knowfreq 10%

answer

  1. one command writes, the rest inspect
  2. set writes the configured primary
  3. status reads state, calls no model
  4. --probe spends tokens, Gateway stopped
  5. a chat's own pin: /model status

basics

~20 s

openclaw models set writes the default model; openclaw models list shows the catalog; openclaw models status reports the resolved default, fallbacks and auth health without calling a model. Of these, only openclaw models status --probe sends real requests.

solid answer

~40 s

`openclaw models set <provider/model>` writes `agents.defaults.model.primary`; it rejects an unknown provider but saves an uncatalogued model with a warning. `openclaw models list` shows the published catalog (`--provider ollama` filters it). `openclaw models status` — the same as bare `openclaw models` — shows the resolved default, the fallbacks, credential sources, expiring tokens and any **Unavailable auth profiles** in cooldown, but it makes no model call; `--check` turns that into an exit code for scripts. Of these commands, only `openclaw models status --probe` sends live requests, which spend tokens and need the Gateway stopped first (`openclaw gateway stop`). None of these looks at a chat that was switched with `/model`; use `/model status` inside that chat.

go deeper

for a junior

Recall which command writes the default (models set) and which inspect it (models list, models status). Know that only a probe makes a real request.

for a middle

Explain what status reads, what its --check exit codes mean, and why a probe needs the Gateway stopped and costs tokens.

for a senior

Show how you diagnose a 'configured but silent' install: status for configuration, a deliberate probe for proof, and /model status for a chat holding its own pin.

for a principal

Discuss what a team should monitor continuously, cheap status checks with --check, against what it should test deliberately, given that probes spend tokens and hit rate limits.

## Two kinds of command OpenClaw's `openclaw models` family splits into commands that **write** model configuration and commands that **inspect** it. Mixing them up is how an operator "verifies" a setup that has never made a single model call. The default model lives in the config file `~/.openclaw/openclaw.json` under `agents.defaults.model`; the credentials live in each agent's auth store, a SQLite database under `~/.openclaw/agents/<agentId>/agent/`. | Command | What it does | Sends a model request? | |---|---|---| | `openclaw models set <ref>` | Writes `agents.defaults.model.primary` | No | | `openclaw models fallbacks add <ref>` | Appends to `agents.defaults.model.fallbacks` | No | | `openclaw models list` | Shows the published model catalog | No | | `openclaw models status` | Resolved default, fallbacks, auth health | No | | `openclaw models status --probe` | Live probe of configured auth profiles | Yes | ## Setting the default - `openclaw models set` takes a `provider/model` ref (for example `anthropic/claude-opus-5-5`) or a configured alias, and writes the **shared default** for every agent. It rejects `--agent`. - A provider that no installed plugin declares and that is not configured under `models.providers` makes the command exit nonzero **without changing config**. - A known provider with a model missing from the local catalog is **saved with a warning**, because newly released and self-hosted models may not be catalogued yet. Writing the same key with `openclaw config set` is stricter: it rejects a ref it cannot resolve. - `openclaw models set-image` does the same for `agents.defaults.imageModel.primary`, the model used when the primary cannot read images. - Changing the default does **not** rewrite sessions that already pinned a model. Status then says the session is pinned and the new primary applies to new or unpinned sessions. ## Reading status correctly Bare `openclaw models` is the same as `openclaw models status`. It reports: - the resolved default and the fallback chain; - an **auth overview**: which credential sources were found in the environment, provider config or the auth store; - OAuth expiry for stored profiles, with a warning within 24 hours by default; - **Unavailable auth profiles**: profiles currently in cooldown or disabled, with the stored reason and the recovery action; - for some providers, usage windows and quota snapshots. A stored profile appearing in that list does not prove it works now. Status without `--probe` is explicitly **not a model-call test**. For scripts, `--check` returns an exit code: `0` when no configured-route auth or runtime issue was found (which still does not prove a request will succeed), `1` for missing or expired auth, an incompatible route, an unavailable runtime or readiness that could not be confirmed, and `2` when a selected credential is about to expire. ## Live probes When you need proof that a key really answers, probe it: 1. Stop the Gateway with `openclaw gateway stop`. A direct probe creates temporary internal sessions in the agent's database and needs exclusive ownership of the state directory. 2. Run `openclaw models status --probe`, optionally narrowed with `--probe-provider <name>` or `--probe-profile <id>`. 3. Read each row's bucket: `ok`, `auth`, `rate_limit`, `billing`, `timeout`, `format`, `unknown` or `no_model`. 4. Start the Gateway again with `openclaw gateway start`. Probes are real requests: they **consume tokens and can trigger rate limits**, so they are a deliberate check, not something to put in a tight health loop. Probe rows can also report why a profile never reached a model call, for example `excluded_by_auth_order` when an explicit order leaves a stored profile out, or `expired` and `missing_credential` for a profile that is present but not usable. To test one model rather than every profile, `openclaw infer model run --model ollama/gemma4 --prompt "Reply with exactly: ok"` sends a single direct prompt. For scripts, `--json` keeps stdout pipeable into `jq` and sends diagnostics to stderr. ## The catalog, and a chat's own model - `openclaw models list` returns the published inventory without waiting for provider discovery; `--provider <id>` filters, `--all` shows the full catalog and `--refresh` asks providers for newly published models. Its Auth column is evidence about prepared credentials, not proof that a request will succeed. - `openclaw models status` describes the **configured** route. A chat whose model was switched with `/model` keeps its own session pin, which status does not inspect; `/model status` inside that chat shows the session's auth candidates and endpoint. ## Common mistakes - Treating a green `openclaw models status` as proof the provider answers. - Running `--probe` against a live Gateway and reading the lock error as an auth failure. - Editing `agents.defaults.model.primary` and expecting chats already pinned to another model to follow.

  • Why does `openclaw models set` accept a model that is not in the catalog, while `openclaw config set` rejects it?
    `models set` checks the provider strictly but treats the catalog as possibly stale: newly released and self-hosted models may not be listed yet, so it saves the ref and prints a warning. `openclaw config set` on `agents.defaults.model` is the stricter path and refuses a ref it cannot resolve. Either way, only a probe or a real turn proves the model answers.
  • You changed the default with `openclaw models set`, but one chat still answers on the old model. Why?
    That chat holds a session pin from an earlier `/model` selection. Changing `agents.defaults.model.primary` applies to new and unpinned sessions only; it never rewrites existing pins. `/model default -s` in that chat clears its pin so it follows the configured default again.

  • openclaw models status sends a test prompt to the default model
  • A probe is free, so run it every minute as a health check
  • openclaw models set writes the model for one chosen agent
  • Changing the default model moves every open chat onto it
  • A profile listed in status is proven to work right now