Anthropic SDK

Autonomous Agents 💻 Python ⚖️ MIT 🟢 Actively maintained
3.9k stars

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

Stars★ 3,883
Forks🍴 839
Open issues🐛 158
Last commit🕒 Sep 4, 2026
Created📅 Jan 2023
Language💻 Python
License⚖️ MIT

🤖 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.