# anthropic

> The official Python library for the anthropic API

- **URL**: https://www.freshcrate.ai/projects/anthropic
- **Author**: pypi
- **Category**: Developer Tools
- **Latest version**: `v0.106.0` (2026-06-05)
- **License**: MIT
- **Source**: https://github.com/anthropics/anthropic-sdk-python
- **Homepage**: https://pypi.org/project/anthropic/
- **Language**: Python
- **GitHub**: 3,285 stars, 626 forks
- **Registry**: pypi (`anthropic`)
- **Tags**: `pypi`

## Description

# Claude SDK for Python

[![PyPI version](https://img.shields.io/pypi/v/anthropic.svg)](https://pypi.org/project/anthropic/)

The Claude SDK for Python provides access to the [Claude API](https://docs.anthropic.com/en/api/) from Python applications.

## Documentation

Full documentation is available at **[platform.claude.com/docs/en/api/sdks/python](https://platform.claude.com/docs/en/api/sdks/python)**.

## Installation

```sh
pip install anthropic
```

## Getting started

```python
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](https://github.com/anthropics/anthropic-sdk-python/tree/main/./CONTRIBUTING.md).

## License

This project is licensed under the MIT License. See the [LICENSE](https://github.com/anthropics/anthropic-sdk-python/tree/main/LICENSE) file for details.

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `v0.106.0` | 2026-06-05 | High | ## 0.106.0 (2026-06-05)  Full Changelog: [v0.105.2...v0.106.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.105.2...v0.106.0)  ### Features  * **api:** mark Claude Opus 4.1 as deprecated ([85068cc](https://github.com/anthropics/anthropic-sdk-python/commit/85068cc4cb42feecb80a378942cec71e1baa8dcf))   ### Bug Fixes  * **client:** make Foundry client copy() and with_options() work ([94146ac](https://github.com/anthropics/anthropic-sdk-python/commit/94146acdc1c6f66f187d5a42e4afbb911 |
| `v0.105.2` | 2026-05-29 | High | ## 0.105.2 (2026-05-29)  Full Changelog: [v0.105.1...v0.105.2](https://github.com/anthropics/anthropic-sdk-python/compare/v0.105.1...v0.105.2) |
| `v0.104.1` | 2026-05-22 | High | ## 0.104.1 (2026-05-21)  Full Changelog: [v0.104.0...v0.104.1](https://github.com/anthropics/anthropic-sdk-python/compare/v0.104.0...v0.104.1)  ### Bug Fixes  * **streaming:** carry encrypted_content through beta compaction accumulator ([#1821](https://github.com/anthropics/anthropic-sdk-python/issues/1821)) ([f7a720c](https://github.com/anthropics/anthropic-sdk-python/commit/f7a720c514cc5e428b310f46249ca1c807894c2e)) |
| `v0.103.1` | 2026-05-19 | High | ## 0.103.1 (2026-05-19)  Full Changelog: [v0.103.0...v0.103.1](https://github.com/anthropics/anthropic-sdk-python/compare/v0.103.0...v0.103.1)  ### Bug Fixes  * **runner:** skip tool calls SessionToolRunner does not own ([#1817](https://github.com/anthropics/anthropic-sdk-python/issues/1817)) ([9425c6a](https://github.com/anthropics/anthropic-sdk-python/commit/9425c6a0c6ff5e1d459ac081914f3df496365884)) |
| `v0.102.0` | 2026-05-13 | High | ## 0.102.0 (2026-05-13)  Full Changelog: [v0.101.0...v0.102.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.101.0...v0.102.0)  ### Features  * **api:** Add BetaManagedAgentsSearchResultBlock types ([3681f10](https://github.com/anthropics/anthropic-sdk-python/commit/3681f1042608b6be4e5a56e8b52e6a619b9210f4)) * **api:** Add support for cache diagnostics beta ([db51c6c](https://github.com/anthropics/anthropic-sdk-python/commit/db51c6caabb1bede4c2d671a96e6ef88e90ffaba)) * **internal |
| `v0.101.0` | 2026-05-11 | High | ## 0.101.0 (2026-05-11)  Full Changelog: [v0.100.0...v0.101.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.100.0...v0.101.0)  ### Features  * **aws:** Add AWS client for Claude Platform on AWS ([1e70e3a](https://github.com/anthropics/anthropic-sdk-python/commit/1e70e3a21d57a96721685c1eca9cedd10cdd5b63))   ### Bug Fixes  * **client:** add missing f-string prefix in file type error message ([06d109a](https://github.com/anthropics/anthropic-sdk-python/commit/06d109aaf36629ec15c8fb |
| `v0.100.0` | 2026-05-06 | High | ## 0.100.0 (2026-05-06)  Full Changelog: [v0.99.0...v0.100.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.99.0...v0.100.0)  ### Features  * **api:** add support for Managed Agents multiagents and outcomes, webhooks, vault validation ([3b3deee](https://github.com/anthropics/anthropic-sdk-python/commit/3b3deee9c479ce5b54411a8572b66c5a90f1d50f))   ### Bug Fixes  * **api:** Adjust webhook configuration ([8c3339e](https://github.com/anthropics/anthropic-sdk-python/commit/8c3339e5324 |
| `v0.98.1` | 2026-05-04 | High | ## 0.98.1 (2026-05-04)  Full Changelog: [v0.98.0...v0.98.1](https://github.com/anthropics/anthropic-sdk-python/compare/v0.98.0...v0.98.1)  ### Chores  * fix typo in example ([#1754](https://github.com/anthropics/anthropic-sdk-python/issues/1754)) ([de8ba13](https://github.com/anthropics/anthropic-sdk-python/commit/de8ba13769837f92ff00be8a1b1e9ad0749eae2f)) |
| `v0.97.0` | 2026-04-23 | High | ## 0.97.0 (2026-04-23)  Full Changelog: [v0.96.0...v0.97.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.96.0...v0.97.0)  ### Features  * **api:** CMA Memory public beta ([fc30ebe](https://github.com/anthropics/anthropic-sdk-python/commit/fc30ebe5ca81204faa0b1d756b61dad176e37dcb))   ### Bug Fixes  * **api:** fix errors in api spec ([f946de8](https://github.com/anthropics/anthropic-sdk-python/commit/f946de8da00748b472489e93ab4920d64d1cb22d)) * **api:** restore missing features ([ |
| `0.96.0` | 2026-04-21 | Low | Imported from PyPI (0.96.0) |

## Dependency audit

- **Score**: 83/100
- **Total deps**: 15
- **Resolved**: 11
- **Unresolved**: 4
- **License conflicts**: 0
- **Warnings**: 6
- **Scanned**: 2026-05-18

## Citation

- HTML: https://www.freshcrate.ai/projects/anthropic
- Markdown: https://www.freshcrate.ai/projects/anthropic.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/anthropic/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
