One package, ESM and CJS
@anthropic-ai/sdk is the official TypeScript SDK. It ships dual builds (ESM and CommonJS), strict types out of the box, and works on Node, Bun, Deno, and Edge runtimes (with caveats). One package; pick by import style.
Strict types are your friend
Every request and response shape is exported. Use Anthropic.MessageParam for message arrays, Anthropic.Message for full responses, Anthropic.TextBlock / Anthropic.ToolUseBlock for content blocks. Strict types catch tool-loop bugs at compile time that would silently break in Python.
One client, async by default
Unlike Python's two-client split, the TypeScript SDK has one async client. Call it from Node, from a Next.js Route Handler, from a worker, anywhere. The constructor reads ANTHROPIC_API_KEY from env automatically; pass it explicitly only when you need per-call key rotation.