Working 2026 code examples for the Anthropic API — Python, Node.js, TypeScript, Go.
Which Anthropic SDK should I use in Python?
Install `pip install anthropic`. The package name is `anthropic`. Initialize with `client = anthropic.Anthropic()` — it reads `ANTHROPIC_API_KEY` from your environment automatically.
Which Anthropic SDK should I use in Node.js?
Install `npm install @anthropic-ai/sdk`. The package is `@anthropic-ai/sdk`. TypeScript types are included — no separate `@types` package needed.
What is the best Claude model for most applications in 2026?
Claude Sonnet 4.6 is the recommended default — best price/quality balance at $3/M input and $15/M output tokens. Use Haiku 4.5 for high-volume cheap tasks. Reserve Opus 4.7 for complex reasoning where quality is paramount.
Do these code examples cost money to run?
Yes — each API call charges per token. A simple test call costs under $0.001. Get free credits on signup at console.anthropic.com to try the examples at no cost.
All three deliver the same PDF instantly after Stripe checkout. Refund within 7 days, no questions asked — just reply to your Stripe receipt.
Independent developers writing about the Anthropic SDK, LLM tooling, and the indie web: