SDK Installation & Setup — Official SDKs
[ ABORT TO HUD ]
SEQ. 1
SDK Installation & Setup
Official SDK Ecosystem
Anthropic provides first-party API SDKs for four languages—Python (anthropic v2.0+), TypeScript / JavaScript (@anthropic-ai/sdk v1.0+), Go (anthropic-sdk-go v2.0+), and Java (anthropic-java)—alongside the official Claude Agent SDK (@anthropic-ai/claude-agent-sdk and Python claude-agent-sdk).
Python Example
import anthropic
client = anthropic.Anthropic() # Reads ANTHROPIC_API_KEY from environment
message = client.messages.create(
model="claude-sonnet-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain quantum computing in three sentences."}]
)
print(message.content[0].text)
TypeScript Example & Claude Agent SDK
import Anthropic from "@anthropic-ai/sdk";
import { query } from "@anthropic-ai/claude-agent-sdk";
const client = new Anthropic();
const message = await client.messages.create({
model: "claude-sonnet-5-5",
max_tokens: 1024,
messages: [{ role: "user", content: "Explain quantum computing in three sentences." }]
});
console.log(message.content[0].text);
// Embed the full Claude Code agent loop via Claude Agent SDK:
for await (const turn of query({ prompt: "Run unit tests", options: { allowedTools: ["Read", "Bash"] } })) {
console.log(turn);
}⌨ HANDS-ON LABInstall the Official SDKs
⭐ +100 XPProvision both official Anthropic SDKs - Python for data pipelines, TypeScript for your web stack.
1Install the official Python SDK with pip.
2Install the official TypeScript/Node SDK with npm.
OBJECTIVE 1 / 2 — type "hint" if stuck
SYNAPSE VERIFICATION
QUERY 1 // 2
Which environment variable do all official Anthropic SDKs read by default?
CLAUDE_KEY
ANTHROPIC_API_KEY
AI_SECRET
ANTHROPIC_TOKEN