MerchantryTidbits

llm-inference / library

Claude SDK for TypeScript

Capability: Claude SDK for TypeScript

Use it when

  • You are building a Node.js or edge service that needs to send messages to Claude models and you do not want to hand-write fetch calls, request typing, and response parsing against the raw HTTP API
  • Your TypeScript codebase calls the Claude API through untyped ad hoc wrappers and you want an official client with typed request and response objects that works on Node, Deno, Bun, Cloudflare Workers, and Vercel Edge

What it solves

Not the fit when

  • Routing requests across multiple LLM providers behind one interface
  • Local model inference without an Anthropic API key
  • React Native applications, which the README states are not supported
  • Browser-first apps, since browser use is disabled by default to protect API keys
  • multi-model-routing
  • rate-limit-provider
  • cost-per-call-too-high

Install

npm install @anthropic-ai/sdk

Invoke

import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic({apiKey: process.env.ANTHROPIC_API_KEY}); const message = await client.messages.create({model: 'claude-opus-4-6', max_tokens: 1024, messages: [{role: 'user', content: 'Hello, Claude'}]})

Alternatives

No reviewed alternatives recorded yet.