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 7ebca34
Browse filesBrowse the repository at this point in the historyBrowse files
This is two steps: log Claude Code into Anthropic on the host, then tell OpenClaw to route Anthropic model selection through the local `claude-cli` backend and store the matching OpenClaw auth profile.
59
+
This is two steps: log Claude Code into Anthropic on the host, then tell OpenClaw to route Anthropic models through the local `claude-cli` backend.
60
60
61
-
At run time OpenClaw treats a reused Claude CLI login as Claude's own credential: it verifies the host's current `claude`login matches the selected profile's account and then lets the `claude`subprocess authenticate natively, so Claude keeps refreshing its own login during runs. OpenClaw never forwards a copied token for this path. If the host login is missing or belongs to a different account, the run fails before spawn with the exact re-authentication commands. OpenClaw-managed credentials (Anthropic OAuth login profiles, setup tokens, API keys) are still delivered to the subprocess directly and refreshed by OpenClaw where applicable.
61
+
OpenClaw never reads, stores, refreshes, or forwards the native login tokens. The installed `claude`process reads and refreshes its own login. `CLAUDE_CONFIG_DIR` selects a separate Claude login when set on the Gateway process. OpenClaw-managed setup tokens and API keys remain separate credentials.
62
62
63
63
The gateway service must resolve `claude` on `PATH`. If a deployment needs a
64
64
nonstandard executable path, register a wrapper through a
Copy file name to clipboardExpand all lines: docs/gateway/cli-backends.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,10 +118,11 @@ The `openclaw agent` command also has its own request deadline. Its 600-second f
118
118
119
119
The bundled Anthropic plugin runs the installed Claude Code executable through
120
120
Anthropic's official Agent SDK. Claude Code owns its existing local login and
121
-
subscription; OpenClaw does not extract that login or send synthesized
122
-
Anthropic API requests. Compatible agent turns share one warm SDK query and
123
-
Claude Code subprocess. A changed model, system prompt, authenticated identity,
124
-
or tool policy starts a new query; persisted Claude session IDs still provide
121
+
subscription. OpenClaw uses a non-secret route marker. It never reads, persists,
122
+
refreshes, or forwards native tokens, or sends synthesized Anthropic API
123
+
requests. Compatible agent turns share one warm SDK query and
124
+
Claude Code subprocess. A changed model, system prompt, or tool policy starts a
125
+
new query; persisted Claude session IDs still provide
125
126
conversation continuity when the gateway or subprocess restarts.
126
127
127
128
Keep Claude Code updated, especially if the SDK reports an incompatible
@@ -350,12 +351,12 @@ If no MCP servers are enabled, OpenClaw still injects a strict config when a bac
350
351
351
352
Session-scoped bundled MCP runtimes are cached for reuse within a session, then reaped after 10 minutes of idle time. One-shot embedded runs such as auth probes, slug generation, and active-memory recall request cleanup at run end so stdio children and Streamable HTTP/SSE streams do not outlive the run.
352
353
353
-
For `claude-cli`, an imported native OAuth profile reuses the matching,
354
-
identity-verified Claude Code login without forwarding an extracted access
355
-
token. Explicit non-native API-key and token profiles continue to use the
Copy file name to clipboardExpand all lines: docs/providers/anthropic.md
+20-12Lines changed: 20 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,15 +15,16 @@ Anthropic builds the **Claude** model family. OpenClaw supports two auth routes:
15
15
16
16
OpenClaw detects the available Anthropic credential and selects the matching usage surface:
17
17
18
-
- Claude subscription/setup credentials show quota windows and optional extra-usage budget.
18
+
- OpenClaw-managed subscription/setup credentials show quota windows and optional extra-usage budget.
19
+
- Native Claude CLI logins stay under Claude's exclusive refresh control, so OpenClaw does not poll their quota endpoint.
19
20
-`ANTHROPIC_ADMIN_KEY` or `ANTHROPIC_ADMIN_API_KEY` shows 30 days of provider-reported organization cost and Messages API usage in Control UI **Usage**, including daily spend, token/cache totals, top models, and cost categories.
20
21
- An `sk-ant-admin...` credential stored in the Anthropic provider profile is detected as an Admin API key automatically.
21
22
22
23
Admin API cost history comes from Anthropic's [Usage and Cost API](https://platform.claude.com/docs/en/manage-claude/usage-cost-api). It is actual provider billing, separate from OpenClaw's session-derived estimated cost.
23
24
24
25
<Warning>
25
-
Claude Code owns its existing login and subscription; OpenClaw does not extract
26
-
that login or synthesize Anthropic API requests. Agent SDK and `claude -p`
26
+
Claude Code owns its existing login and subscription; OpenClaw does not persist
27
+
or refresh that login. Agent SDK and `claude -p`
27
28
usage currently draw from the signed-in subscription's limits. API-key auth
28
29
uses separate pay-as-you-go billing and is preferable for shared automation or
29
30
predictable production spend.
@@ -89,6 +90,13 @@ OpenClaw release:
89
90
90
91
```bash
91
92
claude --version
93
+
claude auth status --text
94
+
```
95
+
96
+
If Claude is not logged in, authenticate once as the Gateway user:
97
+
98
+
```bash
99
+
claude auth login
92
100
```
93
101
94
102
If the installed build is incompatible, update Claude Code and restart
@@ -104,15 +112,15 @@ OpenClaw release:
104
112
# choose: Claude CLI
105
113
```
106
114
107
-
OpenClaw detects the existing Claude CLI login. Normal agent turns use
108
-
the official Agent SDK with the installed, authenticated Claude Code
109
-
executable, including native-tool turns whose approvals remain under
110
-
OpenClaw control. Schema-valid native calls pass through OpenClaw's
111
-
canonical tool policy before native approval. Imported native OAuth
112
-
profiles reuse the verified Claude Code login; explicitly selected
113
-
API-key or token credentials still use protected file-descriptor
114
-
forwarding. Isolated side-question
115
-
completions and paired-node execution retain the supervised CLI path.
115
+
Normal agent turns use the official Agent SDK with the installed,
116
+
authenticated Claude Code executable. OpenClaw uses a non-secret route
117
+
marker and never reads, persists, refreshes, selects, or forwards the
118
+
native login tokens. Claude owns the login and token refresh lifecycle.
119
+
Explicitly selected API-key or token credentials still use protected
120
+
file-descriptor forwarding. Native-tool approvals remain under OpenClaw
121
+
control. Schema-valid native calls pass through OpenClaw's canonical
122
+
tool policy before native approval. Isolated side-question completions
123
+
and paired-node execution retain the supervised CLI path.
116
124
117
125
Consecutive agent turns reuse the same warm Agent SDK query and Claude
118
126
Code subprocess when their authenticated session and execution policy
0 commit comments