anthropic
v0.121.0The official Python library for the anthropic API
1011 KB Python 3.9+ py3-none-anyMIT License8 deps
$ uv add anthropicClaude SDK for Python
The Claude SDK for Python provides access to the Claude API from Python applications.
Documentation
Full documentation is available at platform.claude.com/docs/en/api/sdks/python.
Installation
pip install anthropic
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-4-6",
)
print(message.content)
Requirements
Python 3.9+
Contributing
See CONTRIBUTING.md.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Details
- Version
- 0.121.0
- License
- MIT License
- Python
- >=3.9
- Maintainer
- Anthropic <[email protected]>
Links
Release Cadence
77
releases in the past year
avg 6 days between releases
Maintainers
- Anthropic · [email protected]