AI / Claude Models Basics Interview Questions
What are the Anthropic SDKs and what languages are officially supported?
Anthropic provides official SDKs that wrap the Claude API, handling authentication, request formatting, response parsing, automatic retries, and streaming. Using an SDK is strongly recommended over direct HTTP calls.
| Language | Package | Install command |
|---|---|---|
| Python | anthropic | pip install anthropic |
| TypeScript / JavaScript | @anthropic-ai/sdk | npm install @anthropic-ai/sdk |
| Java (preview) | com.anthropic:anthropic-java | Maven/Gradle dependency |
| Go (preview) | github.com/anthropics/anthropic-sdk-go | go get github.com/anthropics/anthropic-sdk-go |
| Kotlin (preview) | com.anthropic:anthropic-java | Same package as Java SDK |
# Python SDK — basic setup
from anthropic import Anthropic
client = Anthropic() # reads ANTHROPIC_API_KEY from environment
message = client.messages.create(
model="claude-opus-4-8",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello, Claude!"}]
)
print(message.content[0].text)
# TypeScript SDK
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic(); // reads ANTHROPIC_API_KEY from env
const message = await client.messages.create({
model: "claude-opus-4-8",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello, Claude!" }],
});
console.log(message.content[0].text);SDK benefits: automatic retries (up to 2 by default), exponential backoff on rate limit errors, streaming helpers, typed response objects, and environment variable management for API keys. The Python and TypeScript SDKs are fully mature; Java, Go, and Kotlin are in preview as of mid-2026.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
