anthropics/anthropic-sdk-python
Python
Captured source
source ↗GH
Source ↗published Jan 17, 2023seen 6dcaptured 9hhttp 200method plain
anthropics/anthropic-sdk-python
Language: Python
License: MIT
Stars: 3610
Forks: 722
Open issues: 298
Created: 2023-01-17T20:57:10Z
Pushed: 2026-06-09T23:55:23Z
Default branch: main
Fork: no
Archived: no
README:
Claude 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](https://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](./CONTRIBUTING.md).
License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.