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/gateway/openai-http-api.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,7 @@ Auth matrix:
75
75
- honor `x-openclaw-scopes` when the header is present
76
76
- fall back to the normal operator default scope set when the header is absent
77
77
- only lose owner semantics when the caller explicitly narrows scopes and omits `operator.admin`
78
+
- require `operator.admin` for owner-level request controls such as `x-openclaw-model`
78
79
79
80
See [Security](/gateway/security) and [Remote access](/gateway/remote).
80
81
@@ -96,7 +97,7 @@ OpenClaw treats the OpenAI `model` field as an **agent target**, not a raw provi
96
97
97
98
Optional request headers:
98
99
99
-
-`x-openclaw-model: <provider/model-or-bare-id>` overrides the backend model for the selected agent.
100
+
-`x-openclaw-model: <provider/model-or-bare-id>` overrides the backend model for the selected agent. Shared-secret bearer callers can use this header. Identity-bearing callers, such as trusted-proxy or private no-auth ingress requests with `x-openclaw-scopes`, need `operator.admin`; write-only callers get `403 missing scope: operator.admin`.
100
101
-`x-openclaw-agent-id: <agentId>` remains supported as a compatibility override.
-`x-openclaw-message-channel: <channel>` sets the synthetic ingress channel context for channel-aware prompts and policies.
@@ -178,7 +179,7 @@ This is the highest-leverage compatibility set for self-hosted frontends and too
178
179
179
180
</Accordion>
180
181
<Accordiontitle="How do I override the backend model?">
181
-
Use `x-openclaw-model`.
182
+
Use `x-openclaw-model`. This is an owner-level override: it works with the Gateway shared-secret bearer token/password path, and it requires `operator.admin` on identity-bearing HTTP paths such as trusted proxy auth.
182
183
183
184
Examples:
184
185
`x-openclaw-model: openai/gpt-5.4`
@@ -191,7 +192,7 @@ This is the highest-leverage compatibility set for self-hosted frontends and too
191
192
`/v1/embeddings` uses the same agent-target `model` ids.
192
193
193
194
Use `model: "openclaw/default"` or `model: "openclaw/<agentId>"`.
194
-
When you need a specific embedding model, send it in `x-openclaw-model`.
195
+
When you need a specific embedding model, send it in `x-openclaw-model` from a shared-secret caller or an identity-bearing caller with `operator.admin`.
195
196
Without that header, the request passes through to the selected agent's normal embedding setup.
196
197
197
198
</Accordion>
@@ -285,7 +286,7 @@ Expected behavior:
285
286
286
287
-`GET /v1/models` should list `openclaw/default`
287
288
- Open WebUI should use `openclaw/default` as the chat model id
288
-
- If you want a specific backend provider/model for that agent, set the agent's normal default model or send `x-openclaw-model`
289
+
- If you want a specific backend provider/model for that agent, set the agent's normal default model or send `x-openclaw-model` from a shared-secret caller or an identity-bearing caller with `operator.admin`
289
290
290
291
Quick smoke:
291
292
@@ -370,7 +371,7 @@ Notes:
370
371
371
372
-`/v1/models` returns OpenClaw agent targets, not raw provider catalogs.
372
373
-`openclaw/default` is always present so one stable id works across environments.
373
-
- Backend provider/model overrides belong in `x-openclaw-model`, not the OpenAI `model` field.
374
+
- Backend provider/model overrides belong in `x-openclaw-model`, not the OpenAI `model` field. On identity-bearing HTTP auth paths, this header requires `operator.admin`.
374
375
-`/v1/embeddings` supports `input` as a string or array of strings.
Copy file name to clipboardExpand all lines: docs/gateway/security/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -951,7 +951,7 @@ Important boundary note:
951
951
- Treat credentials that can call `/v1/chat/completions`, `/v1/responses`, plugin routes such as `/api/v1/admin/rpc`, or `/api/channels/*` as full-access operator secrets for that gateway.
952
952
- On the OpenAI-compatible HTTP surface, shared-secret bearer auth restores the full default operator scopes (`operator.admin`, `operator.approvals`, `operator.pairing`, `operator.read`, `operator.talk.secrets`, `operator.write`) and owner semantics for agent turns; narrower `x-openclaw-scopes` values do not reduce that shared-secret path.
953
953
- Per-request scope semantics on HTTP only apply when the request comes from an identity-bearing mode such as trusted proxy auth, or from an explicitly no-auth private ingress.
954
-
- In those identity-bearing modes, omitting `x-openclaw-scopes` falls back to the normal operator default scope set; send the header explicitly when you want a narrower scope set.
954
+
- In those identity-bearing modes, omitting `x-openclaw-scopes` falls back to the normal operator default scope set; send the header explicitly when you want a narrower scope set. Owner-level OpenAI-compatible headers such as `x-openclaw-model` require `operator.admin` when scopes are narrowed.
955
955
- `/tools/invoke` and HTTP session history endpoints follow the same shared-secret rule: token/password bearer auth is treated as full operator access there too, while identity-bearing modes still honor declared scopes.
956
956
- Do not share these credentials with untrusted callers; prefer separate gateways per trust boundary.
0 commit comments