Official TypeScript SDK for Claude API with streaming, tool use, and message batching support.
The Claude SDK for TypeScript provides access to the Claude API from server-side TypeScript or JavaScript applications.
Full documentation is available at platform.claude.com/docs/en/api/sdks/typescript.
npm install @anthropic-ai/sdk
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: process.env['ANTHROPIC_API_KEY'], // This is the default and can be omitted
});
const message = await client.messages.create({
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
model: 'claude-opus-4-6',
});
console.log(message.content);
Node.js 18+
See CONTRIBUTING.md.
This project is licensed under the MIT License. See the LICENSE file for details.
Preview
Markdown
[](https://attestry.ai/models/npm-anthropic-ai-sdk)HTML
<a href="https://attestry.ai/models/npm-anthropic-ai-sdk"><img src="https://regseal.ai/api/v1/registry/badge/npm-anthropic-ai-sdk" alt="RegSeal Verification Status" /></a>