Setup-token auth fails with 401 due to (external, cli) in user-agent #1678
LazerLance777
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using OpenClaw with a Claude Max setup-token (
sk-ant-oat01-*). The auth probe passes fine, but every actual API request gets a 401.Traced it to
packages/ai/src/providers/anthropic.tsline 543. The OAuth/setup-token path sets:The
(external, cli)suffix tells Anthropic's API "I'm not the real Claude Code" — so the server rejects it. Removing that suffix fixes it immediately.Also
claudeCodeVersionon line 65 is still"2.1.2"— current Claude Code is 2.1.62.Two-line fix, tested and working on my end with both Sonnet 4.5 and Opus 4.6. Same issue reported by multiple users in openclaw/openclaw#23538.
Happy to submit a PR once approved.
Beta Was this translation helpful? Give feedback.
All reactions