MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python

github.com/anthropics/anthropic-sdk-python

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.120.1 ↗ · + Follow · compare 9 versions
6,531 symbols 35,515 edges 1,220 files ⚖ MIT 1,571 documented · 24% updated 2d agov0.120.2 · 2026-07-28★ 3,794111 open issues

Browse by type

Functions 4,911 Types & classes 1,594 Endpoints 26
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Claude SDK for Python

PyPI version

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.

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 3,838
Class 1,594
Function 1,073
Route 26

Languages

Python100%

Modules by API surface

tests/lib/test_credentials.py278 symbols
tests/test_middleware.py194 symbols
tests/test_client.py148 symbols
src/anthropic/_base_client.py135 symbols
src/anthropic/resources/beta/beta.py100 symbols
tests/lib/tools/test_session_runner.py99 symbols
tests/lib/test_google_cloud.py93 symbols
tests/api_resources/beta/environments/test_work.py82 symbols
src/anthropic/lib/middleware/_fallbacks.py81 symbols
tests/api_resources/beta/test_deployments.py78 symbols
tests/test_models.py77 symbols
tests/api_resources/beta/vaults/test_credentials.py72 symbols

Dependencies from manifests, versioned

annotated-types0.7.0 · 1×
anyio4.12.1 · 1×
asttokens3.0.1 · 1×
backports-asyncio-runner1.2.0 · 1×
boto3-stubs1.42.69 · 1×
botocore-stubs1.42.41 · 1×
certifi2026.2.25 · 1×
colorama0.4.6 · 1×
dirty-equals0.11 · 1×
distro1.9.0 · 1×
docstring-parser0.17.0 · 1×
exceptiongroup1.3.1 · 1×

For agents

$ claude mcp add anthropic-sdk-python \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page