Permission denied with aws bedrock but working with aws cli

Resolved 💬 8 comments Opened Feb 25, 2025 by oscarthorn Closed Feb 26, 2025

Hi!

I can access claude 3.7 with

aws bedrock-runtime invoke-model --model-id us.anthropic.claude-3-7-sonnet-20250219-v1:0 --body '{"anthropic_version":"bedrock-2023-05-31","max_tokens":100,"messages":[{"role":"user","content":"Hello, are you working?"}]}' --cli-binary-format raw-in-base64-out --region us-east-1 --profile PROFILE output.json

I get a response and everything seems to be working. But with claude code I get

API Error: 403 You don't have access to the model with the specified model ID.

No matter how I start claude code.

For example
AWS_REGION=us-east-1 AWS_PROFILE=PROFILE CLAUDE_CODE_USE_BEDROCK=1 ANTHROPIC_MODEL='us.anthropic.claude-3-7-sonnet-20250219-v1:0' DISABLE_PROMPT_CACHING=1 claude

View original on GitHub ↗

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