Skip to main content

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

Upgrading from a 0.x release? See the v1 migration guide.

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-5",
)

print(message.content)

Requirements

Python 3.10+

Contributing

See CONTRIBUTING.md.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anthropic-1.0.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anthropic-1.0.0-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file anthropic-1.0.0.tar.gz.

File metadata

  • Download URL: anthropic-1.0.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for anthropic-1.0.0.tar.gz
Algorithm Hash digest
SHA256 42be3c97604af7252c5898413aee076ace6c46e9bca0d0d90ceb77c7d3719027
MD5 8c62edcfdc5dfe779c3680ecb5a4e1bd
BLAKE2b-256 25aa4978e58035bd6c638c7b483450a68b7ef2d732ab78885e27bb9db0cff1a2

See more details on using hashes here.

File details

Details for the file anthropic-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: anthropic-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for anthropic-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32dd52e9e1d774393b27182f451398ba4262287a4d0eab30887f89f1481b3ae4
MD5 4d68d02d0edc1690e88a9548ff4fb017
BLAKE2b-256 ad5bdb4a854aebf5d33a5ab714c46af6eb85ee44f390ed29b7b325c00b9f11ed

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page