Unable to connect to Anthropic services when running "claude" in terminal for claude code
Resolved 💬 51 comments Opened Apr 2, 2025 by mikelibg Closed Aug 22, 2025
💡 Likely answer: A maintainer (sid374, contributor)
responded on this thread — see the highlighted reply below.
Getting the above error when trying to run claude code in terminal from valid country.
Claude version: 0.2.29 (Claude Code)
Node version: v23.6.0
npm version: 10.9.2
Tried running it also with bedrock setup but still getting the same error (btw, even with bedrock setup the error is still for api.anthropic.com)
CLAUDE_CODE_USE_BEDROCK=1
ANTHROPIC_MODEL='us.anthropic.claude-3-7-sonnet-20250219-v1:0'
AWS_ACCESS_KEY_ID=***PROPER_VALUE
AWS_SECRET_ACCESS_KEY=***PROPER_VALUE
AWS_SESSION_TOKEN=***PROPER_VALUE
Regardless there is no way to debug it further using cli (debug/verbose).
I've run wireshark to get more information and I am getting the following handshake errors:
453 HTTP error on Client Hello (SNI=api.anthropic.com) using TLSv1.3 protocol.
457 HTTP error on Client Hello (SNI=console.anthropic.com) using TLSv1.3 protocol.
457 HTTP error on Client Hello (SNI=statsig.anthropic.com) using TLSv1.3 protocol.
51 Comments
@mikelibg were you able to OAuth successfully to your Anthropic Console account?
Closing for inactivity. Feel free to re-open when you have a chance to respond.
Hi @sid374 , sorry for the late reply, was not available during these days.
Yes, I was able to connect to the Anthropic Console account with no issue.
It seems to happen only with the cli.
@bcherny Can you please re-open the issue (it seems I dont have an option to do it), I am available from now on.
I also have this problem, how can you get this work?
@mikelibg @Xuyaoyan could you please check if you're able to make a request to the anthropic API from your machines?
Use any non-claude code API key from your console accounts.
Got proper response, have enough credits, while still getting the describe error when running
claudein terminal for claude code.Moreover, I enabled AWS bedrock setup with proper aws token and flags, but still when running the
claudecommand, wireshark shows I am going directly to anthropic instead of aws.P.S.
I am able to properly work with AWS bedrock claude on the same laptop (macbook m1 pro) with lightllm and using direct requests as you mentioned.
@sid374 can you please advise what else can be done to understand why the call to api.claude is rejected or why it is even going to this api, while I defined bedrock api to be used with claude code?
I am having the same issue.
I can authenticate via OAuth to claude.ai.
When I connect directly to the API (using the
curlcommand above), I get the successful response.When I run
claudefrom the command line (after freshly installing v0.2.72) I getI am in the United States, not using any kind of VPN or proxy.
Please advise what can be done to diagnose or provide additional information.
I'm also getting this issue in the United Kingdom.
➕
lol I tried again this morning (changed nothing, just re-ran
claude) and it worked 🤷🏻Resolved my problem by updating the openssl from 3.4.0 to 3.4.1 on my mac.
So if you have my use case run the following in terminal:
Updating to openssl 3.4.1 didn't solve it for me. Still searching for ways to resolve it. My particular problem is
Failed to connect to console.anthropic.com: Request failed with status code 403.@mikelibg how did you arrive at your solution? Did you find any logs?
I am using openssl 3.4.1 and having the same issue.
For whom may be insterested :
Same issue. I am on windows but with docker installed.
After uninstall Docker, it works fine !
I typically run a few instances of Claude Code concurrently, after restarting one of my instances I noticed this issue for the first time (01MAY2025). Oddly enough, my remaining instances were still coding away. Once all instances were restarted, the error became a total block.
I access Claude Code via wsl Ubuntu in the states.
I tried all of these things, which did not work:
sergeanton's recommendation led me to update Docker Desktop, after updating, everything is working fine.
I noticed that anthropic opened up authentication via Max, and Docker updated recently. Curious if these are related to my interdiction.
I have the same issue. I am running claude desktop with a max plan.
I am on windows but accessing claude through wsl in the terminal.
This is the error message that I'm getting:
╭────────────────────────────────────────────╮
✻ Welcome to Claude Code research preview! │
╰────────────────────────────────────────────╯
Unable to connect to Anthropic services
Failed to connect to api.anthropic.com:
Please check your internet connection and network settings.
Note: Claude Code might not be available in your country. Check supported countries at
https://anthropic.com/supported-countries
How do I fix this, want to try claude code asap.
Hi everyone!
I was having the same issue (WSL on Windows), and I was able to fix it by running
sudo apt-get update,sudo apt-get upgrade -y, and then restarting.Hope this helps!
I am experiencing this issue, as well. Out of the blue. No amount of upgrading on my windows or Linux boxens are solving it. Local install, no docker. Issue persists. I cleared configurations, but it remains the same.
Same here, I use it in several terminals with two accounts, and after /login it suddenly started to happen. None of the above solutions seem to work in my case.
Same for me, it suddenly said unable to connect to Anthropic services.
I guess Anthropic blocked all cloud virtual machine IPs? I tested it not working any more for Microsoft Azure.
Carpet bombing entire nets apparently. https://github.com/anthropics/claude-code/issues/984
@Folyd - You're on Azure, and we see the same on DO.
Not working either from my Azure VM in West Europe region.
I'm on Digital Ocean - exactly the same issue, started about six hours ago. Very frustrating.
Solved for me in Azure VMs.
And now for me in DO.
Solved in DO.
I was using WLS2 on CentOS until yesterday, and it was working then, but when I tried to get the latest version to use the MAX account, it stopped working.
$ curl -I https://console.anthropic.com/healthz --max-time 10
HTTP/2 403
date: Sun, 11 May 2025 11:14:24 GMT
content-type: text/html; charset=UTF-8
content-length: 6980
accept-ch: Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA
cf-mitigated: challenge
critical-ch: Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA
cross-origin-embedder-policy: require-corp
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: same-origin
origin-agent-cluster: ?1
permissions-policy: accelerometer=(),autoplay=(),browsing-topics=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()
referrer-policy: same-origin
server-timing: chlray;desc="93e140a66df280c3"
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
expires: Thu, 01 Jan 1970 00:00:01 GMT
set-cookie: __cf_bm=PYtN_RENAxL4xx0_HEZ3Jmihdt7K.a7mjL47i75gD8M-1746962064-1.0.1.1-PJs9PMut0cmMEOpJUK7Px3P1tF5xZN4O8.PIygw9zFLenj68NH7pVRbgG_eP5QombRBVOvtW1JB35Y2vKRk48RO_RA55Fmh57OPzlTxI5Lw; path=/; expires=Sun, 11-May-25 11:44:24 GMT; domain=.console.anthropic.com; HttpOnly; Secure; SameSite=None
server: cloudflare
cf-ray: 93e140a66df280c3-NRT
alt-svc: h3=":443"; ma=86400
In WSL, the solution for me was to set the networking mode to mirrored.
In Powershell:
And in this file:
The issue was that WSL was essentially acting like a network proxy.
I was able to resolve the issue by following the steps below to set up Cloudflare WARP on Linux:
Install and enable Cloudflare WARP client
curl -fsSL https://pkg.cloudflareclient.com/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/cloudflare-client.list && \
sudo apt update && \
sudo apt install -y cloudflare-warp && \
sudo warp-cli register && \
sudo warp-cli connect
These commands will:
Let me know if you’re using a different Linux distribution so I can adjust the steps accordingly.
I tried using different networking modes or Cloudflare WARP as suggested and managed to get further but kept running into the same issue or getaddrinfo EAI_AGAIN errors. Eventually discovered disabling ipv6 as per https://github.com/anthropics/claude-code/issues/532#issuecomment-2859143133 fixed my issue without needing Cloudflare WARP.
Can confirm. Using WSL Ubuntu 24.04 disabling ipv6 instantly fixed the "Unable to connect" issue with Claude Code.
I'm on Windows WSL, and the same issue. When I kill
Docker Desktopprocess, it works! _Say whaaat?_!Image
I'm still experiencing this issue today while using WSL, with no VPN and a stable internet connection. I can access the Claude API and browser, so I think there's a problem with the CLI and the error messages aren't clear.
____
[Update]
I fixed this by configuring .wslconfig.
Step:
Ping and Curl to api.anthropic.com works fine from WSL2. I've tried several of the "fixes" above and none of them have worked. WSL2 - Ubuntu22.04.5 - Windows 10
Ran into this. Disabling IPv6 works. From within wsl, before starting Claude, do:
(It used to work fine. No idea why it stopped, but it started when I forced a logout e.g.
/logout.)I'm working behind a corporate proxy, and our network team has already allowlisted the api.anthropic.com endpoint. However, I was still unable to connect.
Setting NODE_TLS_REJECT_UNAUTHORIZED=0 works but its not ideal, we are looking for a better solution.
NODE_TLS_REJECT_UNAUTHORIZED=0 claudeSimilar here.
It was working fine in WSL, but I wanted to uninstall/reinstall to make sure I had the newest version to use my Pro account..
That ended up being a mess. I eventually got it installed again and it kept having this error.
Running curl in the same WSL window gave me a proper reply and DNS check was fine.
I've tried a bunch of things, but nothing worked.
networkingMode=mirrored isn't supported on my windows version (10)
I updated to the newest version of WSL (from 2.4.x) and that appears to have fixed it.
Worth a try.
I'm running into the same issue.
Disabling IPv6 is blocking communication between Docker and my Windows host machine, and it's cause an another problem.
The problem has not been solved yet
<img width="979" alt="Image" src="https://github.com/user-attachments/assets/a4f6503f-d6b2-479b-9132-9925c1830545" />
I get this error when Docker desktop is open and it works when Docker desktop is closed.
Can you please tell me how you solved this problem? thanks.
Going to WSL settings (in start menu) and changing network mode to mirrored worked for me
Okay, I think this is a good approach. I’ll give it a try. Thanks!
I may have found where the problem lies, but I cannot fix it. This should be resolved by anthropics.
I have worked for 15 years and have never seen anyone put Cloudflare's human verification on an API endpoint.
How to verify that?
You can find Cloudflare waiting for people to pass human verification.
This is very ridiculous. In home environments like apartments, offices, etc., it is very likely to trigger Cloudflare human verification. Why does the API endpoint use Cloudflare human verification?
for me it was the the Network Adapter Disabled. "Hyper-V WSL Adapter"
enabled with:
Enable-NetAdapter -Name "vEthernet (WSL (Hyper-V firewall))" -Confirm:$falseand got my connection back
Make sure you have WSL2
wsl --set-version Ubuntu 2
I obtained a stable connection by taking the following actions.
・Disable Docker Desktop
・Start Docker CE on WSL2 Ubunts
・Disable IPv6
Its a telementry issue. You can bypass the check using:
DISABLE_TELEMETRY=1 claudeHope this helps.
We've fixed a number of related issues over the last few months. This issue should be happening much less often, and when it does happen, error outputs should help you debug the issue. If errors are still not useful, run
claude --debugfor more debug output. Please open a new issue if you are still running into this.This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.