Home › Claude Code › Errors › OAuth errors
OverviewInstallCLI referencePricing & limitsAgent SDKSkills & pluginsGitHubWeb, desktop & IDEModelsErrorsOpen source?TutorialFor studentsQA automationvs Cursorvs Codex & OpenCodeSubagentsHooksMCPEcosystemVS CodeOpenRouterRate limits中文指南
Last updated: November 12, 2026

Claude Code OAuth errors: timeout of 15000ms exceeded, and status code 500

Both errors come from the /login flow, not from the model: Claude Code couldn't finish exchanging your browser login for a token. Most of the time it's an Anthropic-side auth incident or a network path problem — and if you need to work *now*, you can skip OAuth entirely.

TLDR

  • timeout of 15000ms exceeded — the auth server didn't answer in 15 s: network, DNS, proxy, or an incident.
  • Request failed with status code 500 — the auth server errored: an incident; retry later.
  • Check DNS for auth.anthropic.com, disable proxies/VPNs and the Claude-in-Chrome extension, retry.
  • Failed to refresh OAuth token: another Claude Code process… / Login expired — a refresh race between instances or a dead token: close the others, clean login.
  • Need to work now? Use an API key: with ANTHROPIC_API_KEY set, Claude Code never runs OAuth.

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.com returned "non-existent domain" from the user's resolver *and* 8.8.8.8 in one region; later comments reported the same from Spain. Test with nslookup 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_PROXY correctly, 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-token on 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), /login once 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 /login after 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_key

Create an account with code FIXIT

Frequently 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 plans

AI 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.

More Claude Code guides

Claude Code errors and how to fix themClaude Code "API Error: 500": what it means and what actually fixes itClaude "Overloaded" error (API Error 529): what it means and what to doClaude Code API Error 400: prompt is too long, tool use concurrency, and the rest"Claude Code process exited with code 1": how to find the real error and fix itClaude "Prompt is too long", "input is too long for requested model" and "Context limit reached": what fills the window and how to get it backClaude usage limit reached: session, weekly and Opus limits, "specified API usage limits", "credit balance is too low" — and what to doClaude Code 401 and 403: invalid authentication credentials, invalid API key, "Not logged in", host_not_allowedClaude Code connection errors: ECONNRESET, connection lost mid-response, "Waiting for API response", "Unable to connect to API", SSL certificate errorsClaude Code hangs, gets stuck or stops responding: how to find out where it is stuck and get outClaude.ai not working: "Something went wrong", capacity constraints, "5-hour limit reached", "error logging you in" and the rest