Support Anthropic subscription OAuth
Build Claw Telegram / build (push) Successful in 4m54s
Build Claw Telegram / cleanup (push) Successful in 1s

This commit is contained in:
Wylabb
2026-04-05 02:23:55 +02:00
parent 6431bcac50
commit 9f4bf2c3ee
7 changed files with 162 additions and 36 deletions
+7 -5
View File
@@ -110,12 +110,14 @@ The gateway container needs:
- Docker network
- `claw_gateway`
- `ANTHROPIC_AUTH_TOKEN`
- Claude subscription OAuth token such as `sk-ant-oat...`
- the gateway now sends the extra Claude Code headers required for this path
- `ANTHROPIC_API_KEY`
- standard Anthropic API key
Bearer-only auth is not currently supported by the Anthropic Messages API used by this runtime.
If you pass only `ANTHROPIC_AUTH_TOKEN`, workers will fail with:
- `401 Unauthorized (authentication_error): OAuth authentication is currently not supported.`
If you use `ANTHROPIC_AUTH_TOKEN`, the gateway workers add the Claude Code OAuth headers and agent identity prefix that `nanobot` also uses for subscription auth.
The gateway copies inherited auth env vars into worker containers according to `CLAW_GATEWAY_INHERITED_ENV`.
@@ -156,7 +158,7 @@ Example:
"template_dir": "/unraid/templates-user",
"template_file_prefix": "claw-worker-",
"template_archive_dir": "/appdata/template-archive",
"inherited_env": ["ANTHROPIC_API_KEY"]
"inherited_env": ["ANTHROPIC_AUTH_TOKEN", "ANTHROPIC_API_KEY"]
},
"worker_defaults": {
"bind_port": 8080,