Showing 28 verified skills. 284 preview entries are hidden until we confirm a real source. Show preview skills · Why?
Build production AI applications with streaming, tools, and agent patterns
claude install anthropics/skills/claude-apiReference patterns for Claude API integration including tool use, streaming responses, multi-turn conversations, and agentic architectures.
This is the actual SKILL.md file that powers this skill. Copy it to install.
---
name: claude-api
description: |
Trigger when code imports anthropic, @anthropic-ai/sdk, or claude_agent_sdk,
or when the user asks to use the Claude API, Anthropic SDKs, or Agent SDK.
Do NOT trigger for other AI SDKs (openai, etc.).
allowed-tools:
- Bash(command *)
- Read
- Write
- Edit
- Glob
- Grep
---
# Claude API
Build applications using the Claude API and Anthropic SDKs including tool use,
streaming, extended thinking, and agentic patterns.
## Prerequisites
- Anthropic API key set as `ANTHROPIC_API_KEY` env var
- SDK installed: `npm install @anthropic-ai/sdk` or `pip install anthropic`
## Key Patterns
### Basic message
```typescript
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic();
const message = await client.messages.create({
model: "claude-sonnet-4-20250514",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello" }],
});
```
### Streaming
```typescript
const stream = client.messages.stream({
model: "claude-sonnet-4-20250514",
max_tokens: 1024,
messages: [{ role: "user", content: prompt }],
});
for await (const event of stream) {
if (event.type === "content_block_delta" && event.delta.type === "text_delta") {
process.stdout.write(event.delta.text);
}
}
```
### Tool use
```typescript
const response = await client.messages.create({
model: "claude-sonnet-4-20250514",
max_tokens: 1024,
tools: [{
name: "get_weather",
description: "Get weather for a city",
input_schema: {
type: "object",
properties: { city: { type: "string" } },
required: ["city"],
},
}],
messages: [{ role: "user", content: "Weather in Tokyo?" }],
});
```
## Steps
1. Check which SDK version is installed
2. Use the correct model identifier (claude-sonnet-4-20250514, etc.)
3. Always handle rate limits with exponential backoff
4. For streaming apps, use `.stream()` not `.create()`
5. For tool use, validate tool inputs before executing
mkdir -p ~/.claude/skills/claude-api-skill~/.claude/skills/claude-api-skill/SKILL.mdResulting file structure:
~/.claude/
skills/
claude-api-skill/
SKILL.md <-- skill definitionSkills are loaded automatically by Claude Code when you start a new session. The skill name and description in the frontmatter determine when Claude triggers it.
Recommended from shared domain, career, and tool overlap with Claude API
Design and optimize prompts with evaluation frameworks and A/B testing
Both used by Software Engineer
Write structured technical RFCs with alternatives analysis
Both used by Software Engineer
Map domain events, aggregates, and bounded contexts for DDD
Both used by Software Engineer
Set up Git branching, hooks, and release processes in one go
Both used by Software Engineer
Build and test regex patterns with visual debugging
Both used by Software Engineer
Find leaked API keys and credentials before they cause a breach
Both used by Software Engineer
Claude API