[BUG] Claude Code Bedrock Model Configuration Error

Resolved 💬 11 comments Opened May 30, 2025 by cloudeep-innovation Closed Jun 4, 2025

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [X] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: <!-- output of claude --version -->
  • Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 -->
  • Terminal: <!-- e.g. iTerm2, Terminal App -->

Bug Description

Unable to configure Claude Code to use AWS Bedrock with Claude Sonnet 4. Getting a "provided model identifier is invalid" error when attempting to set the global configuration for Bedrock usage.

Steps to Reproduce

  1. Run the following command to configure Claude Code for AWS Bedrock:

``bash
claude config set --global env '{"CLAUDE_CODE_USE_BEDROCK": "true", "ANTHROPIC_MODEL": "apac.anthropic.claude-sonnet-4-20250514-v1:0"}'
``

  1. Attempt to use Claude Code with the Bedrock configuration
  2. Error occurs immediately

Expected Behavior

Claude Code should successfully configure to use AWS Bedrock with Claude Sonnet 4 model and allow normal operation through Bedrock API.

Actual Behavior

Configuration fails with the following error:

API Error (apac.anthropic.claude-sonnet-4-20250514-v1:0): 400 The provided model identifier is invalid.

arn:aws:bedrock:ap-northeast-1:XXXX:inference-profile/apac.anthropic.claude-sonnet-4-20250514-v1:0

Interrupted by user

Additional Context

  • Using AWS region: ap-northeast-1 (Asia Pacific - Tokyo)
  • The error shows Claude Code is attempting to construct an ARN with an inference profile
  • The model identifier format apac.anthropic.claude-sonnet-4-20250514-v1:0 appears to be incorrect for AWS Bedrock
  • Standard Bedrock model identifiers typically use format like anthropic.claude-3-5-sonnet-20241022-v2:0
  • May be related to regional model availability or incorrect model ID format for Bedrock

View original on GitHub ↗

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