| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>Claude SDK Docs</title> |
| <meta charset="utf-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.2.0/github-markdown.min.css"> |
| <style> |
| .markdown-body { |
| box-sizing: border-box; |
| min-width: 200px; |
| max-width: 980px; |
| margin: 0 auto; |
| padding: 45px; |
| } |
| @media (max-width: 767px) { |
| .markdown-body { |
| padding: 15px; |
| } |
| } |
| </style> |
| </head> |
| <body class="markdown-body"> |
| <div id="content"></div> |
| <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> |
| <script> |
| const markdownContent = ` |
| # Client SDKs |
| |
| Official SDKs for building with the Claude API in Python, TypeScript, Java, Go, Ruby, C#, PHP, and the command line. |
| |
| --- |
| |
| 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. |
| |
| <Info> |
| For the full API specification, see the [API reference](/docs/en/api/overview). |
| </Info> |
| |
| <CardGroup cols={3}> |
| <Card title="CLI" href="/docs/en/api/sdks/cli"> |
| Shell scripting, typed flags, response transforms |
| </Card> |
| <Card title="Python" href="/docs/en/api/sdks/python"> |
| Sync and async clients, Pydantic models |
| </Card> |
| <Card title="TypeScript" href="/docs/en/api/sdks/typescript"> |
| Node.js, Deno, Bun, and browser support |
| </Card> |
| <Card title="Java" href="/docs/en/api/sdks/java"> |
| Builder pattern, CompletableFuture async |
| </Card> |
| <Card title="Go" href="/docs/en/api/sdks/go"> |
| Context-based cancellation, functional options |
| </Card> |
| <Card title="Ruby" href="/docs/en/api/sdks/ruby"> |
| Sorbet types, streaming helpers |
| </Card> |
| <Card title="C#" href="/docs/en/api/sdks/csharp"> |
| .NET Standard 2.0+, IChatClient integration |
| </Card> |
| <Card title="PHP" href="/docs/en/api/sdks/php"> |
| Value objects, builder pattern |
| </Card> |
| </CardGroup> |
| |
| ## Quick installation |
| |
| ### CLI |
| \`\`\`bash |
| brew install anthropics/tap/ant |
| \`\`\` |
| |
| ### Python |
| \`\`\`bash |
| pip install anthropic |
| \`\`\` |
| |
| ### TypeScript |
| \`\`\`bash |
| npm install @anthropic-ai/sdk |
| \`\`\` |
| |
| ### C# |
| \`\`\`bash |
| dotnet add package Anthropic |
| \`\`\` |
| |
| ### Go |
| \`\`\`bash |
| go get github.com/anthropics/anthropic-sdk-go |
| \`\`\` |
| |
| ### Java |
| #### Gradle |
| \`\`\`groovy |
| implementation("com.anthropic:anthropic-java:2.30.0") |
| \`\`\` |
| |
| #### Maven |
| \`\`\`xml |
| <dependency> |
| <groupId>com.anthropic</groupId> |
| <artifactId>anthropic-java</artifactId> |
| <version>2.30.0</version> |
| </dependency> |
| \`\`\` |
| |
| ### PHP |
| \`\`\`bash |
| composer require anthropic-ai/sdk |
| \`\`\` |
| |
| ### Ruby |
| \`\`\`bash |
| bundler add anthropic |
| \`\`\` |
| |
| ## Quick start |
| |
| ### Python |
| \`\`\`python |
| 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) |
| \`\`\` |
| |
| ### TypeScript |
| \`\`\`typescript |
| import Anthropic from "@anthropic-ai/sdk"; |
| |
| const client = new Anthropic(); |
| |
| const message = await client.messages.create({ |
| model: "claude-opus-4-7", |
| max_tokens: 1024, |
| messages: [{ role: \"user\", content: \"Hello, Claude\" }] |
| }); |
| console.log(message.content); |
| \`\`\` |
| |
| ## Platform support |
| |
| All SDKs support multiple deployment options: |
| |
| | Platform | Description | |
| |----------|-------------| |
| | Claude API | Connect directly to Claude API endpoints | |
| | Amazon Bedrock | Use Claude through AWS | |
| | Google Vertex AI | Use Claude through Google Cloud | |
| | Microsoft Foundry | Use Claude through Microsoft Azure | |
| |
| ## Requirements |
| |
| | 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+ | |
| `; |
| document.getElementById('content').innerHTML = marked.parse(markdownContent); |
| </script> |
| </body> |
| </html> |
|
|