Claude API · Setup and first request

Send your first message (TypeScript)

The same request with the TypeScript SDK.

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic();

const response = await client.messages.create({
  model: "claude-opus-5-5",
  max_tokens: 16000,
  messages: [{ role: "user", content: "What is the capital of France?" }],
});
for (const block of response.content) {
  if (block.type === "text") console.log(block.text);
}

Official Claude API documentation

More setup and first request commands

All setup and first request commands · Claude API cheatsheet

Was this page helpful?