NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #164 most downloaded on PyPI
The official Python library for the anthropic API
Latest stable
2.10.0
Last release today
17 Nov 2026
Ships on a steady schedule
a new release about every 9 days
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
241 releases · first in 2023
Drag across the ruler to compare, or tap a release to open it.
client: add DefaultHttpxClient and DefaultAsyncHttpxClient
## 0.23.1 (2024-04-04) Full Changelog: v0.23.0...v0.23.1 ### Documentation * readme: mention tool use
Your coding agent can read these notes before it upgrades. Set up the MCP server →
## 0.23.0 (2024-04-04) Full Changelog: v0.22.1...v0.23.0 ### Features * api: tool use beta
types: correctly mark type as a required property in requests
client: increase default HTTP max_connections to 1000 and max_keepalive_connections to 100
Full Changelog: v0.21.3...v0.22.0
types: correct typo claude-2.1' to claude-2.1
readme: consistent use of sentence case in headings
internal: loosen input type for util function
vertex: api is no longer in private beta
Full Changelog: v0.20.0...v0.21.0
## 0.20.0 (2024-03-13) Full Changelog: v0.19.2...v0.20.0 ### Features * api: add haiku model (#390) (43b57fc) ### Documentation * readme: mention vert
vertex: use correct auth scopes
internal: add core support for deserializing into number response
api: add enum to model param for message
## 0.18.1 (2024-03-04) Full Changelog: v0.18.0...v0.18.1 ### Chores * readme: update bedrock example
## 0.18.0 (2024-03-04) Full Changelog: v0.17.0...v0.18.0 ### Features * bedrock: add messages API (#362) (5409be9) ### Chores * remove old examples
messages: add support for image inputs
Full Changelog: v0.16.0...v0.17.0
We've removed the beta namespace from the messages API.
Full Changelog: v0.15.1...v0.16.0
We've removed the beta namespace from the messages API.
To migrate to this version you'll just need to remove all .beta references, everything else is the same!
prevent crash when platform.architecture() is not allowed
Full Changelog: v0.15.0...v0.15.1
api: add new usage response fields
interal: make link to api.md relative
## 0.14.0 (2024-01-31) Full Changelog: v0.13.0...v0.14.0 ### Features * bedrock: include bedrock SDK
client: support parsing custom response types
client: enable follow redirects by default
vertex: add support for google vertex
client: add support for streaming raw responses
Full Changelog: v0.9.0...v0.10.0
add None default value to nullable response properties
internal: use ruff instead of black for formatting
api: add messages endpoint with streaming helpers
avoid leaking memory when Client.with_options is used
Full Changelog: v0.7.7...v0.7.8
internal: add tests for proxy change
## 0.7.6 (2023-11-28) Full Changelog: v0.7.5...v0.7.6 ### Chores * deps: bump mypy to v1.7.1
internal: revert recent options change
## 0.7.4 (2023-11-23) Full Changelog: v0.7.3...v0.7.4 ### Chores * internal: options updates
client: attempt to parse unknown json content types
internal: update type hint for helper function
## 0.7.1 (2023-11-16) Full Changelog: v0.7.0...v0.7.1 ### Documentation * readme: minor updates
client: support reading the base url from an env variable
Full Changelog: v0.6.0...v0.7.0
client: adjust retry behavior to be exponential backoff
Full Changelog: v0.5.1...v0.6.0
client: support passing httpx.URL instances to base_url
client: accept io.IOBase instances in file params
Full Changelog: v0.4.0...v0.4.1
allow a default timeout to be set for clients
docs: remove extraneous space in examples
client: add constants to client instances as well
client: add client close handlers
readme: reference "client" in errors section and add missing import
fix(tokenizer): encoding issues for special characters
Full Changelog: https://github.com/anthropics/anthropic-sdk-python/compare/v0.3.2...v0.3.3
upper bound pydantic version to 2.0 by @uripeled2 in https://github.com/anthropics/anthropic-sdk-python/pull/50
Full Changelog: https://github.com/anthropics/anthropic-sdk-python/compare/v0.3.1...v0.3.2
This release prevents the async tokenizer from crashing if called multiple times in the same process, https://github.com/anthropics/anthropic-sdk-pyth
This release prevents the async tokenizer from crashing if called multiple times in the same process, https://github.com/anthropics/anthropic-sdk-python/pull/47.
In v0.3.0, we introduced a fully rewritten SDK.
In v0.3.0, we introduced a fully rewritten SDK.
The new version uses separate sync and async clients, unified streaming, typed params and structured response objects, and resource-oriented methods:
Sync before/after:
- client = anthropic.Client(os.environ["ANTHROPIC_API_KEY"])
+ client = anthropic.Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
# or, simply provide an ANTHROPIC_API_KEY environment variable:
+ client = anthropic.Anthropic();
- rsp = client.completion(**params)
- rsp["completion"]
+ rsp = client.completions.create(**params)
+ rsp.completion
Async before/after:
- client = anthropic.Client(os.environ["ANTHROPIC_API_KEY"])
+ client = anthropic.AsyncAnthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
- await client.acompletion(**params)
+ await client.completions.create(**params)
The .completion_stream() and .acompletion_stream() methods have been removed;
simply pass stream=Trueto .completions.create().
Streaming responses are now incremental; the full text is not sent in each message,
as v0.3 sends the Anthropic-Version: 2023-06-01 header.
<details> <summary>Example streaming diff</summary>
import anthropic
- client = anthropic.Client(os.environ["ANTHROPIC_API_KEY"])
+ client = anthropic.Anthropic()
# Streams are now incremental diffs of text
# rather than sending the whole message every time:
text = "
- stream = client.completion_stream(**params)
- for data in stream:
- diff = data["completion"].replace(text, "")
- text = data["completion"]
+ stream = client.completions.create(**params, stream=True)
+ for data in stream:
+ diff = data.completion # incremental text
+ text += data.completion
print(diff, end="")
print("Done. Final text is:")
print(text)
</details>
Full Changelog: https://github.com/anthropics/anthropic-sdk-python/compare/v0.2.10...v0.3.0
# What's Changed * Add version header Full Changelog: https://github.com/anthropics/anthropic-sdk-python/compare/v0.2.9...v0.2.10
Full Changelog: https://github.com/anthropics/anthropic-sdk-python/compare/v0.2.9...v0.2.10
Remove length check from automatic SDK validations. by @jenan-anthropic in https://github.com/anthropics/anthropic-sdk-python/pull/30
Full Changelog: https://github.com/anthropics/anthropic-sdk-python/compare/v0.2.8...v0.2.9
Remove length check from automatic SDK validations #30
Full Changelog: https://github.com/anthropics/anthropic-sdk-python/compare/v0.2.7...v0.2.8
Fix: UnicodeEncodeError by @anthony-sarkis in https://github.com/anthropics/anthropic-sdk-python/pull/19
Full Changelog: https://github.com/anthropics/anthropic-sdk-python/compare/v0.2.6...v0.2.7
Better async support by @mikelambert in https://github.com/anthropics/anthropic-sdk-python/pull/17
Full Changelog: https://github.com/anthropics/anthropic-sdk-python/compare/v0.2.5...v0.2.6
Fix for async API when handling errors
Fix for async API when handling errors
Raise exceptions on non-200 responses
Full Changelog: https://github.com/anthropics/anthropic-sdk-python/compare/v0.2.3...v0.2.4
Remove extra \n, use claude-v1 by @jacksonkernion in https://github.com/anthropics/anthropic-sdk-python/pull/5
\n, use claude-v1 by @jacksonkernion in https://github.com/anthropics/anthropic-sdk-python/pull/5Full Changelog: https://github.com/anthropics/anthropic-sdk-python/compare/v0.2.2...v0.2.3
One column per quarter.