2026-01-15 06:12:54 +00:00
---
2026-01-30 03:15:10 +01:00
summary: "CLI reference for `openclaw models` (status/list/set/scan, aliases, fallbacks, auth)"
2026-01-15 06:12:54 +00:00
read_when:
- You want to change default models or view provider auth status
- You want to scan available models/providers and debug auth profiles
2026-01-31 16:04:03 -05:00
title: "models"
2026-01-15 06:12:54 +00:00
---
2026-01-30 03:15:10 +01:00
# `openclaw models`
2026-01-15 06:12:54 +00:00
Model discovery, scanning, and configuration (default model, fallbacks, auth profiles).
Related:
2026-01-31 21:13:13 +09:00
2026-01-15 06:12:54 +00:00
- Providers + models: [Models ](/providers/models )
- Provider auth setup: [Getting started ](/start/getting-started )
## Common commands
``` bash
2026-01-30 03:15:10 +01:00
openclaw models status
openclaw models list
openclaw models set <model-or-alias>
openclaw models scan
2026-01-15 06:12:54 +00:00
```
2026-01-30 03:15:10 +01:00
`openclaw models status` shows the resolved default/fallbacks plus an auth overview.
2026-04-04 11:25:39 +01:00
When provider usage snapshots are available, the OAuth/API-key status section includes
2026-04-04 12:46:00 +09:00
provider usage windows and quota snapshots.
2026-04-04 12:40:55 +01:00
Current usage-window providers: Anthropic, GitHub Copilot, Gemini CLI, OpenAI
Codex, MiniMax, Xiaomi, and z.ai. Usage auth comes from provider-specific hooks
when available; otherwise OpenClaw falls back to matching OAuth/API-key
credentials from auth profiles, env, or config.
2026-04-05 22:44:40 +01:00
In `--json` output, `auth.providers` is the env/config/store-aware provider
overview, while `auth.oauth` is auth-store profile health only.
2026-01-23 19:25:58 +00:00
Add `--probe` to run live auth probes against each configured provider profile.
Probes are real requests (may consume tokens and trigger rate limits).
2026-01-30 15:39:05 -05:00
Use `--agent <id>` to inspect a configured agent’ s model/auth state. When omitted,
the command uses `OPENCLAW_AGENT_DIR` /`PI_CODING_AGENT_DIR` if set, otherwise the
configured default agent.
2026-04-04 20:51:43 +01:00
Probe rows can come from auth profiles, env credentials, or `models.json` .
2026-01-16 00:24:31 +00:00
2026-01-17 17:16:20 +00:00
Notes:
2026-01-31 21:13:13 +09:00
2026-01-17 17:16:20 +00:00
- `models set <model-or-alias>` accepts `provider/model` or an alias.
- Model refs are parsed by splitting on the **first ** `/` . If the model ID includes `/` (OpenRouter-style), include the provider prefix (example: `openrouter/moonshotai/kimi-k2` ).
2026-04-04 14:55:44 +01:00
- If you omit the provider, OpenClaw resolves the input as an alias first, then
as a unique configured-provider match for that exact model id, and only then
falls back to the configured default provider with a deprecation warning.
2026-04-04 19:48:46 +01:00
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.
2026-03-26 16:32:34 +08:00
- `models status` may show `marker(<value>)` in auth output for non-secret placeholders (for example `OPENAI_API_KEY` , `secretref-managed` , `minimax-oauth` , `oauth:chutes` , `ollama-local` ) instead of masking them as secrets.
2026-01-17 17:16:20 +00:00
2026-01-23 19:25:58 +00:00
### `models status`
2026-01-31 21:13:13 +09:00
2026-01-23 19:25:58 +00:00
Options:
2026-01-31 21:13:13 +09:00
2026-01-23 19:25:58 +00:00
- `--json`
- `--plain`
- `--check` (exit 1=expired/missing, 2=expiring)
- `--probe` (live probe of configured auth profiles)
- `--probe-provider <name>` (probe one provider)
- `--probe-profile <id>` (repeat or comma-separated profile ids)
- `--probe-timeout <ms>`
- `--probe-concurrency <n>`
- `--probe-max-tokens <n>`
2026-01-30 15:39:05 -05:00
- `--agent <id>` (configured agent id; overrides `OPENCLAW_AGENT_DIR` /`PI_CODING_AGENT_DIR` )
2026-01-23 19:25:58 +00:00
2026-04-04 20:51:43 +01:00
Probe status buckets:
- `ok`
- `auth`
- `rate_limit`
- `billing`
- `timeout`
- `format`
- `unknown`
- `no_model`
Probe detail/reason-code cases to expect:
- `excluded_by_auth_order` : a stored profile exists, but explicit
`auth.order.<provider>` omitted it, so probe reports the exclusion instead of
trying it.
- `missing_credential` , `invalid_expires` , `expired` , `unresolved_ref` :
profile is present but not eligible/resolvable.
- `no_model` : provider auth exists, but OpenClaw could not resolve a probeable
model candidate for that provider.
2026-01-15 06:12:54 +00:00
## Aliases + fallbacks
``` bash
2026-01-30 03:15:10 +01:00
openclaw models aliases list
openclaw models fallbacks list
2026-01-15 06:12:54 +00:00
```
## Auth profiles
``` bash
2026-01-30 03:15:10 +01:00
openclaw models auth add
openclaw models auth login --provider <id>
2026-04-04 15:46:13 +09:00
openclaw models auth setup-token --provider <id>
2026-04-05 04:31:25 +09:00
openclaw models auth paste-token
2026-01-15 06:12:54 +00:00
```
2026-01-31 21:13:13 +09:00
2026-04-04 08:10:18 +01:00
`models auth add` is the interactive auth helper. It can launch a provider auth
flow (OAuth/API key) or guide you into manual token paste, depending on the
provider you choose.
2026-01-16 00:39:29 +00:00
`models auth login` runs a provider plugin’ s auth flow (OAuth/API key). Use
2026-01-30 03:15:10 +01:00
`openclaw plugins list` to see which providers are installed.
2026-01-16 02:36:29 +00:00
2026-03-26 23:03:02 +00:00
Examples:
``` bash
openclaw models auth login --provider openai-codex --set-default
```
2026-01-16 02:36:29 +00:00
Notes:
2026-01-31 21:13:13 +09:00
2026-04-04 07:50:13 +01:00
- `setup-token` and `paste-token` remain generic token commands for providers
that expose token auth methods.
2026-04-04 22:05:05 +01:00
- `setup-token` requires an interactive TTY and runs the provider's token-auth
method (defaulting to that provider's `setup-token` method when it exposes
one).
2026-04-05 04:31:25 +09:00
- `paste-token` accepts a token string generated elsewhere or from automation.
2026-04-04 22:05:05 +01:00
- `paste-token` requires `--provider` , prompts for the token value, and writes
it to the default profile id `<provider>:manual` unless you pass
`--profile-id` .
- `paste-token --expires-in <duration>` stores an absolute token expiry from a
relative duration such as `365d` or `12h` .
2026-04-06 14:20:51 +01:00
- Anthropic note: Anthropic staff told us OpenClaw-style Claude CLI usage is allowed again, so OpenClaw treats Claude CLI reuse and `claude -p` usage as sanctioned for this integration unless Anthropic publishes a new policy.
2026-04-06 15:30:49 +01:00
- Anthropic `setup-token` / `paste-token` remain available as a supported OpenClaw token path, but OpenClaw now prefers Claude CLI reuse and `claude -p` when available.