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.113.0.tar.gz (939.4 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.113.0-py3-none-any.whl (938.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anthropic-0.113.0.tar.gz
  • Upload date:
  • Size: 939.4 kB
  • 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-0.113.0.tar.gz
Algorithm Hash digest
SHA256 1830e866430ebd351c4f277d20e4c9b0aa9ad71f6569a23772ae88b33e0abaf8
MD5 1e1bcbc0daa9447d56fc1f421452355c
BLAKE2b-256 a02af856135e5b055bf8b6f34133b313810dfe1cb848e5ac5ea843e196daefdd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anthropic-0.113.0-py3-none-any.whl
  • Upload date:
  • Size: 938.0 kB
  • 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-0.113.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a52ed7a4982e916fa878d1ed3eaec2dcdf98699a39d8fc45b54b3c50f1e7426
MD5 3a37917683c2cf736b0b2c862c538f66
BLAKE2b-256 3e4dea001c0993b8f48153c5eb74eecf5a3ed120df07fe894757351e8308bbe6

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