anthropic-sdk-python v2.12.0
- Source
- github.com
- Author
- anthropic-sdks-releaser[bot]Top Viber
- Date

Context
The main change in version 2.12.0 of Anthropic's Python SDK is a fix for platforms that serve Claude to their own customers through Amazon Bedrock: the end-customer IDs they attached to requests had not been applied (release notes). Those IDs belong to user profiles, records a platform creates for each end customer so Anthropic can tell whose request is whose. Anthropic's documentation gives the reason they exist. Anthropic's automated safety classifiers watch API traffic, and a request without a profile counts as the platform's own usage, so if one end customer's traffic triggers a restriction or ban, it lands on the platform's whole organization instead of on that customer.
Before this release, the SDK's two Bedrock clients, `AnthropicBedrock` and `AsyncAnthropicBedrock`, sent the profile ID in the `anthropic-user-profile-id` header, as the Claude API expects. Bedrock ignores that header and reads the ID only from a `user_profile_id` field in the request body, so the ID was never applied. Nothing signalled the problem, because the documentation says Bedrock only checks that an ID is well formed and does not look up the profile. Both clients now move the ID into the body of Messages requests and stop sending the header, and a `user_profile_id` already placed in the body takes priority.
There is one new error to expect. Some Bedrock models do not support user profiles, and a request to one of them that carries a profile ID now returns a 400 error instead of having the ID ignored. The notes advise leaving the ID off for those models without listing them. The release also adds the `image_dimensions_too_large` API error code and clarifies the documentation of `billing_policy` in batches and of two billing errors. The Bedrock SDK for TypeScript received the same profile fix in version 1.1.3.
Checking sign-in…
Loading comments…





