https://github.com/anthropics/anthropic-sdk-python
https://github.com/anthropics/anthropic-sdk-python
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/anthropics/anthropic-sdk-python
- Owner: anthropics
- License: mit
- Created: 2023-01-17T20:57:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-04-03T18:56:32.000Z (27 days ago)
- Last Synced: 2026-04-03T19:33:06.001Z (27 days ago)
- Language: Python
- Size: 4.98 MB
- Stars: 3,120
- Watchers: 183
- Forks: 583
- Open Issues: 192
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-github-projects - anthropic-sdk-python - No description provided ⭐3,340 `Python` 🔥 (🔧 Utilities & Miscellaneous)
- awesome-generative-ai-data-scientist - Anthropic Claude - sdk-python) | (LLM Providers)
- awesome-claude-ai - Python SDK - Official Python client (API & SDKs / Official SDKs)
- awesome-agents - Anthropic Python - Official Python client for Claude with support for tool use, streaming, and batching. (SDKs and Libraries)
- awesome-ai-agents-2026 - Anthropic SDK
- awesome-claude - anthropic-sdk-python
- awesome-claude-code - anthropics/anthropic-sdk-python - sdk-python?style=flat-square&logo=github) | Typed Python client for the Claude REST API with sync and async support | (Official)
- awesome-llm-tools - anthropic
- awesome-agent-cortex - Claude Agent SDK - Official Python SDK for building agents with Claude models. (Agent Frameworks)
README
# Claude SDK for Python
[](https://pypi.org/project/anthropic/)
The Claude SDK for Python provides access to the [Claude API](https://docs.anthropic.com/en/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
```sh
pip install anthropic
```
## Getting started
```python
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.