domains / software-engineering / claude-api-integration / claude-api
The anthropics/skills copy is the upstream source and contains the core procedure, but the sickn33 copy adds a detailed 'Language Detection' section and a 'Which Surface Should I Use?' decision table that are absent from the first. The copies also disagree on the default model version (Opus 5.5 vs Opus 5) and the trigger logic (broad LLM-shaped tasks vs specific SDK imports). Combining is necessary to preserve the language detection steps and surface selection logic while acknowledging the model version conflict.
| Repository | Path |
|---|---|
| anthropics/skills | skills/claude-api/SKILL.md |
| sickn33/agentic-awesome-skills | plugins/agentic-awesome-skills-claude/skills/claude-api/SKILL.md |
| Role | Repository | Path |
|---|---|---|
| peer | anthropics/skills | skills/claude-api/SKILL.md |
| peer | sickn33/agentic-awesome-skills | plugins/agentic-awesome-skills-claude/skills/claude-api/SKILL.md |
| adapter | sickn33/agentic-awesome-skills | plugins/agentic-awesome-skills/skills/claude-api/SKILL.md |
| adapter | sickn33/agentic-awesome-skills | skills/claude-api/SKILL.md |
---
name: claude-api
description: Reference for the Claude API / Anthropic SDK. Use for model ids, pricing, params, streaming, tool use, MCP, agents, caching, and token counting.
---
# Building LLM-Powered Applications with Claude
## When to Use
- Use when building with the Claude API, Anthropic SDKs, or the Agent SDK.
- Use when code imports `anthropic`, `@anthropic-ai/sdk`, or related Claude SDK packages.
- Use for LLM-shaped tasks (agents, RAG, tool-use) if the provider is unstated or Claude.
- Do not use for general coding work unrelated to Claude integrations or when other providers (OpenAI, Gemini, etc.) are explicitly named.
## Before You Start
Scan the target file for non-Anthropic provider markers (e.g., `import openai`, `gpt-4`). If found, stop and ask the user if they want to switch to Claude or keep the current provider. Do not edit non-Anthropic files with Anthropic SDK calls.
## Language Detection
1. **Infer from project files:**
- `*.py`, `requirements.txt` → Python
- `*.ts`, `*.tsx`, `package.json` → TypeScript
- `*.java`, `pom.xml` → Java
- `*.go`, `go.mod` → Go
- `*.rb`, `Gemfile` → Ruby
- `*.cs`, `*.csproj` → C#
- `*.php`, `composer.json` → PHP
2. **If ambiguous:** Ask the user which language to use for the integration.
3. **If unsupported:** Suggest cURL/raw HTTP examples.
## Which Surface Should I Use?
- **Single LLM call:** Use Claude API for classification, summarization, or extraction.
- **Workflow:** Use Claude API + tool use for multi-step pipelines with code-controlled logic.
- **Agent:** Use Agent SDK for built-in file/web/terminal access, permissions, and MCP support.
## Defaults
- **Model:** Use the latest stable Claude model (e.g., `claude-opus-5-5` or `claude-opus-5` depending on availability).
- **Thinking:** Default to adaptive thinking (`thinking: {type: "adaptive"}`) for complex tasks.
- **Streaming:** Default to streaming for long inputs/outputs to prevent timeouts. Use `.get_final_message()` if you don't need individual events.
## Output Requirement
- Use the official Anthropic SDK for the project's language.
- Use raw HTTP only if the user explicitly requests it or no SDK exists.
- Never guess SDK usage; verify against documentation or `shared/live-sources.md`.
## Warning: API Drift
Verify API shapes against current documentation, as several patterns changed in 2025-2026 (e.g., extended thinking parameters).