ALL INTELLIGENCE
Claude Python SDK 发布T2·Tools

Anthropic Releases Python SDK v2.12.0

By anthropic-sdks-releaser[bot]Original title: v2.12.0
38AI Score

Anthropic has released Python SDK v2.12.0, the official client for calling the Claude API from Python applications, requiring Python 3.10 or later. This is a routine minor version bump with unchanged documentation and installation flow, and the sample code now references claude-opus-5-5 as the default model.

Full Report

Contents4 sections

Anthropic SDK for Python

The Anthropic 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

BASH
pip install anthropic

Upgrading from a 0.x release? See the v1 migration guide.

Getting started

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

Requirements

Python 3.10+