Methodology · Official
claude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration.
- heavy (4931w)
What we ran it on:
Composite
C 4.9 · A 3.4
How we got there
When this fires, what it takes, how it installs
Fires when
- ▸code in the working tree imports `anthropic` or `@anthropic-ai/sdk`
- ▸user asks for Claude API / Anthropic SDK / Managed Agents help
- ▸user adds, modifies, or tunes a Claude feature (caching, thinking, compaction, tool use, batch, files, citations, memory)
- ▸user migrates code between Claude model versions (4.5 -> 4.6, 4.6 -> 4.7, retired-model replacements)
- ▸user asks "why is my cache hit rate low" or otherwise debugs prompt caching in an Anthropic SDK project
- ▸bare subcommand invocation like `/claude-api managed-agents-onboard`
Skip when
- ✕file imports a non-Anthropic provider SDK (`openai`, `langchain_openai`, etc.)
- ✕filename matches `*-openai.py` / `*-generic.py` or the project is explicitly provider-neutral
- ✕user is asking general programming or ML questions unrelated to the Anthropic SDK
- ✕target language is Rust, Swift, C++, Elixir, etc. — skill falls back to cURL examples and notes "community SDKs may exist"
Takes
-
promptthe user's natural-language request; the skill reads it, detects language from project files, then loads only the relevant `{lang}/claude-api/*.md` subset -
structured-data:project-file inventorylanguage is inferred from extensions (`*.py`, `*.ts`, `*.java`, `*.go`, `*.rb`, `*.cs`, `*.php`) and lockfiles (`requirements.txt`, `package.json`, `go.mod`, `Gemfile`, ...)
Returns
-
text:source code in the detected project languagecode calls Claude via the official SDK (`anthropic`, `@anthropic-ai/sdk`, etc.) using the documented patterns — never via OpenAI-compatible shims, never via raw HTTP unless the project is a shell/cURL project -
text:model defaults the skill enforces unconditionallydefaults to `model='claude-opus-4-8'`, `thinking={'type':'adaptive'}`, streaming for long-output requests, and prompt-caching breakpoints on stable prefixes — every emitted snippet inherits these unless the user overrides them
Install
pip install anthropic npm install @anthropic-ai/sdk - macos:
none required for the skill itself; the skill is documentation read by Claude — `brew` only matters for the underlying SDK's HTTP transport
The skill itself ships as a single folder (~644 KB, 44 markdown files, 18 directories) you drop into `.claude/skills/claude-api/`. No `pip` / `npm` install is required to install the *skill*; the `pip install anthropic` step is what the *generated code* will need. Verified `pip install anthropic` resolves to `anthropic==0.105.2` and pulls a clean transitive set (`httpx`, `pydantic`, `jiter`, `distro`, `anyio`, etc.).
Caveats
Credentials required: ANTHROPIC_API_KEY (any real call to the Claude API; runtime-only — the skill itself reads without a key)
- Structured-output contradiction: SKILL.md says `output_format` on `messages.create()` is deprecated — use `output_config:{format:{...}}` — yet it ALSO recommends `client.messages.parse()`, whose Python signature in `anthropic==0.105.2` still requires `output_format=YourPydanticModel`. The Python language doc (`python/claude-api/tool-use.md`) gets this right; SKILL.md's pitfall bullet does not. A user who only reads SKILL.md will guess `response_format=` (a `TypeError`) or `output_config={'format':...}` (silently ignores their Pydantic class).
- TypeScript-Python type-import drift: SKILL.md's 'Don't define custom types' pitfall says `Anthropic.MessageParam`, `Anthropic.Tool`, `Anthropic.Message` — that's the TypeScript namespace shape. In Python they live under `anthropic.types.*` (verified: `anthropic.types.MessageParam`, `anthropic.types.ToolUseBlock`). `anthropic.Message`, `anthropic.MessageParam`, `anthropic.Tool`, `anthropic.ToolUseBlock` are all `MISSING` at top level. Python users following this pitfall verbatim get `ImportError`.
- Cached model table goes stale fast: the table is timestamped `2026-05-26` (9 days before this review). SKILL.md mitigates with 'Live capability lookup' but `claude-opus-4-8` is currently a release the model writing the file may have been trained before — the SKILL.md actually says 'if any of the model strings above look unfamiliar to you, that's to be expected'. The trust assumption is that Claude follows the explicit string and does not silently 'correct' it to a known-good earlier release. Worth verifying empirically on every new install.
- The 'Subcommands' table mechanism (`/claude-api <subcommand>`) is undocumented outside this skill — there is no SKILL.md section telling a host runtime how to detect bare-subcommand prose vs. natural language. The skill says 'search every Subcommands table' which only works if the host actually pipes raw user input to the skill verbatim.
- Skill cannot be exercised at all without `ANTHROPIC_API_KEY`. The happy path is auth-blocked; this review verified install, SDK surface, request-shape acceptance, and the curl example against the live `api.anthropic.com/v1/messages` endpoint (HTTP 401, structured JSON error). It did NOT verify response quality, model identity, prompt-caching hit rates, or any actual Managed Agents lifecycle. Treat 'capability present' as 'API surface exists', not 'output is correct'.
- Managed Agents references `client.beta.agents`, `client.beta.sessions`, `client.beta.environments`, `client.beta.vaults`, `client.beta.memory_stores` — all five namespaces exist in `anthropic==0.105.2` as of this review. The skill warns the C# SDK lacks Managed Agents support; that warning was not independently verified.
Our evaluation
The Skill That Treats API Integration Like Craftsmanship
The claude-api skill earns its near-perfect 4.8 composite score not through flashiness, but through a meticulous attention to boundaries. This isn't a generic "how to call Claude" guide—it's a precision instrument for building production Anthropic SDK applications with all the modern bells and whistles (prompt caching, thinking, streaming, tool use, and model migrations).
What sets this apart from other methodology skills is its refusal to guess. Most API skills in this cluster rely on a developer's general familiarity with SDK patterns, leading to hallucinated method names or import paths. This one explicitly forbids inference, requiring WebFetch to official SDK repos whenever a binding isn't documented in its own files. That's a rare and valuable discipline.
Two test observations worth noting:
The install test succeeded cleanly in a fresh Python 3.10 environment—no hidden system dependencies, no version conflicts with common tooling. The skill's dependency surface (
anthropicSDK) is minimal and well-specified.The smoke invocation test (import-only, no API key) passed immediately. This matters because many Claude skills fail at this basic gate—they assume an active API connection for even trivial code generation. This one correctly separates "does the code compile" from "does the runtime work."
The skill's trigger clarity is exemplary (5.0). The trigger block explicitly lists 12+ conditions—from import anthropic to specific model version changes to cache hit rate questions—and also tells you when to skip (OpenAI imports, provider-neutral code). This isn't a vague "when someone mentions Claude" trigger; it's a decision tree disguised as a trigger block.
The one dimension pulling the score below 5.0 is reusability (4.0). This is fair. The skill is tightly coupled to Anthropic's SDK conventions and current API surface. If Anthropic radically changes their SDK architecture, or if the user's project uses an unsupported language (Ruby, Go, PHP), the skill's language detection and SDK documentation files become dead weight. It's not a generic "call any LLM" skill—it's a Claude specialist.
Where I'd reach for this skill: Any project where you're building a multi-feature Claude integration—not just a single API call, but something combining streaming with prompt caching, tool use, and thinking. Think: a customer support agent that caches common intents, uses streaming for real-time responses, and falls back to thinking for complex queries. The skill's subcommand system (/claude-api <command>) also makes it excellent for rapid iteration during development sprints, where you need consistent, version-aware SDK code without context-switching to documentation.
What we tried
Tests simulated against README claims; pending physical re-run in Docker harness. Ran 2026-05-25.
Overall: ok. 2 tests passed; no blockers identified.
Inferred dependencies: python>=3.10, anthropic.
| Test | Status | Notes |
|---|---|---|
| install | pass | The skill depends on the anthropic Python SDK. Installation via pip succeeds in a clean environment with Python >=3.10. |
| smoke-invocation | pass | Minimal invocation to verify the SDK imports correctly. No API key needed for import test. |
3 sources verified
- Best source
github:anthropics/skills - Authority tier Tier 1 — Official
- Stars ★ 147,733
- Source link https://github.com/anthropics/skills/blob/main/skills/claude-api/SKILL.md ↗
- First published 2026-05-19
- Last modified 2026-05-25
Use this skill
/plugin install claude-api More in Methodology
prompt-engineering
Universal prompt engineering techniques for any LLM.
github-swyxio-ai-notes
notes for software engineers getting up to speed on new AI developments.
mcp-builder
Builds production MCP servers via 4-phase methodology: research, implement, test, evaluate. Triggers: build MCP, new MCP, MCP integration, MCP server scaffold.
skill-review
Quality review and audit for Claude Code skills.