Connecting to api.anthropic.com eventhough configured for bedrock

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 8 comments · opened Mar 2, 2025 · closed Mar 5, 2025
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

For the following configuration I see the claude is still accessing api.anthropic.com

export CLAUDE_CODE_USE_BEDROCK=1
export ANTHROPIC_MODEL='us.anthropic.claude-3-7-sonnet-20250219-v1:0'
export DISABLE_PROMPT_CACHING=1
export AWS_ACCESS_KEY_ID='ID'
export AWS_SECRET_ACCESS_KEY='KEY'
export AWS_REGION='us-west-2'
export AWS_PROFILE=

export https_proxy="proxy"

> claude

I see the following:

â â» Welcome to Claude Code research preview! â
â°âââââââââââââââââââââââââââââââââââââââââââââ¯

Unable to connect to Anthropic services

Failed to connect to api.anthropic.com: fetch failed

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

Note I am behind a firewall and have access to AWS bedrock but not to api.anthropic

View original on GitHub ↗

8 Comments

bcherny collaborator · 1 year ago

Could you post a screenshot?

sudhakar2do · 1 year ago

!Image

Does this help?

mudduck · 1 year ago

fwiw have same issue on wsl:

!Image

mckunkel · 1 year ago

I have the same issue with the same setup. I am able to invoke us.anthropic.claude-3-7-sonnet-20250219-v1:0 from the machine I am trying to run claude-code on via aws bedrock call.

ghost · 1 year ago

Thank you for the reports! Should be fixed in latest version

vonmike · 1 year ago

Still getting the same issue with 0.2.29 (Claude Code)
And this is also not related to the link of timeout issue #410
You get the error while running the "claude" command.
There is also no debug/verbose option to get more details.
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.

vonmike · 1 year ago
Still getting the same issue with 0.2.29 (Claude Code) And this is also not related to the link of timeout issue #410 You get the error while running the "claude" command. There is also no debug/verbose option to get more details. 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.

Was resolved after updating openssl version on the machine.

github-actions[bot] · 1 year ago

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.