anthropic
2.3.0
2.2.0
2.1.0
2.0.0
1.9.0
1.8.0
1.7.0
1.6.0
1.5.0
1.4.0
1.3.0
1.2.0
1.17.0
1.16.0
1.15.0
1.14.0
1.13.0
1.12.1
1.12.0
1.11.0
1.10.0
1.1.0
1.0.0
0.99.0
0.98.1
0.98.0
0.97.0
0.96.0
0.95.0
0.94.1
0.94.0
0.93.0
0.92.0
0.91.0
0.90.0
0.9.0
0.89.0
0.88.0
0.87.0
0.86.0
0.85.0
0.84.0
0.83.0
0.82.0
0.81.0
0.80.0
0.8.1
0.8.0
0.79.0
0.78.0
0.77.1
0.77.0
0.76.0
0.75.0
0.74.1
0.74.0
0.73.0
0.72.1
0.72.0
0.71.1
0.71.0
0.70.0
0.7.8
0.7.7
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.69.0
0.68.2
0.68.1
0.68.0
0.67.0
0.66.0
0.65.0
0.64.0
0.63.0
0.62.0
0.61.0
0.60.0
0.6.0
0.59.0
0.58.2
0.58.1
0.58.0
0.57.1
0.57.0
0.56.0
0.55.0
0.54.0
0.53.0
0.52.2
0.52.1
0.52.0
0.51.0
0.50.0
0.5.0
0.49.0
0.48.0
0.47.2
0.47.1
0.47.0
0.46.0
0.45.2
0.45.1
0.45.0
0.44.0
0.43.1
0.43.0
0.42.0
0.41.0
0.40.0
0.4.1
0.39.0
0.38.0
0.37.1
0.37.0
0.36.2
0.36.1
0.36.0
0.35.0
0.34.2
0.34.1
0.34.0
0.33.1
0.33.0
0.32.0
0.31.2
0.31.1
0.31.0
0.30.1
0.30.0
0.3.9
0.3.8
0.3.7
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.11
0.3.10
0.3.1
0.3.0
0.29.2
0.29.0
0.28.1
0.28.0
0.27.0
0.26.1
0.26.0
0.25.9
0.25.8
0.25.7
0.25.6
0.25.5
0.25.4
0.25.3
0.25.2
0.25.1
0.25.0
0.24.0
0.23.1
0.23.0
0.22.1
0.22.0
0.21.3
0.21.2
0.21.1
0.21.0
0.20.0
0.2.9
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.10
0.19.2
0.19.1
0.19.0
0.18.1
0.18.0
0.17.0
0.16.0
0.15.1
0.15.0
0.14.1
0.14.0
0.13.0
0.125.0
0.124.0
0.123.0
0.122.0
0.121.0
0.120.2
0.120.1
0.120.0
0.12.0
0.119.0
0.118.0
0.117.1
0.117.0
0.116.0
0.115.1
0.115.0
0.114.0
0.113.0
0.112.0
0.111.0
0.110.0
0.11.0
0.109.2
0.109.1
0.109.0
0.108.0
0.107.1
0.107.0
0.106.0
0.105.2
0.105.0
0.104.1
0.104.0
0.103.1
0.103.0
0.102.0
0.101.0
0.100.0
0.10.0
2.3.0
2.2.0
2.1.0
2.0.0
1.9.0
1.8.0
1.7.0
1.6.0
1.5.0
1.4.0
1.3.0
1.2.0
1.17.0
1.16.0
1.15.0
1.14.0
1.13.0
1.12.1
1.12.0
1.11.0
1.10.0
1.1.0
1.0.0
0.99.0
0.98.1
0.98.0
0.97.0
0.96.0
0.95.0
0.94.1
0.94.0
0.93.0
0.92.0
0.91.0
0.90.0
0.9.0
0.89.0
0.88.0
0.87.0
0.86.0
0.85.0
0.84.0
0.83.0
0.82.0
0.81.0
0.80.0
0.8.1
0.8.0
0.79.0
0.78.0
0.77.1
0.77.0
0.76.0
0.75.0
0.74.1
0.74.0
0.73.0
0.72.1
0.72.0
0.71.1
0.71.0
0.70.0
0.7.8
0.7.7
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.69.0
0.68.2
0.68.1
0.68.0
0.67.0
0.66.0
0.65.0
0.64.0
0.63.0
0.62.0
0.61.0
0.60.0
0.6.0
0.59.0
0.58.2
0.58.1
0.58.0
0.57.1
0.57.0
0.56.0
0.55.0
0.54.0
0.53.0
0.52.2
0.52.1
0.52.0
0.51.0
0.50.0
0.5.0
0.49.0
0.48.0
0.47.2
0.47.1
0.47.0
0.46.0
0.45.2
0.45.1
0.45.0
0.44.0
0.43.1
0.43.0
0.42.0
0.41.0
0.40.0
0.4.1
0.39.0
0.38.0
0.37.1
0.37.0
0.36.2
0.36.1
0.36.0
0.35.0
0.34.2
0.34.1
0.34.0
0.33.1
0.33.0
0.32.0
0.31.2
0.31.1
0.31.0
0.30.1
0.30.0
0.3.9
0.3.8
0.3.7
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.11
0.3.10
0.3.1
0.3.0
0.29.2
0.29.0
0.28.1
0.27.0
0.26.1
0.26.0
0.25.9
0.25.8
0.25.7
0.25.6
0.25.5
0.25.4
0.25.3
0.25.2
0.25.1
0.25.0
0.24.0
0.23.1
0.23.0
0.22.1
0.22.0
0.21.3
0.21.2
0.21.1
0.21.0
0.20.0
0.2.9
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.10
0.19.2
0.19.1
0.19.0
0.18.1
0.18.0
0.17.0
0.16.0
0.15.1
0.15.0
0.14.1
0.14.0
0.13.0
0.125.0
0.124.0
0.123.0
0.122.0
0.121.0
0.120.2
0.120.1
0.120.0
0.12.0
0.119.0
0.118.0
0.117.1
0.117.0
0.116.0
0.115.1
0.115.0
0.114.0
0.113.0
0.112.0
0.111.0
0.110.0
0.11.0
0.109.2
0.109.1
0.109.0
0.108.0
0.107.1
0.107.0
0.106.0
0.105.2
0.105.0
0.104.1
0.104.0
0.103.1
0.103.0
0.102.0
0.101.0
0.100.0
0.10.0
توضیحات
The official Python library for the anthropic API
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX :: Linux |
| نام فایل | anthropic-2.3.0 |
| نام | anthropic |
| نسخه کتابخانه | 2.3.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Anthropic <support@anthropic.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/anthropic/ |
| مجوز | Apache-2.0 |
# Claude SDK for Python
[](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
Tool helpers (`@beta_tool`, the tool runner and `ToolError`) are documented in [tools.md](https://github.com/anthropics/anthropic-sdk-python/tree/main/tools.md). The browser and computer toolset classes have their own guides, [browser-toolset.md](https://github.com/anthropics/anthropic-sdk-python/tree/main/browser-toolset.md) and [computer-toolset.md](https://github.com/anthropics/anthropic-sdk-python/tree/main/computer-toolset.md).
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
```
Upgrading from a `0.x` release? See the [v1 migration guide](https://github.com/anthropics/anthropic-sdk-python/tree/main/MIGRATION.md).
## 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-5-5",
)
print(message.content)
```
## OpenTelemetry
The SDK reports each API call as an OpenTelemetry span when your application has registered a tracer provider.
It depends on `opentelemetry-api`, a required dependency, and never on an OpenTelemetry SDK.
```python
# a provider other than the registered one
client = Anthropic(open_telemetry={"tracer_provider": tracer_provider})
# no spans
quiet = Anthropic(open_telemetry=False)
# adds prompts and completions
verbose = Anthropic(open_telemetry={"traces": {"content_mode": "content"}})
# keeps the content of one span within this size
bounded = Anthropic(
open_telemetry={"traces": {"content_mode": "content", "max_content_bytes": 65_536}}
)
# sends no trace context headers, for an application whose HTTP client instrumentation already sends them, so that
# a request does not carry them twice
unpropagated = Anthropic(open_telemetry={"propagation": False})
# sets gen_ai.conversation.id on the spans of one conversation's requests. with_options replaces the whole option,
# so start from client.open_telemetry, which has the client's
conversation = client.with_options(
open_telemetry={**client.open_telemetry, "conversation_id": conversation_id}
)
conversation.messages.create(...)
```
A client that is given no `open_telemetry` option reads these environment variables when it is constructed: `ANTHROPIC_OPEN_TELEMETRY=false` turns its spans off, `ANTHROPIC_OPEN_TELEMETRY_TRACES_CONTENT_MODE=content` adds prompts and completions, `ANTHROPIC_OPEN_TELEMETRY_TRACES_MAX_CONTENT_BYTES` sets `max_content_bytes`, and `ANTHROPIC_OPEN_TELEMETRY_PROPAGATION=false` sends no trace context headers.
A client that is given the option, even `{}` or a `tracer_provider` alone, reads none of them: what the option leaves out has its default (spans on, trace context headers sent, no prompts or completions, 750,000 bytes).
A copy made with `with_options` or `copy` keeps its client's option unless it is given its own.
## Requirements
Python 3.10+
## Contributing
See [CONTRIBUTING.md](https://github.com/anthropics/anthropic-sdk-python/tree/main/./CONTRIBUTING.md).
## License
This project is licensed under the Apache License, Version 2.0. See the [LICENSE](https://github.com/anthropics/anthropic-sdk-python/tree/main/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](https://github.com/anthropics/anthropic-sdk-python/tree/main/LICENSE-MIT).
نیازمندی
| مقدار | نام |
|---|---|
| - | anyio<5,>=4.1.0 |
| - | docstring-parser<1,>=0.15 |
| - | httpx2<3,>=2.0.0 |
| - | jiter<1,>=0.4.0 |
| - | opentelemetry-api<2,>=1.1.0 |
| - | pydantic<3,>=1.10.0 |
| - | sniffio<2,>=1 |
| - | typing-extensions<5,>=4.14 |
| xtr | aiohttp<4,>=3.10.0; |
| xtr | boto3<2,>=1.28.57; |
| xtr | botocore<2,>=1.31.57; |
| xtr | boto3<2,>=1.28.57; |
| xtr | botocore<2,>=1.31.57; |
| xtr | google-auth[requests]<3,>=2; |
| ython_versio | mcp<3,>=1.0; |
| xtr | google-auth[requests]<3,>=2; |
| xtr | standardwebhooks<2,>=1.0.1; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10 | Python |
نحوه نصب
نصب پکیج whl anthropic-2.3.0:
pip install anthropic.whl
نصب پکیج tar.gz anthropic-2.3.0:
pip install anthropic.tar.gz