• 消息
  • 托管智能体
  • 管理
Search...
⌘K
CLI、SDK 和库
概览
ant CLI
快速入门身份验证选项使用 CLI脚本与自动化
客户端 SDK
中间件PythonTypeScriptC#GoJavaPHPRuby
库与集成
Apple Foundation ModelsOpenAI SDK 兼容性
Log in
概览
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Solutions

  • AI agents
  • Code modernization
  • Coding
  • Customer support
  • Education
  • Financial services
  • Government
  • Life sciences

Partners

  • Amazon Bedrock
  • Google Cloud's Vertex AI

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Company

  • Anthropic
  • Careers
  • Economic Futures
  • Research
  • News
  • Responsible Scaling Policy
  • Security and compliance
  • Transparency

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Help and security

  • Availability
  • Status
  • Support
  • Discord

Terms and policies

  • Privacy policy
  • Responsible disclosure policy
  • Terms of service: Commercial
  • Terms of service: Consumer
  • Usage policy
CLI、SDK 和库

CLI、SDK 和库

用于基于 Claude API 进行构建的官方工具:ant CLI、七种语言的客户端 SDK,以及特定框架的库。

Anthropic 提供三类官方工具,用于基于 Claude API 进行构建:

  • CLI:ant 命令行工具,用于 shell 脚本编写和交互式使用。
  • **客户端 SDK:**适用于 Python、TypeScript、C#、Go、Java、PHP 和 Ruby 的通用 Messages API 客户端。每个 SDK 都提供符合语言习惯的接口、类型安全,以及对 "streaming"(流式传输)、重试和错误处理的内置支持。
  • **库和集成:**在其他框架的 API 接口中暴露 Claude 的软件包和兼容层,而非直接使用 Messages API。

如需完整的 API 规范,请参阅 API 参考。

CLI

ant CLI

Shell 脚本编写、类型化标志、响应转换

客户端 SDK

Python

同步和异步客户端、Pydantic 模型

TypeScript

支持 Node.js、Deno、Bun 和浏览器

C#

.NET Standard 2.0+、IChatClient 集成

Go

基于 context 的取消机制、函数式选项

Java

构建器模式、CompletableFuture 异步

PHP

值对象、构建器模式

Ruby

Sorbet 类型、流式传输辅助工具

库和集成

库和集成通过其他框架的 API 接口来暴露 Claude,它们并非通用的 Messages API 客户端。

Apple Foundation Models

适用于 Apple LanguageModelSession API 的 Swift 软件包

OpenAI SDK 兼容性

通过 OpenAI SDK 接口使用 Claude

Was this page helpful?

  • CLI
  • 客户端 SDK
  • 库和集成