Claude Code forces Anthropic authentication on first run despite configured Bedrock credentials

Resolved 💬 3 comments Opened Feb 25, 2025 by htunkelo Closed Feb 26, 2025

When attempting to use Claude Code for the first time with properly configured AWS Bedrock credentials (both permanent IAM user credentials and temporary credentials), the tool still forces authentication through Anthropic Console instead of using the Bedrock credentials. This prevents usage when Anthropic is limiting new sign-ups due to capacity issues, even though AWS Bedrock capacity is available.

Steps to Reproduce
Set the following environment variables:

CLAUDE_CODE_USE_BEDROCK=1
ANTHROPIC_MODEL='us.anthropic.claude-3-7-sonnet-20250219-v1:0'
DISABLE_PROMPT_CACHING=1

Configure AWS credentials through either:
Permanent IAM user credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
Temporary credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN)

Run the claude command in terminal for the first time (never configured Claude Code before)

Current Behavior
Prompts "Press Enter to login to your Anthropic Console account..."
Opens browser to console.anthropic.com for OAuth authentication
Shows capacity limit message: "Claude Code is currently experiencing high demand. Anthropic has paused sign ups to provide the best possible service to customers. We'll notify you when we have a spot for you!"

Expected Behavior
According to the announcement of Claude Code, it should use the AWS Bedrock credentials instead of requiring Anthropic authentication when the appropriate environment variables are set, especially since Claude 3.7 Sonnet is available on "Amazon Bedrock" as stated in the documentation.

Environment
Operating System: MacOs Sequioa 15.3.1 (24D70)
Node.js version: v23.7.0
AWS Bedrock region: us-east-1

Additional Context

  • This is a first-time setup of Claude Code
  • Tested with both permanent IAM user credentials and temporary credentials
  • AWS Bedrock credentials have been verified to work with other services
  • The model specified (anthropic.claude-3-7-sonnet-20250219-v1:0) is available in my Bedrock account
  • All environment variables are set in the same terminal session where Claude Code is being launched

This appears to be an issue with the authentication flow not properly detecting or respecting the Bedrock configuration on first run, forcing users to authenticate through Anthropic even when Bedrock credentials are properly configured.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗