With several auth profiles for one provider, how does OpenClaw order, pin and cool them down, and why does it not rotate on every request?
answer
- warm caches beat round-robin
- explicit order beats the type sort
- OAuth, token, then API key
- 30 seconds after the first failure
- billing disables for ten minutes
basics
~20 sOpenClaw pins one auth profile per session to keep provider caches warm, moving on when the session resets or that profile is cooling down. A first failure cools it for 30 seconds; billing failures disable it for ten minutes.
solid answer
~50 sOrder comes from, in precedence: a stored per-agent order (`openclaw models auth order set`), `auth.order.<provider>` in config, configured `auth.profiles`, then stored profiles. With no explicit order OpenClaw sorts **OAuth, then static token, then API key**, least recently used first, and moves profiles in cooldown to the end. It **pins the chosen profile per session** to keep the provider's prompt cache warm, changing it when the session is reset with `/new` or `/reset` or when that profile is in cooldown or disabled. A first auth or rate-limit failure puts the profile in a 30-second cooldown and repeats lengthen it; billing failures such as insufficient credits disable it for ten minutes at first. Rate-limit cooldowns can be scoped to one model. `openclaw models status` lists **Unavailable auth profiles** with the reason. These details are as of OpenClaw 2026.9.9.
go deeper
Recall that several credentials for one provider are separate auth profiles, and that a failing one is benched for a while before reuse.
Explain the default order by type and last use, and why a session keeps one profile pinned instead of rotating each request.
Read Unavailable auth profiles in models status, tell a short cooldown from a billing disable, and set an explicit order where it matters.
Judge whether extra credentials for one provider buy real resilience or just more spend, compared with a fallback on another provider.
## The setup An operator has two or three credentials for one provider, for example a personal subscription login and an API key, or two API keys on different accounts. Each is an **auth profile** with an id like `openai:[email protected]` or `anthropic:manual`, stored in the agent's SQLite auth store. OpenClaw decides which profile a request uses, keeps using it, and benches it when it fails. This describes OpenClaw 2026.9.9. ## Choosing the order OpenClaw takes the first source that is set: 1. A **stored per-agent order**, set with `openclaw models auth order set --provider <id> <profileIds...>` and removed with `order clear`. 2. **`auth.order.<provider>`** in `openclaw.json`. 3. **Configured `auth.profiles`** for that provider. 4. **Stored profiles** in the agent's auth store. An explicit order is a hard preference. Without one, OpenClaw uses a round-robin sort: - by type: **OAuth, then static token, then API key**; - for OAuth, profiles with a usable access token before expired ones (expired profiles stay eligible so they can be refreshed); - then by `lastUsed`, oldest first; - profiles in cooldown or disabled go to the end, soonest expiry first. ## Session stickiness OpenClaw does **not** rotate on every request. It **pins the automatically chosen profile per session** so the provider's prompt cache stays warm; switching credentials mid-conversation can mean reprocessing the whole context. An automatic pin may rotate or clear when: - the session is reset with `/new` or `/reset`; - the pinned profile is in cooldown or disabled. Compaction does not change it. A user can pin a profile with `/model <ref>@<profileId> -s`; that pin survives resets and cooldown windows, and while the pinned profile is cooling OpenClaw uses the next eligible profile of the same provider without replacing the stored pin. ## Cooldowns and disables | Failure | What happens to the profile | |---|---| | First auth or rate-limit failure | Cooldown of 30 seconds | | Repeated transient failures | Longer cooldowns: 1 minute, then up to 5 minutes | | Repeated rate limits | Backoff keeps doubling until a real request succeeds | | Billing or credit failure | Disabled for ten minutes at first | | Revoked or deactivated key | Also a ten-minute initial disable | Details worth knowing: - The rate-limit bucket is wider than HTTP 429: messages such as "Too many concurrent requests", "resource exhausted" or "weekly limit reached" count too. - Rate-limit cooldowns can be **model-scoped**: OpenClaw records the failing model, so a sibling model on the same provider can still use the profile. Billing disables block the whole profile. - The ten-minute disable is deliberately short because some providers return auth-looking errors briefly during incidents, and an inline key should be able to retry soon after a recharge. - In the 2026.9.9 source, repeated rate limits back off by doubling from 30 seconds, potentially up to a day, until a request succeeds; the docs' 1-minute and 5-minute steps describe the other transient failures. Treat the exact ladder as release-specific. ## Seeing it - `openclaw models status` lists **Unavailable auth profiles** with the stored reason and recovery action; `--json` exposes them as `auth.unusableProfiles`. - `openclaw models auth list --provider <id>` shows each profile's active cooldown or disable, without printing secrets. - The cooldown state itself lives in the agent's auth store under `usageStats` (`cooldownUntil`, `disabledUntil`, `errorCount`). ## Explicit order pitfalls An explicit order is honoured literally, which cuts both ways: - A stored profile left out of `auth.order.<provider>` is not tried at all; a probe reports it as `excluded_by_auth_order`. - An authored **empty** `auth.order.<provider>` list means "select no profiles" and effectively disables that provider. `openclaw models auth logout` deletes an order entry it would otherwise empty, for exactly this reason. - A per-agent stored order (`openclaw models auth order set`) silently beats the config key, so check `openclaw models auth order get --provider <id>` before editing config and wondering why nothing changed. ## When rotation is not enough Rotation changes the **credential**, never the model. If every profile of the provider is cooling or disabled, OpenClaw moves to the next model in the fallback chain, which only helps when that chain names another provider.
- How do you make one OpenClaw API key the durable first choice for a single chat without changing the agent's order?Pin it in that chat with `/model <provider/model>@<profileId> -s`. A user profile pin survives `/new`, `/reset` and cooldown windows. While it is cooling, OpenClaw uses the next eligible same-provider profile without replacing the stored pin, and returns to it once the cooldown ends. The command also pins the model, so that chat's model choice becomes strict.
- What is the difference between `auth.order.openai` in config and `openclaw models auth order set --provider openai`?The config key is a shared routing preference in `openclaw.json`. The command writes a per-agent order override into that agent's SQLite auth store, and the stored override takes precedence over config. `openclaw models auth order clear` drops the override and falls back to config or round-robin ordering.
- OpenClaw round-robins profiles on every request to spread load
- An auth profile rotation also switches to a different model
- A billing failure benches a profile for only 30 seconds
- Compaction re-picks the auth profile for the session
- Only HTTP 429 responses count as rate limits
Assumes OpenClaw 2026.9.9; the 30-second first cooldown and ten-minute billing disable hold, while the backoff for repeated rate limits differs between the docs and the source.