The Anthropic Python SDK is installed from PyPI and brings httpx, pydantic, and other core HTTP and type-handling dependencies; optional extras add support for aiohttp transport, Google Cloud and AWS backends, model context protocol tooling, and webhook signing. The public API re-exports all symbols at the top-level anthropic package, including middleware for fallback behavior and decorators for tool definition, with versioning and MIT licensing documented at the official SDK guide.
The SDK is installable from PyPI as anthropic (version 0.121.0) via pip install anthropic.[1][2] Python 3.9 or later is required.[1] The SDK is licensed under the MIT License.[1] Full API documentation is available at platform.claude.com/docs/en/api/sdks/python.[1]
Core runtime dependencies are: httpx>=0.25.0,<1, pydantic>=1.9.0,<3, typing-extensions>=4.14,<5, anyio>=3.5.0,<5, distro>=1.7.0,<2, sniffio>=1,<2, jiter>=0.4.0,<1, and docstring-parser>=0.15,<1.[2]
The anthropic[aiohttp] extra adds aiohttp>=3,<4 and httpx_aiohttp>=0.1.9,<1 to enable the aiohttp transport.[2] The anthropic[vertex] and anthropic[google_cloud] extras both add google-auth[requests]>=2,<3 for Google Vertex AI and Google Cloud backends — see Cloud backends for usage details.[2] The anthropic[bedrock] and anthropic[aws] extras both add boto3>=1.28.57,<2 and botocore>=1.31.57,<2 for AWS Bedrock.[2] The anthropic[mcp] extra requires mcp>=1.0,<3 and is restricted to Python 3.10+ via its environment marker.[2] The anthropic[webhooks] extra adds standardwebhooks>=1.0.1,<2 for webhook signature validation.[2]
The top-level src/anthropic/__init__.py re-exports all public symbols and updates their __module__ attribute to "anthropic" so that error messages point to the top-level package rather than the defining sub-module.[3] BetaRefusalFallbackMiddleware and BetaFallbackState are part of the public API surface, exported from src/anthropic/__init__.py via lib.middleware.[3] The resources attribute is exposed as a runtime-only proxy — not visible to type checkers — via from ._utils._resources_proxy import resources as resources.[3]
Sources