`AnthropicBedrock` 2.x sends `anthropic_version: 2026-10-21`, which Bedrock rejects for Claude Sonnet 4.5, Opus 4.5 and Opus 4.6
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
Start in src/anthropic/lib/bedrock/_client.py and inspect how the Bedrock client sets the default anthropic_version; the issue includes the changed lines and a reproduction. Add or locate tests for the Bedrock request body, including older and newer Claude models. Done means requests use a version accepted by the affected models while preserving the documented override behavior.
Written by the indexing model from the issue text.
Description
Since 2.0.0, the Bedrock client's default request body anthropic_version is the Messages API version 2026-10-21 instead of bedrock-2023-05-31:
# src/anthropic/lib/bedrock/_client.py
-DEFAULT_VERSION = "bedrock-2023-05-31"
- options.json_data.setdefault("anthropic_version", DEFAULT_VERSION)
+ options.json_data.setdefault("anthropic_version", ANTHROPIC_API_VERSION)
Bedrock rejects that value for some Claude models that are still available there:
anthropic.BadRequestError: Error code: 400 - {'message': 'Invalid API version: 2026-10-21'}
The same code works on 1.17.0. Newer models (Claude Opus 4.8, Sonnet 4.6, Haiku 4.5 and the Claude 5 family) accept the new value, so only the older models break. The 2.0.0 changelog doesn't mention any change to Bedrock (or Vertex) request versioning.
Reproduction
# pip install "anthropic[bedrock]==2.1.0"
# auth: AWS_BEARER_TOKEN_BEDROCK or the usual AWS credential chain
import anthropic
client = anthropic.AnthropicBedrock(aws_region="us-east-1")
for model in [
"us.anthropic.claude-sonnet-4-5-20250929-v1:0",
"global.anthropic.claude-opus-4-5-20251101-v1:0",
"us.anthropic.claude-opus-4-6-v1",
"us.anthropic.claude-opus-5-5", # works, for comparison
]:
for extra_body in (None, {"anthropic_version": "bedrock-2023-05-31"}):
try:
client.messages.create(
model=model,
max_tokens=16,
messages=[{"role": "user", "content": "Say ok"}],
extra_body=extra_body,
)
result = "ok"
except anthropic.APIStatusError as e:
result = f"{e.status_code} {e.message}"
print(f"{model:48} override={extra_body is not None!s:5} -> {result}")
Output with anthropic==2.1.0:
us.anthropic.claude-sonnet-4-5-20250929-v1:0 override=False -> 400 Error code: 400 - {'message': 'Invalid API version: 2026-10-21'}
us.anthropic.claude-sonnet-4-5-20250929-v1:0 override=True -> ok
global.anthropic.claude-opus-4-5-20251101-v1:0 override=False -> 400 Error code: 400 - {'message': 'Invalid API version: 2026-10-21'}
global.anthropic.claude-opus-4-5-20251101-v1:0 override=True -> ok
us.anthropic.claude-opus-4-6-v1 override=False -> 400 Error code: 400 - {'message': 'Invalid API version: 2026-10-21'}
us.anthropic.claude-opus-4-6-v1 override=True -> ok
us.anthropic.claude-opus-5-5 override=False -> ok
us.anthropic.claude-opus-5-5 override=True -> ok
With anthropic==1.17.0, all eight requests succeed, since the default there is bedrock-2023-05-31.
Expected behavior
The Bedrock client sends a version that every Claude model on Bedrock accepts, as 1.x did, or it picks the version per model.
Workaround
Pass extra_body={"anthropic_version": "bedrock-2023-05-31"}. The client only sets the field when the body doesn't already have one.
Possibly related
2.0.0 made the same change to AnthropicVertex (vertex-2023-10-16 → 2026-10-21). I couldn't verify whether Vertex rejects it for any models.
Environment
- anthropic 2.1.0 (2.0.0 has the same default); works on 1.17.0
- Python 3.13
- Bedrock region us-east-1
- Dominant language
- Python
- Stars
- 4k
- Forks
- 892
- Avg merge
- 6m
- Merged PRs (30d)
- 4
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anthropics/anthropic-sdk-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
anthropics/anthropic-sdk-python#2029 ·
Maintainers usually reply within 2 days
-
Fix test collection and execution errors on Windows (geteuid, FileStore skip, bedrock tempfile lock)Possibly taken @prasad2512 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
anthropics/anthropic-sdk-python#2027 ·
Maintainers usually reply within 2 days
-
Three symlink tests in test_agent_toolset.py are missing the needs_symlinks markerPossibly taken @okxint claimed this 46 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
anthropics/anthropic-sdk-python#1915 · 3 comments ·
Maintainers usually reply within 2 days
-
Messages.parse (and AsyncMessages.parse) don't take cache_control?Possibly taken @Alphaxiaoteng claimed this 50 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anthropics/anthropic-sdk-python#1907 ·
Maintainers usually reply within 2 days
-
Windows: os.fchmod in credential write-back bricks the OAuth refresh tokenPossibly taken @OllieinCanada claimed this 63 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
anthropics/anthropic-sdk-python#1868 · 1 comment ·
Maintainers usually reply within 2 days
All issues in anthropics/anthropic-sdk-python
Similar issues
-
[Resource]: LoreOpenresource-submission validation-passed
Difficulty 1/5 Under an hour Newbie friendliness 88/100
hesreallyhim/awesome-claude-code#3234 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openminion/openminion#376 ·
Maintainers usually reply within 1 day
-
Type: ☹︎ Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
posit-dev/great-tables#1028 ·
Maintainers usually reply within 1 day
-
integration: apple_tv
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
home-assistant/core#188282 · 1 comment ·
Maintainers usually reply within 1 day
-
A "since" range is worded as a career: "the past two seasons" says "regular season career (2025 on)"OpenP4: low
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
jeffknupp/association#538 ·