Anthropic provides official client SDKs in multiple languages to make it easier to work with the Claude API. Each SDK provides idiomatic interfaces, type safety, and built-in support for features like streaming, retries, and error handling.
For the full API specification, see the API reference.
Shell scripting, typed flags, response transforms
Sync and async clients, Pydantic models
Node.js, Deno, Bun, and browser support
Builder pattern, CompletableFuture async
Context-based cancellation, functional options
Sorbet types, streaming helpers
.NET Standard 2.0+, IChatClient integration
Value objects, builder pattern
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-opus-4-7",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello, Claude"}],
)
print(message.content)SDKs support the following platforms:
| Platform | Description |
|---|---|
| Claude API | Connect directly to Claude API endpoints |
| Claude Platform on AWS | Use Anthropic-operated Claude on AWS infrastructure |
| Microsoft Foundry | Use Anthropic-operated Claude on Microsoft Azure |
| Amazon Bedrock | Use partner-operated Claude through the Bedrock API |
| Vertex AI | Use partner-operated Claude through Google Cloud |
Platform support varies by language. See individual SDK pages for platform-specific setup instructions and availability.
Access beta features using the beta namespace in any SDK:
message = client.beta.messages.create(
model="claude-opus-4-7",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
betas=["feature-name"],
)See Beta headers for available beta features.
| SDK | Minimum version |
|---|---|
| Python | 3.9+ |
| TypeScript | 4.9+ (Node.js 20+) |
| Java | 8+ |
| Go | 1.23+ |
| Ruby | 3.2.0+ |
| C# | .NET Standard 2.0 |
| PHP | 8.1.0+ |
Was this page helpful?