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.116.0 ↗ · + Follow · compare 2 versions
5,980 symbols 32,364 edges 1,154 files 1,412 documented · 24% updated 4d agov0.116.0 · 2026-07-02★ 3,729135 open issues

Browse by type

Functions 4,447 Types & classes 1,509 Endpoints 24
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

Shape

Method 3,497
Class 1,509
Function 950
Route 24

Languages

Python100%

Modules by API surface

tests/lib/test_credentials.py243 symbols
tests/test_middleware.py194 symbols
tests/test_client.py148 symbols
src/anthropic/_base_client.py135 symbols
src/anthropic/resources/beta/beta.py88 symbols
tests/api_resources/beta/environments/test_work.py82 symbols
tests/api_resources/beta/test_deployments.py78 symbols
src/anthropic/lib/middleware/_fallbacks.py78 symbols
tests/test_models.py77 symbols
tests/lib/tools/test_session_runner.py77 symbols
tests/api_resources/beta/vaults/test_credentials.py72 symbols
tests/lib/tools/memory_tools/test_filesystem.py69 symbols

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