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
{{ message }}
Repository navigation
Commit 4637af0
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/concepts/models.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -345,7 +345,8 @@ Custom providers in `models.providers` are written into `models.json` under the
345
345
Merge mode precedence for matching provider IDs:
346
346
347
347
- Non-empty `baseUrl` already present in the agent `models.json` wins.
348
-
- Non-empty `apiKey` in the agent `models.json` wins only when that provider is not SecretRef-managed in current config/auth-profile context.
348
+
- Plaintext `apiKey` values already present in the agent `models.json` are not preserved in the prompt-facing catalog. When no current config/auth-profile context already supplies that provider credential, OpenClaw migrates the legacy key into the target agent's local `auth-profiles.json` before writing the stripped `models.json`.
349
+
- If the legacy `apiKey` migration cannot be durably written, OpenClaw fails closed and leaves the existing `models.json` unchanged instead of writing a stripped catalog that would lose the only credential.
349
350
- SecretRef-managed provider `apiKey` values are refreshed from source markers (`ENV_VAR_NAME` for env refs, `secretref-managed` for file/exec refs) instead of persisting resolved secrets.
350
351
- SecretRef-managed provider header values are refreshed from source markers (`secretref-env:ENV_VAR_NAME` for env refs, `secretref-managed` for file/exec refs).
351
352
- Empty or missing agent `apiKey`/`baseUrl` fall back to config `models.providers`.
"Model catalog root for provider definitions, merge/replace behavior, and optional Bedrock discovery integration. Keep provider definitions explicit and validated before relying on production failover paths.",
932
932
"models.mode":
933
-
'Controls provider catalog behavior: "merge" keeps built-ins and overlays your custom providers, while "replace" uses only your configured providers. In "merge", matching provider IDs preserve non-empty agent models.json baseUrl values, while apiKey values are preserved only when the provider is not SecretRef-managed in current config/auth-profile context; SecretRef-managed providers refresh apiKey from current source markers, and matching model contextWindow/maxTokens use the higher value between explicit and implicit entries.',
933
+
'Controls provider catalog behavior: "merge" keeps built-ins and overlays your custom providers, while "replace" uses only your configured providers. In "merge", matching provider IDs preserve non-empty agent models.json baseUrl values, while plaintext apiKey values in existing agent models.json are stripped from the prompt-facing catalog and migrated to local auth profiles when they are the only available credential; SecretRef-managed providers refresh apiKey from current source markers, durable migration failures fail closed without rewriting models.json, and matching model contextWindow/maxTokens use the higher value between explicit and implicit entries.',
934
934
"models.providers":
935
935
"Provider map keyed by provider ID containing connection/auth settings and concrete model definitions. Use stable provider keys so references from agents and tooling remain portable across environments.",
"Base URL for the provider endpoint used to serve model requests for that provider entry. Use HTTPS endpoints and keep URLs environment-specific through config templating where needed.",
942
942
"models.providers.*.apiKey":
943
-
"Provider credential used for API-key based authentication when the provider requires direct key auth. Use secret/env substitution and avoid storing real keys in committed config files.",
943
+
"Provider credential input for API-key based authentication when the provider requires direct key auth. Use secret/env substitution or auth profiles; OpenClaw strips plaintext apiKey values from generated models.json and migrates legacy catalog-only keys into local auth profiles before rewriting that catalog.",
944
944
"models.providers.*.auth":
945
945
'Selects provider auth style: "api-key" for API key auth, "token" for bearer token auth, "oauth" for OAuth credentials, and "aws-sdk" for AWS credential resolution. Match this to your provider requirements.',
0 commit comments