You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/concepts/model-failover.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,10 +108,10 @@ These notices are operational messages, not assistant content. They are delivere
108
108
109
109
OpenClaw uses **auth profiles** for both API keys and OAuth tokens.
110
110
111
-
- Secrets live in `~/.openclaw/agents/<agentId>/agent/auth-profiles.json` (legacy: `~/.openclaw/agent/auth-profiles.json`).
112
-
- Runtime auth-routing state lives in `~/.openclaw/agents/<agentId>/agent/auth-state.json`.
111
+
- Secrets and runtime auth-routing state live in `~/.openclaw/agents/<agentId>/agent/openclaw-agent.sqlite`.
113
112
- Config `auth.profiles` / `auth.order` are **metadata + routing only** (no secrets).
114
-
- Legacy import-only OAuth file: `~/.openclaw/credentials/oauth.json` (imported into `auth-profiles.json` on first use).
113
+
- Legacy import-only OAuth file: `~/.openclaw/credentials/oauth.json` (imported into the per-agent auth store on first use).
114
+
- Legacy `auth-profiles.json`, `auth-state.json`, and per-agent `auth.json` files are imported by `openclaw doctor --fix`.
115
115
116
116
More detail: [OAuth](/concepts/oauth)
117
117
@@ -127,7 +127,7 @@ OAuth logins create distinct profiles so multiple accounts can coexist.
127
127
- Default: `provider:default` when no email is available.
128
128
- OAuth with email: `provider:<email>` (for example `google-antigravity:user@gmail.com`).
129
129
130
-
Profiles live in `~/.openclaw/agents/<agentId>/agent/auth-profiles.json` under `profiles`.
130
+
Profiles live in the per-agent `openclaw-agent.sqlite` auth profile store.
131
131
132
132
## Rotation order
133
133
@@ -141,7 +141,7 @@ When a provider has multiple profiles, OpenClaw chooses an order like this:
141
141
`auth.profiles` filtered by provider.
142
142
</Step>
143
143
<Steptitle="Stored profiles">
144
-
Entries in `auth-profiles.json` for the provider.
144
+
Per-agent SQLite auth profile entries for the provider.
145
145
</Step>
146
146
</Steps>
147
147
@@ -229,7 +229,7 @@ Cooldowns use exponential backoff:
229
229
- 25 minutes
230
230
- 1 hour (cap)
231
231
232
-
State is stored in `auth-state.json` under `usageStats`:
232
+
State is stored in the per-agent SQLite auth state under `usageStats`:
233
233
234
234
```json
235
235
{
@@ -253,7 +253,7 @@ Not every billing-shaped response is `402`, and not every HTTP `402` lands here.
253
253
Meanwhile temporary `402` usage-window and organization/workspace spend-limit errors are classified as `rate_limit` when the message looks retryable (for example `weekly usage limit exhausted`, `daily limit reached, resets tomorrow`, or `organization spending limit exceeded`). Those stay on the short cooldown/failover path instead of the long billing-disable path.
254
254
</Note>
255
255
256
-
State is stored in `auth-state.json`:
256
+
State is stored in the per-agent SQLite auth state:
OpenClaw expects the canonical `version` + `profiles` shape at runtime. If an older install still has a flat file such as `{ "openrouter": { "apiKey": "..." } }`, run `openclaw doctor --fix` to rewrite it as an `openrouter:default` API-key profile; doctor keeps a `.legacy-flat.*.bak` copy beside the original. Endpoint details such as `baseUrl`, `api`, model ids, headers, and timeouts belong under `models.providers.<id>` in `openclaw.json` or `models.json`, not in `auth-profiles.json`.
111
+
OpenClaw now reads auth profiles from each agent's `openclaw-agent.sqlite`. If an older install still has `auth-profiles.json`, `auth-state.json`, or a flat auth profile file such as `{ "openrouter": { "apiKey": "..." } }`, run `openclaw doctor --fix` to import it into SQLite; doctor keeps timestamped backups beside the original JSON files. Endpoint details such as `baseUrl`, `api`, model ids, headers, and timeouts belong under `models.providers.<id>` in `openclaw.json` or `models.json`, not in authprofiles.
112
112
113
-
External auth routes such as Bedrock `auth: "aws-sdk"` are also not credentials. If you want a named Bedrock route, put `auth.profiles.<id>.mode: "aws-sdk"` in `openclaw.json`; do not write `type: "aws-sdk"` into `auth-profiles.json`. `openclaw doctor --fix` moves legacy AWS SDK markers from the credential store into config metadata.
113
+
External auth routes such as Bedrock `auth: "aws-sdk"` are also not credentials. If you want a named Bedrock route, put `auth.profiles.<id>.mode: "aws-sdk"` in `openclaw.json`; do not write `type: "aws-sdk"` into the auth profile store. `openclaw doctor --fix` moves legacy AWS SDK markers from the credential store into config metadata.
114
114
115
115
Auth profile refs are also supported for static credentials:
116
116
@@ -225,7 +225,7 @@ Use `/model` (or `/model list`) for a compact picker; use `/model status` for th
225
225
226
226
### Per-agent (CLI override)
227
227
228
-
Set an explicit auth profile order override for an agent (stored in that agent's `auth-state.json`):
228
+
Set an explicit auth profile order override for an agent (stored in that agent's SQLite authstate):
229
229
230
230
```bash
231
231
openclaw models auth order get --provider anthropic
0 commit comments