Skip to main content

Anthropic Python SDK

This python repo provides access to Anthropic's safety-first language model APIs.

For more information on our APIs, please check out Anthropic's documentation.

How to use

Install the package with:

pip install anthropic

Then write code with:

import anthropic
client = anthropic.Client(api_key=<insert token here>)
client.XXX # look to examples/ directory for code demonstrations

How to develop and run the examples in this repo

pip install .
export ANTHROPIC_API_KEY=<insert token here>
python examples/basic_sync.py
python examples/basic_stream.py
python examples/count_tokens.py

Metadata

Release files for anthropic 0.2.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anthropic 0.2.10
File Size Uploaded Provenance Actions
anthropic-0.2.10.tar.gz 5.7 kB Without provenance Details for anthropic-0.2.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anthropic 0.2.10
File Interpreter ABI Platform Actions
anthropic-0.2.10-py3-none-any.whl Python 3 none any Details for anthropic-0.2.10-py3-none-any.whl

Total release size: 12.0 kB

Release files / anthropic-0.2.10.tar.gz

Download URL anthropic-0.2.10.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e4da061a86d8ffb86072c0b0feaf219a3a4f7dfddd4224df9ba769e469498c19
BLAKE2b-256 checksum
How to use checksums
a9dd119d457661149817aa1ac6f9e262ba6763c0ecbda82b7e67756e8be0fc4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / anthropic-0.2.10-py3-none-any.whl

Download URL anthropic-0.2.10-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a007496207fd186b0bcb9592b00ca130069d2a427f3d6f602a61dbbd1ac6316e
BLAKE2b-256 checksum
How to use checksums
0b3a6e609e7162833ed87762656f902f2fe1009ad93f794a1c5b270bea0fb039
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Security for anthropic 0.2.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.10 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page