anthropics/anthropic-sdk-python v0.96.0

GitHub Releases Watchlist 工具

摘要

Anthropic 发布 Claude Python SDK 的 0.96.0 版本,为 Python 应用程序提供更新的 Claude API 访问。

0.96.0 (2026-04-16) 完整更新日志: v0.95.0...v0.96.0 功能 api: 添加 claude-opus-4-7、token budgets 和 user_profiles (0aa2a0d) 杂项 ci: 移除 release-doctor 工作流 (1d9add3)
查看原文 导出为 Word 导出为 PDF
查看缓存全文

缓存时间: 2026/04/20 08:36

anthropics/anthropic-sdk-python

来源:https://github.com/anthropics/anthropic-sdk-python

Claude Python SDK

PyPI 版本 (https://pypi.org/project/anthropic/)

Claude SDK for Python 提供从 Python 应用程序访问 Claude API (https://docs.anthropic.com/en/api/) 的功能。

文档

完整文档可在 platform.claude.com/docs/en/api/sdks/python (https://platform.claude.com/docs/en/api/sdks/python) 获取。

安装

pip install anthropic

快速开始

import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ.get("ANTHROPIC_API_KEY"),  # 这是默认值,可以省略
)

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

系统要求

Python 3.9+

贡献

参见 CONTRIBUTING.md

许可证

本项目采用 MIT 许可证。详见 LICENSE 文件。

相似文章

anthropics/anthropic-sdk-python v0.100.0

GitHub Releases Watchlist

本文宣布 Anthropic 官方 Python SDK 发布 v0.100.0 版本,通过 pip 安装为开发者提供更新后的工具,以便将 Claude 模型集成到其应用程序中。

anthropics/anthropic-sdk-typescript sdk: v0.89.0

GitHub Releases Watchlist

Anthropic 发布了适用于 TypeScript 的 Claude SDK v0.89.0,为开发者提供了对 Claude API 的更新访问,用于服务端 TypeScript 和 JavaScript 应用程序。

Anthropic 表示 OpenClaw 风格的 Claude CLI 使用方式再次获准

Hacker News Top

# Anthropic - OpenClaw 来源:[https://docs.openclaw.ai/providers/anthropic](https://docs.openclaw.ai/providers/anthropic) ## Anthropic (Claude) Anthropic 开发了 **Claude** 模型系列,并通过 API 和 Claude CLI 提供访问。在 OpenClaw 中,Anthropic API 密钥和 Claude CLI 重用都被支持。如果已配置,现有遗留的 Anthropic token 配置文件在运行时仍会被识别。 ## 选项 A:Anthropic API 密钥 **最佳适用场景:** 标准 API 访问和按用量计