anthropic-sdk-guide
Guide for Anthropic Python/TypeScript SDK usage including messages API, streaming, prompt caching, batches, token counting, and error handling. Use when the user is building with the Anthropic API, setting up Claude SDK, calling messages endpoints, implementing streaming, or troubleshooting API errors.
npx skills add majiayu000/claude-skill-registry --skill anthropic-sdk-guide --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Anthropic SDK Guide Comprehensive reference for building with the Anthropic Python and TypeScript SDKs. Covers initialization, messages API, streaming, prompt caching, batches, and error handling. ## When to Use - User is setting up Anthropic SDK (Python or TypeScript) - User is calling the Messages API or needs streaming responses - User wants prompt caching, batch processing, or token counting - User is debugging API errors or rate limits - User asks about Claude model IDs or API configuration ## Core Patterns ### SDK Installation and Setup ```bash # Python pip install anthropic # TypeScript npm install @anthropic-ai/sdk ``` ```python # Python - client initialization import anthropic client = anthropic.Anthropic() # Uses ANTHROPIC_API_KEY env var # Or explicit: anthropic.Anthropic(api_key="sk-ant-...") ``` ```typescript // TypeScript - client initialization import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic(); // Uses ANTHROPIC_API_KEY env var ``` ### Messages API - Basic Usage ```python # Python - simple message message = client.messages.create( model="claude-sonnet-4-6-20250514", max_tokens=1024, system="You are a helpful coding assistant.", messages=[ {"
- When to Use
- Core Patterns
- SDK Installation and Setup
- Messages API - Basic Usage
- Streaming Responses
- Prompt Caching
- Batch Processing
- Token Counting
- Error Handling
- Anti-Patterns
- Quick Reference
Python pip install anthropic TypeScript npm install @anthropic-ai/sdk
What does the anthropic-sdk-guide skill do?
Guide for Anthropic Python/TypeScript SDK usage including messages API, streaming, prompt caching, batches, token counting, and error handling. Use when the user is building with the Anthropic API, setting up Claude SDK, calling messages endpoints, implementing streaming, or troubleshooting API errors.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill anthropic-sdk-guide --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
