Your first API call
Install @anthropic-ai/sdk, create a client, send a message, and parse the response. Real TypeScript code.
Make your first call in TypeScript. Log the response text, stop_reason, and usage. Try setting max_tokens: 10 and watch how stop_reason changes.
Copy and adapt to your context. Text in angle brackets should be replaced.
I'm wiring up the Claude API in a Node.js project. Stack: <TypeScript / JS> Integration goal: <…> Give me a minimal working example: create the client, send a message, safely read text from content[], handle errors. No extra abstractions.