Skip to main content

The official Python library for the anthropic API

Project description

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

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-4-6",
)
print(message.content)

Requirements

Python 3.9+

Contributing

See CONTRIBUTING.md.

License

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

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

anthropic-0.96.0.tar.gz (658.2 kB view details)

Uploaded Source

Built Distribution

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

anthropic-0.96.0-py3-none-any.whl (635.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anthropic-0.96.0.tar.gz
  • Upload date:
  • Size: 658.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • 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-0.96.0.tar.gz
Algorithm Hash digest
SHA256 9de947b737f39452f68aa520f1c2239d44119c9b73b0fb6d4e6ca80f00279ee6
MD5 679132b40bd90241ad3163d5a2c7ae89
BLAKE2b-256 b97e672f533dee813028d2c699bfd2a7f52c9118d7353680d9aa44b9e23f717f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anthropic-0.96.0-py3-none-any.whl
  • Upload date:
  • Size: 635.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • 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-0.96.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a6e335a354602a521cd9e777e92bfd46ba6e115bf9bbfe6135311e8fb2015b2
MD5 8170ee4a16d6a28883303cfeeecdb3fd
BLAKE2b-256 485a72f33204064b6e87601a71a6baf8d855769f8a0c1eaae8d06a1094872371

See more details on using hashes here.

Supported by

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