Skip to content

[BUG][bedrock] Opus 4.6 [1m] selection writes invalid model id → 400 "The provided model identifier is invalid" #23499

@IsaacZhangg

Description

@IsaacZhangg

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When using Claude Code CLI against AWS Bedrock, selecting the 1M context variant of Claude Opus 4.6 ([1m]) causes requests to fail with:

  • 400 The provided model identifier is invalid.

This looks like a model-ID handling bug specific to the [1m] suffix on Bedrock. After selecting the [1m] option via /model, the CLI appears to persist a non–Bedrock-qualified identifier in settings.json, e.g.:

  • Observed in settings.json: claude-opus-4-6-v1[1m]
  • Expected for Bedrock: us.anthropic.claude-opus-4-6-v1[1m]

As a result, Bedrock rejects the request even though the 1M context variant should be reachable when the correct model ID (and any required headers) are used.

What Should Happen?

Claude Code CLI should preserve the fully-qualified Bedrock model ID and successfully execute requests when the [1m] variant is selected, i.e. use:

  • us.anthropic.claude-opus-4-6-v1[1m]

The call should succeed, and the 1M context option should be active / reported correctly.

Error Messages/Logs

API Error (claude-opus-4-6[1m]): 400 The provided model identifier is invalid.

Steps to Reproduce

  1. Ensure AWS credentials are configured and the us-east-1 region is selected.
  2. Configure/run Claude Code using the model ID with the [1m] suffix, for example:
    • export ANTHROPIC_MODEL="claude-opus-4-6[1m]"
    • Or in Claude Code CLI, set the model via /model and select the option that uses the [1m] suffix.
  3. Run any command that initiates an API call (e.g., ask a question).

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.32 (Claude Code)

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    api:bedrockIssue relates to AWS Bedrockarea:modelbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions