A quiet but important change landed in the Anthropic Python SDK this week. If you're using Amazon Bedrock with Anthropic's models and depend on user profiles, the way you send user_profile_id just changed. The SDK now places it in the request body, matching what Bedrock expects, rather than in a header that Bedrock ignores.
Previously, if you set a profile ID with AnthropicBedrock or AsyncAnthropicBedrock, the SDK would send it as an anthropic-user-profile-id header. Bedrock didn't read this header, so your profile ID was silently ignored. This meant requests that should have used a specific user profile actually didn't—unless you manually inserted the ID into the request body, which most people didn't.
Bedrock now reads user_profile_id from the body
With 2.12.0, both Bedrock clients move user_profile_id into the body of Messages requests. If there's already a user_profile_id in the body, that takes priority over the header. The header is no longer sent at all.
This is a breaking change if you relied on the old (broken) behaviour, but it's a fix for anyone who expected user profiles to work. If you target models on Bedrock that support user profiles, your requests will now include the profile as intended.
New error handling for unsupported models
Some Bedrock-hosted models don't support user profiles at all. Before, if you sent a profile ID to one of these, Bedrock would ignore it and process the request anyway. Now, you'll get a 400 error. The fix is simple: leave the ID off requests to models that don't support profiles.




