What changed in Anthropic Python SDK from 1 to 2

9 releases numbered after v1.17.0 up to and including v2.8.0, stable releases only. v1.17.0 and v2.8.0 are the newest stable releases of 1 and 2 we track; this page follows them as new ones ship.

74 changes across 9 releases

Added 26

v2.8.0

  • Add Claude Tag metrics to the analytics summaries and users reports
  • Add reply_mode to Claude Tag Slack channel settings

v2.7.0

  • Accept user_profile.program_status_updated on organization webhook endpoints
  • Add claude-fable-5-2 and claude-mythos-5-2 models
  • Add parent organization filtering and grouping to the usage and cost reports
  • Add the sandbox_egress_restricted error to Admin API write methods
  • Add the user_profile.program_status_updated webhook event

v2.6.0

  • Add error code for ramp limit errors
  • Add error codes for External Key validation failures
  • Add support for signing organization members out everywhere

v2.5.0

  • Add error details types and new error type values
  • Add ids filter to list workspaces
  • Add error classes for HTTP statuses and API error codes, and error_code, details and api_message on APIStatusError

v2.4.0

  • Add GA methods for analytics, spend limits and RBAC
  • Add named beta types for unified metrics and RBAC delete responses
  • Add shared analytics order and increase request actor types
  • Add tool_use_limit_reached_error and compaction_limit_reached_error session error types
  • Add types for analytics group_by and spend limit period filters
  • Add user_profile_id to External Keys and Workspaces

v2.3.0

  • Add Claude Tag endpoints for Claude Enterprise organizations

v2.2.0

  • Add support for message threads in the API.
  • Add usage and cost reports by dimension, and mark older reports as legacy.

v2.1.0

  • Add enforcement status, actions and filter to user profiles in the API.

v2.0.0

  • Add support for new API version 2026-10-21
  • Add a workspace_id filter to list spend limits
  • Add the usage_tier scope type to list spend limits
Changed 11

v2.3.0

  • Stop sending query params hardcoded in endpoint paths
  • Improve the descriptions of the code execution tool and its encrypted results
  • Reword work queue, skill and external key descriptions
  • Update descriptions of the per-user usage and cost reports
  • Carry endpoint path query params to the request layer
  • Read the beta route qualifier instead of the beta=true query
  • Stop sending the beta query param from parse and stream
  • Check the repository by owner and public name in workflows
  • Update the Google Cloud product name
  • Link the Bedrock and Vertex raw response docstrings to the SDK documentation

v2.0.0

  • Remove outdated system role note from messages description
Fixed 35

v2.8.0

  • Send ";" in a Bedrock model ID as is, and refuse a model ID whose part before the first ";" is empty, "." or ".."
  • Percent-encode the project, location and workspace ID in the workspace and organization base URL paths for Google Cloud
  • Refuse an empty project, location or workspace ID that would be written into a derived Google Cloud base URL
  • Refuse an empty model, project ID or region for Vertex instead of writing it into the request path
  • Send ";" in the Vertex model as %3B in the request path

v2.7.0

  • Add the parse and count_tokens methods missing from beta.messages.with_raw_response and with_streaming_response on the Bedrock and Vertex clients
  • Send the X-Stainless-Async header and stream raw requests that name no stream class on the Bedrock and Vertex clients
  • Sign Bedrock requests that have no Connection header instead of raising KeyError
  • Write a list in a query as a[]=1&a[]=2 on the Bedrock Mantle clients, as Anthropic does
  • Allow API errors to be unpickled and copied
  • Read ANTHROPIC_CUSTOM_HEADERS on the Bedrock, Bedrock Mantle and Vertex clients
  • Stop copy, with_options and with_middleware from raising when ANTHROPIC_FOUNDRY_RESOURCE is set
  • Keep const in structured output schemas, and drop type beside const and enum

v2.6.0

  • Raise error-code and status exception classes on Bedrock and Vertex platform clients
  • Keep a custom http_client and aws_profile on copies made with copy and with_options on the Bedrock client

v2.5.0

  • Capitalize CMEK in error details type names
  • Move some error details types to the resource they describe
  • Raise a ValueError when model is "." or ".." instead of sending the request to a different path
  • Raise a ValueError when model is empty instead of sending the request to /model//invoke
  • Make OverloadedError and ServiceUnavailableError subclasses of InternalServerError
  • Make the first parse of each response model thread-safe
  • Reject path parameters such as '..;x' and ';x'
  • Validate unions correctly across threads on pydantic v1
  • Keep the memory tool from renaming or deleting the /memories directory
  • Percent-encode the model, project ID and region in the request path for Vertex

v2.4.0

  • Make spend_limit nullable in the spend limit increase request approve response
  • Require always-sent analytics fields and drop the unused project product field
  • Let pydantic validate params types that accept omit

v2.3.0

  • Send user profiles requests to the organization endpoint for Google Cloud
  • Remove the stray await from the async tool_runner examples

v2.2.0

  • Stop suggesting math.inf in the max_retries error message.
  • Leave the tool runner's history to the caller after append_messages(), and keep the current reply out of the set_messages_params() callback.
  • Keep running the tool runner's function tools when set_messages_params() gives tools as definitions, and stop running one it takes out of tools.
  • Give the set_messages_params() callback of a tool runner its tools as definitions again.
  • Keep a tool runner's betas, user_profile_id and workspace_id when set_messages_params() leaves them out.
Removed 2

v2.7.0

  • Remove some error detail types

v2.3.0

  • Remove preview build upload from CI

Original release notes, newest first

The list above is our reading of these notes; the originals from Anthropic are here, one fold per release.

v2.8.0
Features
  • api: add Claude Tag metrics to the analytics summaries and users reports
  • api: add reply_mode to Claude Tag Slack channel settings
Bug Fixes
  • bedrock: send ";" in a model ID as is, and refuse a model ID whose part before the first ";" is empty, "." or ".."
  • google-cloud: percent-encode the project, location and workspace ID in the workspace and organization base URL paths
  • google-cloud: refuse an empty project, location or workspace ID that would be written into a derived base URL
  • vertex: refuse an empty model, project ID or region instead of writing it into the request path
  • vertex: send ";" in the model as %3B in the request path
Chores
  • docs: clarify display_name for RBAC Roles created by Anthropic
  • docs: clarify plugin delete and skill name conflict descriptions
  • docs: clarify when to omit user_profile_id on external keys
  • docs: note that Claude Tag settings accept self-hosted runner pools
  • internal: make three timing tests tolerate slow test machines
  • internal: remove a redundant import from the message types
Documentation
  • examples: show multiagent when creating a Managed Agents agent

View originalPermalink

v2.7.0
Features
  • api: accept user_profile.program_status_updated on organization webhook endpoints
  • api: add claude-fable-5-2 and claude-mythos-5-2
  • api: add parent organization filtering and grouping to the usage and cost reports
  • api: add the sandbox_egress_restricted error to Admin API write methods
  • api: add the user_profile.program_status_updated webhook event
Bug Fixes
  • bedrock,vertex: add the parse and count_tokens methods missing from beta.messages.with_raw_response and with_streaming_response
  • bedrock,vertex: send the X-Stainless-Async header and stream raw requests that name no stream class
  • bedrock: sign requests that have no Connection header instead of raising KeyError
  • bedrock: write a list in a query as a[]=1&a[]=2 on the Bedrock Mantle clients, as Anthropic does
  • client: allow API errors to be unpickled and copied
  • client: read ANTHROPIC_CUSTOM_HEADERS on the Bedrock, Bedrock Mantle and Vertex clients
  • foundry: stop copy, with_options and with_middleware from raising when ANTHROPIC_FOUNDRY_RESOURCE is set
  • parse: keep const in structured output schemas, and drop type beside const and enum
Chores
  • api: remove some error detail types and update descriptions
  • docs: say when a work heartbeat does not compare its value
  • internal: add this repository's review rules
  • internal: remove two comments from the error classes

View originalPermalink

v2.6.0
Features
  • api: add error code for ramp limit errors
  • api: add error codes for External Key validation failures
  • api: add support for signing organization members out everywhere
Bug Fixes
  • bedrock,vertex: raise error-code and status exception classes on platform clients
  • bedrock: keep a custom http_client and aws_profile on copies made with copy and with_options
Chores
  • client: stop recording sampling parameters on OpenTelemetry spans
  • docs: describe the type and message of API errors
  • internal: define the status error mapping once on the base client
  • internal: tell contributors when a runtime type check belongs
  • tests: remove ambient ANTHROPIC_ and AWS_ variables before the tests run
Documentation
  • client: describe the type, message, code and details of API errors
  • client: list each method's errors without their descriptions

View originalPermalink

v2.5.0
Features
  • api: add error details types and new error type values
  • api: add ids filter to list workspaces
  • client: add error classes for HTTP statuses and API error codes, and error_code, details and api_message on APIStatusError
Bug Fixes
  • api: capitalize CMEK in error details type names
  • api: move some error details types to the resource they describe
  • bedrock: raise a ValueError when model is "." or ".." instead of sending the request to a different path
  • bedrock: raise a ValueError when model is empty instead of sending the request to /model//invoke
  • client: make OverloadedError and ServiceUnavailableError subclasses of InternalServerError
  • client: make the first parse of each response model thread-safe
  • client: reject path parameters such as '..;x' and ';x'
  • client: validate unions correctly across threads on pydantic v1
  • tools: keep the memory tool from renaming or deleting the /memories directory
  • vertex: percent-encode the model, project ID and region in the request path
Chores
  • api: update example values for pattern-constrained string fields
  • ci: also run the tests with deferred pydantic model builds
  • docs: clarify plugin reach values
  • docs: clarify plugin version description and plugin reach
  • docs: clarify plugin version description length
  • docs: clarify some API field descriptions
  • docs: clarify three error descriptions
  • docs: clarify which blocks to send back around a fallback block
  • docs: correct Claude Tag direct message notes in usage reports
  • docs: reword Dream and RBAC role permission descriptions
  • docs: update the telemetry destination headers description
  • docs: use the Claude Platform name in analytics filter docs
  • internal: accept changelog entry files in the changelog check
  • internal: move error body helpers into the internal utils
  • internal: remove stale TODO comments and a test that could not pass
  • tests: check that a None path param is rejected
Documentation
  • api: show each field's own description for speed
  • clean up escapes and code spans in doc comments

View originalPermalink

v2.4.0
Features
  • api: add GA methods for analytics, spend limits and RBAC
  • api: add named beta types for unified metrics and RBAC delete responses
  • api: add shared analytics order and increase request actor types
  • api: add tool_use_limit_reached_error and compaction_limit_reached_error session error types
  • api: add types for analytics group_by and spend limit period filters
  • api: add user_profile_id to External Keys and Workspaces
Bug Fixes
  • api: make spend_limit nullable in the spend limit increase request approve response
  • api: require always-sent analytics fields and drop the unused project product field
  • client: let pydantic validate params types that accept omit
Chores
  • ci: remove unused build upload steps
  • docs: clarify the Slack channel id description
  • docs: clarify what disabling the Compliance API stops
  • docs: clarify what the capability_access_all role action grants
  • docs: link Dreams model fields to the supported models section
  • docs: update example user ID in Admin API examples
  • internal: add a section for each repository's own review rules
  • internal: plainer wording in worker comments
Documentation
  • client: add missing await to the async parse() docstring example
  • examples: keep the message threads example valid on Sonnet 5.5
  • examples: use current model IDs
  • readme: point to the docs site for documentation
  • link to the SDK documentation instead of removed README sections

View originalPermalink

v2.3.0
Features
  • api: add Claude Tag endpoints for Claude Enterprise organizations
Bug Fixes
  • google-cloud: send user profiles requests to the organization endpoint
Chores
  • client: stop sending query params hardcoded in endpoint paths
  • docs: improve the descriptions of the code execution tool and its encrypted results
  • docs: reword work queue, skill and external key descriptions
  • docs: update descriptions of the per-user usage and cost reports
  • internal: carry endpoint path query params to the request layer
  • internal: check the repository by owner and public name in workflows
  • internal: read the beta route qualifier instead of the beta=true query
  • internal: remove preview build upload from CI
  • internal: stop sending the beta query param from parse and stream
Documentation
  • mcp: remove the stray await from the async tool_runner examples
  • google-cloud: update the product name
  • client: link the Bedrock and Vertex raw response docstrings to the SDK documentation
  • update the README and the example request

View originalPermalink

v2.2.0
Features
  • api: add support for message threads
  • api: add usage and cost reports by dimension, mark older reports legacy
Bug Fixes
  • client: stop suggesting math.inf in the max_retries error message
  • tools: leave the tool runner's history to the caller after append_messages(), and keep the current reply out of the set_messages_params() callback
  • tools: keep running the tool runner's function tools when set_messages_params() gives tools as definitions, and stop running one it takes out of tools
  • tools: give the set_messages_params() callback of a tool runner its tools as definitions again
  • tools: keep a tool runner's betas, user_profile_id and workspace_id when set_messages_params() leaves them out
Chores
  • deps: bump certifi in the dev lockfile
  • docs: clarify plugin content scan and validation descriptions
  • docs: clarify plugin served_version_pinned and updated_at
  • docs: fix usage and cost report examples and ending_at docs
  • docs: rate limit model lists vary by organization and workspace

View originalPermalink

v2.1.0
Features
  • api: add enforcement status, actions and filter to user profiles

View originalPermalink

v2.0.0
⚠ BREAKING CHANGES
  • api: add support for new API version 2026-10-21
Features
  • api: add a workspace_id filter and the usage_tier scope type to list spend limits
  • api: add support for new API version 2026-10-21
Documentation
  • api: remove outdated system role note from messages description

View originalPermalink