Claude Code CLI (OAuth/Claude Pro) requests timeout with 502 (no body) — but API-key requests forward correctly #1272
Unanswered
PaikyHiean
asked this question in
Q&A
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
uv tool install headroom-ai[all]using uv-managed CPython 3.12.13)What I did
Ran
headroom wrap claudefrom a project directory that has no.claude/settings.json.Headroom successfully recovered/started the proxy on port 8787 (
/readyz→ 200,/health→ 200).Sent a message in the Claude Code CLI session.
What happened
After ~3 minutes of waiting, the CLI returned:
502 status code (no body). This is a server-side issue, usually temporary —
try again in a moment. If it persists, check your inference gateway (127.0.0.1:8787).
This happens consistently on every attempt (retried 10/10 times, both attempts failed after 3m 10s and 3m 14s respectively).
What I verified
To rule out a broken proxy, I sent a direct test request to the proxy:
This returned a proper 401 authentication_error: invalid x-api-key from Anthropic immediately — confirming the proxy can forward requests to api.anthropic.com.
The stats endpoint also confirmed the test request was tracked: api_requests: 1, providers: anthropic.
Key observation
No POST requests appear in proxy.log during Claude Code CLI usage, even during the 3-minute timeout window. The log only shows /health and /stats polling from the dashboard browser. This contrasts with the API-key test request, which did produce a log entry.
Question / possible bug
Is this a known limitation on Windows where Claude Code CLI's OAuth-based (Claude Pro) streaming SSE requests are not handled correctly by the proxy? The combination of:
OAuth token auth (not x-api-key)
Streaming SSE response
Windows platform
...seems to be the difference between the working test case and the failing CLI case. Any guidance appreciated.
Beta Was this translation helpful? Give feedback.
All reactions