Anthropic SDK
The Claude SDK for Python is a library that provides access to the Claude API from Python applications. It simplifies building AI-powered features by handling API requests and responses. It is intended for Python developers integrating Claude's language models into their projects.
✨ Key features
- Access Claude API from Python
- Simple client initialization with API key
- Create messages with model and parameters
- Supports Python 3.10+
- Full documentation available online
🎯 Use cases
- Build chatbots or virtual assistants
- Integrate AI text generation into applications
- Automate content creation or summarization
- Develop tools that require natural language understanding
📦 Installation
🧰 Requirements: Python 3.10+ and an Anthropic API key (set as ANTHROPIC_API_KEY environment variable).
pip install anthropic
🚀 Usage
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",
)
print(message.content)
❓ FAQ
What Python version is required?
Python 3.10 or higher is required.
How do I install the SDK?
You can install it via pip with the command pip install anthropic.
How do I authenticate?
Set the ANTHROPIC_API_KEY environment variable or pass the api_key parameter to the Anthropic client.
Where can I find full documentation?
Full documentation is available at platform.claude.com/docs/en/api/sdks/python.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.