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.104.0.tar.gz (849.3 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.104.0-py3-none-any.whl (832.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anthropic-0.104.0.tar.gz
  • Upload date:
  • Size: 849.3 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.104.0.tar.gz
Algorithm Hash digest
SHA256 1ae8ef4709e90cc2068c8e8a63c1ecb63cc5360d325a4bef8b296aad76148be3
MD5 8954d5bc6b6970beee779528d06a4daf
BLAKE2b-256 0f018bfa68b886aa436775325a108700f7da39e290870199ce9251934de3e4aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anthropic-0.104.0-py3-none-any.whl
  • Upload date:
  • Size: 832.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.104.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18f73ba3429aab237cdd146a486d20b4da3c008fb4a3ba83f237b27793e884c7
MD5 4deaea2fe1b33902d4d9e82a16f0e2ef
BLAKE2b-256 726c595f1893352dbb4d88f1c2f0983296638783936b2063564aca9abb189990

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