What it does
Loads Anthropic’s authoritative reference for the Claude API into Claude’s context before it writes SDK code. It detects the project language (Python, TypeScript, Java, Go, Ruby, C#, PHP, or cURL) and pulls the matching examples for messages, tool use, streaming, batches, files, prompt caching, MCP, and Managed Agents. It also injects the current model IDs, pricing, and 2025–2026 API drift points (adaptive thinking, removed budget_tokens, new web search / web fetch tool types) so Claude does not fall back to stale training-data patterns. Most useful when you are asking Claude to write or migrate first-party Anthropic SDK code and want it to stop guessing.
Use cases
- Write correct SDK code from scratch — ask Claude to add a
messages.createcall, a tool-use loop, or a streaming chat handler in your project’s language and get the current API shape (adaptive thinking,output_config.effort, correct model IDs) instead of a 2024-era pattern. - Migrate an existing integration to a newer model — run
/claude-api migrateand Claude walks the per-target breaking-change checklist (removedbudget_tokens, new tool type versions,refusalstop reason handling for Fable 5) across the files you name. - Debug prompt caching, refusals, or tool-call failures — point Claude at a broken request and the skill supplies the diagnostic rules (cache prefix invalidators,
stop_detailsguards,strict: trueplacement, parallel tool-result batching) it needs to identify the actual cause.
When to use it
- You are editing a file that already imports
anthropic/@anthropic-ai/sdk/com.anthropic.*or otherwise targets the Anthropic SDK. - The prompt names Claude, Anthropic, or a specific model like Opus 4.8, Sonnet 4.6, Haiku 4.5, or Fable 5.
- You are choosing a model, checking a context window, estimating pricing, or asking about a feature limit and want a current answer instead of a recalled one.
- You are building an agent, MCP client, or tool-use loop and need the correct current parameter names and beta headers.
When NOT to use it
- The target file uses OpenAI, Gemini, Mistral, Cohere, Ollama, or another non-Anthropic provider — the skill will refuse to edit it with Anthropic SDK calls.
- You want provider-neutral code or a LangChain-style abstraction that hides the underlying SDK; this skill produces direct Anthropic SDK calls.
- You need help with a community-maintained SDK (Rust, Swift, Elixir, C++) — only official SDKs and cURL are covered; unsupported languages get cURL examples as a reference.
- You are asking Claude conceptual questions about LLMs in general rather than about calling the Claude API specifically.
Installation
Install in Claude Code
/plugin install claude-api@anthropic-agent-skills If you haven’t added the Anthropic marketplace yet, run this first:
Add Marketplace
/plugin marketplace add anthropics/skills After install, just mention it in conversation:
Prompt
Use the claude-api skill to add a Claude Opus 4.8 call with adaptive thinking and streaming to my Python service. Troubleshooting
Claude keeps writing thinking: {type: "enabled", budget_tokens: N} and the API returns 400. That request shape is rejected on Fable 5, Opus 4.8, and Opus 4.7 — budget_tokens is fully removed on those models. Re-invoke with the skill loaded and ask Claude to use thinking: {type: "adaptive"} plus output_config: {effort: "high"} instead. On Opus 4.6 and Sonnet 4.6, budget_tokens still functions as a transitional escape hatch but is deprecated for new code.
The generated code uses a model ID like claude-sonnet-4-6-20251114 and the API rejects it. Do not append date suffixes. The current IDs are complete as written in the skill’s model table (claude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5, claude-fable-5). Ask Claude to re-read the Current Models section and regenerate with the exact string. For older models not in the table, have it consult shared/models.md rather than construct an ID.
Web search or web fetch tool returns a tool_input_error about unknown type. The 2025 type strings (web_search_20250305, web_fetch_20250910) were superseded on Opus 4.6+ and Sonnet 4.6 by web_search_20260209 and web_fetch_20260209 (which include dynamic filtering and internal code execution — do not also declare code_execution in tools). Older models keep the basic variants; on Vertex AI only basic web_search_20250305 is available and web fetch is not offered.
Managed Agents code recreates the agent on every request and burns latency. Agents are persistent objects. Call agents.create once, store the returned agent ID (in config, a database, or a version-controlled YAML via the ant CLI), and pass that ID to every sessions.create. model, system, and tools belong on the agent, never on the session — putting them on the session is a common source of silent misconfiguration.