Vibeleaderboard
← All Intel
Intel / repo

anthropic-sdk-python v2.0.0

Source
github.com
Publisher
Anthropic
Author
anthropic-sdks-releaser[bot]Top Viber
Date

Context

The v2.0.0 release notes for Anthropic's Python SDK list only support for API version 2026-10-21 as the breaking change. The weight of that line comes from how versioning works: every API request carries a version header, and per Anthropic's migration guide, an SDK sends whichever version was current when its major version was released. Upgrading the anthropic package to 2.0.0 is therefore how Python code moves from 2023-06-01 to 2026-10-21. The TypeScript SDK made the same move in its sdk-v1.0.0 release. On Amazon Bedrock the new version works only with Claude 4.7 and later models, so the guide tells callers of older Bedrock models to stay on the SDK version they use today.

The change most likely to affect existing code is that the new version removes the , top_p and top_k sampling parameters: a request that sends any of them gets a 400 error, even at the default value, and the latest SDK majors no longer have them. Anthropic says requests then sample at the defaults, which changes nothing for models that already accept only the defaults, such as Claude 4.7 and later. On models that accepted other values, such as Claude Sonnet 4.6, code that lowered temperature for more consistent output loses that effect, and the guide offers no substitute other than keeping that request on 2023-06-01.

The version history lists the other API breaks. Document blocks placed directly in assistant messages, and non-empty citations on text blocks in user messages, now return 400 errors. Admin API and Enterprise Analytics responses drop old names in favor of new ones; API keys, for example, report scope.workspace_id instead of workspace_id. The release's other additions are a workspace_id filter and a usage_tier scope type for listing spend limits.

The migration guide also lists changes in the SDK itself that the release notes do not mention. Python 2.0.0 sends the API key as an : Bearer header instead of X-Api-Key; the API accepts either, but a proxy or gateway that reads X-Api-Key needs updating. A client now holds one , so passing both api_key and auth_token raises a ValueError. Calling MessageParam as a constructor raises a TypeError, though messages written as plain dicts need no change, and the non-beta models methods no longer take betas. The SDK also moves from the MIT license to Apache 2.0.

Terms in this piece · Glossary
  • Sampling controls — Parameters that shape how deterministic or varied model generation becomes.
  • Field — One named piece of a record, such as name or approved_on; a record is one entity's set of values, one per field.
  • Authorization — The check that an authenticated identity is permitted to perform a particular operation on a particular resource.
  • Credential — Something presented with a request to prove that the sender is a particular identity, such as a password or a generated key.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

More from anthropic-sdks-releaser[bot]
Recommended reads