← 开源
AI EngineeringAccess modelsPython
增长势头
+124 小时新增 Star+0.0%
4.15k
Star
935
Fork
+27
本周
76
贡献者
创建于 2023-01-17 · 更新于 2026-12-04 · 今日第 4476 名
主要开发者
README

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

pip install anthropic

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

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

Requirements

Python 3.10+

Contributing

See CONTRIBUTING.md.

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details. Versions released before the change from the MIT License, and third-party contributions merged before it, remain under the MIT License. See LICENSE-MIT.

排名相邻
同类项目

AI Rank iPhone 版

随时追踪 AI 模型榜单

在 App Store 下载