The messages
OAuth error: timeout of 15000ms exceeded
OAuth error: Request failed with status code 500
Login OAuth error: Request failed with status code 500 Press Enter to retry.
When it's an Anthropic incident
On April 6, 2026 the tracker filled with both errors within hours — #44271 ("OAuth login fails with 500 error and 15s timeout", 47 comments), #44280, #44266, #44289, #44725 — from Windows, macOS and Linux users alike. When you see that pattern (many people, same hour, both errors), nothing local will fix it: check status.claude.com and retry later, or use the API-key route below.
When it's your network
- DNS. In #33238
auth.anthropic.comreturned "non-existent domain" from the user's resolver *and* 8.8.8.8 in one region; later comments reported the same from Spain. Test withnslookup auth.anthropic.com; try another resolver (1.1.1.1) or a different network. - Proxies, VPNs, IPv6-only networks. The 15 s timeout is short for slow or proxied paths — Anthropic's own docs issue #55194 asked for exactly this guidance. Set
HTTPS_PROXYcorrectly, or try without the VPN. - The Claude in Chrome extension. #44301: the extension rewrote the OAuth
redirect_uri, so the browser step completed but the CLI waited until timeout. Disable it for the login, or log in from another browser. - Headless machines / SSH. No browser to complete the flow. Use
claude setup-tokenon a machine where login works, or an API key.
"Failed to refresh OAuth token: another Claude Code process is refreshing it or exited mid-refresh" and "Login expired · Please run /login"
These two appear later, in a session that was logged in fine. The access token expires periodically and the client refreshes it with a refresh token; the message says a refresh was already in flight, or a previous one died halfway and left the stored credential locked or half-written. Several Claude Code processes on one account (two terminals, the desktop app, an IDE extension, a scheduled run) all try to refresh the same token, and the losers see this.
- Close the other Claude Code instances, wait a minute, retry the turn; the winner's refreshed token is shared once it is written.
- If it persists:
/logout, delete the stored credential (~/.claude/.credentials.json; the *Claude Code-credentials* item in Keychain on macOS),/loginonce with everything else closed. - macOS: #71757 reports the background refresh corrupting the Keychain entry after sleep, and #88583 the entry being blanked when concurrent desktop sessions run; the fix in both is the logout-and-clean-login above.
- Windows: #68398 — the token expiring after about eight hours with the refresh token not being used, so every morning starts with a full login; update the CLI, and log in with the browser that has no Claude extension.
Login expired · Please run /loginafter weeks of use with no other process involved is the normal end of a refresh token's life: just log in again.- MCP connectors have their own OAuth and their own expiry (*Connection expired* daily, #65036, 40 reactions, open); re-authenticate the server with
claude mcp, it is unrelated to your Anthropic login.
Because the refresh race is per account, machines that run Claude Code unattended (cron, CI, a scheduled task) should not share a subscription login with an interactive session at all. Give them an API key; there is nothing to refresh.
Skip OAuth: use an API key
OAuth is only needed for Claude Pro/Max subscription use. With an API key in the environment, Claude Code goes straight to the API and never shows the login screen — which is also the fastest way around an auth outage:
export ANTHROPIC_BASE_URL=https://aiprimetech.io
export ANTHROPIC_API_KEY=your_gateway_key
claude # no /login, no OAuth
An Anthropic console key works the same way without ANTHROPIC_BASE_URL. Remember that an API key in the environment wins over a subscription login — unset it when you want to go back to Pro/Max. /status shows which one is active.
Tired of fighting this one?
Run Claude Code through the AI Prime Tech gateway instead: the same Claude models on the gateway's own upstream accounts, two environment variables to switch, and new accounts get $5 in free API credit with code FIXIT — no card.
export ANTHROPIC_BASE_URL=https://aiprimetech.io
export ANTHROPIC_API_KEY=your_keyFrequently asked questions
How do I fix 'OAuth error: timeout of 15000ms exceeded' in Claude Code?
Retry; check DNS for auth.anthropic.com; disable VPN/proxy and the Claude in Chrome extension; if Anthropic's auth is having an incident, wait or use an API key so Claude Code skips OAuth.
What does 'OAuth error: Request failed with status code 500' mean?
Anthropic's auth server errored during login. It is server-side — retry later or use an API key.
Can I use Claude Code without logging in?
Yes. Set ANTHROPIC_API_KEY (and ANTHROPIC_BASE_URL for a gateway) and Claude Code runs without the OAuth login.
How do I fix 'Failed to refresh OAuth token: another Claude Code process is refreshing it or exited mid-refresh'?
Close the other Claude Code instances (terminals, desktop app, IDE extension), wait a minute and retry. If it persists, /logout, delete the stored credential file or Keychain item, and /login once with everything else closed.
Run Claude Code on the gateway
Same models, two environment variables, credits at 7.69231× face value — or a flat-rate unlimited plan. New accounts: $5 in free API credit with code FIXIT.
Get an API key See unlimited plansAI Prime Tech is an independent API gateway and is not affiliated with, endorsed by, or sponsored by Anthropic. “Claude” and “Claude Code” are trademarks of Anthropic. Claude Code features described here follow Anthropic’s public documentation at the time of writing and change frequently; prices and model lists on this page are read from this gateway’s live settings.