Anthropic Python SDK

Prerequisites

Installation

terminal
bash
pip install anthropic

Basic Usage

example.py
python
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.chuizi.ai/anthropic",
    api_key="ck-your-key-here",
)

message = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello!"}
    ],
)

print(message.content[0].text)

Next Steps