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

Uploaded Python 3

File details

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

File metadata

  • Download URL: anthropic-0.114.0.tar.gz
  • Upload date:
  • Size: 939.9 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.114.0.tar.gz
Algorithm Hash digest
SHA256 d710a3baf48793f4f4b6d8ebc7e1b6850d004b5d96faab5a85c86ced6629f086
MD5 a9fe915246f0f9e37c7702ad1df4ae7b
BLAKE2b-256 b04872a5abea3d3f51c588229f7e2ae4dbe2394e078e7ffea6b8e983382f1297

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anthropic-0.114.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.114.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d696a51553f03b9f45d97e44a2c75ae1fa2a4b765ef62c72f8fef2a0be1e2845
MD5 9f4b1514bf57c10b164dc74e30462671
BLAKE2b-256 860d52a590c965acde311005ae356eb533944b09024e9f05b5e7e67bd9b77d4c

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