Skip to content

fix(beta): strip betas from individual batch request params#1152

Open
Ashutosh0x wants to merge 3 commits intoanthropics:mainfrom
Ashutosh0x:fix/batch-betas
Open

fix(beta): strip betas from individual batch request params#1152
Ashutosh0x wants to merge 3 commits intoanthropics:mainfrom
Ashutosh0x:fix/batch-betas

Conversation

@Ashutosh0x
Copy link

Fixes #1118. Strip 'betas' or 'anthropic-beta' from individual request params in Batch creation. This prevents 400 Bad Request errors when users include betas inside individual requests, as the Messages API expects these as headers, not body parameters.

Adds method aliases for tool_runner and stream to both Messages and
AsyncMessages classes in the Bedrock beta module. This provides feature
parity between the first-party Anthropic client and the AnthropicBedrock
client, enabling enterprise AWS Bedrock users to use:
- Automatic tool execution loops (tool_runner)
- Streaming message helpers (stream)

Note: parse method excluded as Bedrock doesn't support the structured
output beta header required by it.

Fixes anthropics#1106
@Ashutosh0x Ashutosh0x requested a review from a team as a code owner January 26, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug: Batch + Structured Outputs] betas parameter in MessageCreateParamsNonStreaming causes batch requests to fail

1 participant