Claude SDK for Python
The Claude SDK for Python provides access to the Claude API from Python applications.
Documentation
Tool helpers (@beta_tool, the tool runner and ToolError) are documented in tools.md. The browser and computer toolset classes have their own guides, browser-toolset.md and computer-toolset.md.
Full documentation is available at platform.claude.com/docs/en/api/sdks/python.
Installation
pip install anthropic
Upgrading from a 0.x release? See the v1 migration guide.
Getting started
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ.get("ANTHROPIC_API_KEY"), # This is the default and can be omitted
)
message = client.messages.create(
max_tokens=1024,
messages=[
{
"role": "user",
"content": "Hello, Claude",
}
],
model="claude-opus-5-5",
)
print(message.content)
Requirements
Python 3.10+
Contributing
See CONTRIBUTING.md.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for anthropic 1.12.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| anthropic-1.12.1.tar.gz | 1.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| anthropic-1.12.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.5 MB
Release files / anthropic-1.12.1.tar.gz
| Download URL | anthropic-1.12.1.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10f720ab6ddf40ef12e0e5743412c3a6dfac1109c244e633c9a2dbd36778ad30
|
|
BLAKE2b-256 checksum How to use checksums |
bdcc0da23e94020c62c0077c17648252f32d575b187710faaf3b85145e8e555d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / anthropic-1.12.1-py3-none-any.whl
| Download URL | anthropic-1.12.1-py3-none-any.whl |
|---|---|
| Size | 1.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c1469bb3f4118291756816b7850cc839f17b2be5cdc99c8fde3890a61a49ca2
|
|
BLAKE2b-256 checksum How to use checksums |
8b351ccdc3e950dd869b66de15035e15d9614607fcef9664dec403fe639f01df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|