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

github.com/anthropics/anthropic-sdk-python

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.10.0 ↗ · + Follow · compare 29 versions
16,257 symbols 90,987 edges 3,243 files ⚖ custom 4,094 documented · 25% ● updated 57d agov1.8.0 · 2026-09-22★ 3,91451 open issues

Browse by type

⨍ Functions 12,274◇ Types & classes 3,937↳ Endpoints 46
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Anthropic SDK for Python

PyPI version

The Anthropic 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

Upgrading from a 0.x release? See the v1 migration guide.

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-5-5",
)
print(message.content)

Requirements

Python 3.10+

Contributing

See CONTRIBUTING.md.

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details. Versions released before the change from the MIT License, and third-party contributions merged before it, remain under the MIT License. See LICENSE-MIT.

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 9,576
Class 3,937
Function 2,698
Route 46

Languages

Python100%

Modules by API surface

tests/test_open_telemetry.py449 symbols
tests/lib/test_credentials.py394 symbols
tests/test_middleware.py190 symbols
tests/test_client.py188 symbols
src/anthropic/_base_client.py145 symbols
tests/lib/threads/test_beta_threads.py137 symbols
tests/lib/tools/test_session_runner.py135 symbols
tests/lib/tools/test_runners.py135 symbols
tests/lib/test_google_cloud.py134 symbols
src/anthropic/resources/beta/organization/organization.py124 symbols
tests/lib/tools/toolsets/test_pipeline.py122 symbols
tests/lib/tools/test_open_telemetry.py122 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.10.18 · 1×
colorama0.4.6 · 1×
dirty-equals0.11 · 1×
docstring-parser0.17.0 · 1×
exceptiongroup1.3.1 · 1×
execnet2.1.2 · 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