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.109.2.tar.gz (927.6 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.109.2-py3-none-any.whl (923.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anthropic-0.109.2.tar.gz
  • Upload date:
  • Size: 927.6 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.109.2.tar.gz
Algorithm Hash digest
SHA256 d37db299597c7bc124b49b767ff135f1e6456b64af2b2fad4b63b2a1df333cf0
MD5 a70a153ccc45655ee643ada4ab72cdb4
BLAKE2b-256 1bb79a8e2f79011e89dd6eeb599c27332aed765dac9d6fbee3a55e68e4e3ec25

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anthropic-0.109.2-py3-none-any.whl
  • Upload date:
  • Size: 923.8 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.109.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e0fb4ca5df0ed983248c9c6c3242adc81d9cfddb8725902da53698554117abac
MD5 81f6e3a21a21ecee541414027be84295
BLAKE2b-256 d1f2bee5de8a2699fc8a3cce34d61c7a2626a2c310ddde7ea5611327eb0ddbe9

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