Source: anthropics/skills · Maintainer: Anthropic · License: Apache 2.0 · Checked: 24 October 2026
What is the claude-api skill?
The claude-api skill is Anthropic's reference pack for building apps on the Claude API: it tells your coding agent which model ID, parameters and SDK calls are current, and makes it read documented SDK usage before it writes code. It is for developers adding Claude to an app, migrating to a newer model, or cutting API costs, in seven SDK languages or raw cURL.
Its SKILL.md description opens with "Reference for the Claude API / Anthropic SDK" and lists what it covers: model IDs, pricing, parameters, streaming, tool use, MCP, agents, caching, token counting and model migration. The rest of the description is a detailed trigger rule: load it when a prompt names Claude or Anthropic, when you ask about LLM pricing or limits, or when an LLM-shaped task doesn't name a provider, and skip it when another provider such as OpenAI or Gemini is in use.
The same skill ships inside Claude Code. The Claude Code skills docs say: "The bundled /claude-api skill loads Claude API and Managed Agents reference material for your project's language. Claude also activates it automatically when your code imports anthropic or @anthropic-ai/sdk." Its skills.sh page listed 74.2K installs (snapshot, 24 October 2026).
What does the claude-api skill do?
What rules does it give the agent?
- Check the provider first. The agent scans the target file for markers like
import openai,langchain_openaiorgpt-5. If it finds any, it stops and asks whether to switch to Claude. - Use the official SDK. Code must call Claude through the Anthropic SDK for the project's language. Raw HTTP is allowed only if you ask for it, the project is shell or cURL based, or the language has no official SDK. It never falls back to OpenAI-compatible shims.
- Never guess SDK usage. Function names, classes and import paths must come from the skill's language files or the official SDK repos listed in
shared/live-sources.md. - Sensible defaults. Unless you say otherwise, it uses Claude Opus 5.5 (
claude-opus-5-5), adaptive thinking for anything complex, and streaming for long inputs or outputs. - Watch for API drift. A table lists patterns that changed in 2025 and 2026, such as
budget_tokensgiving way tothinking: {type: "adaptive"}on newer models.
Claude Opus 5.5 is also the model Anthropic's models overview suggests starting with for most workloads.
How does it choose a language and an approach?
It detects the language from project files (pyproject.toml, package.json, go.mod, *.csproj and so on) and reads only that language's folder. A "Which Surface Should I Use?" table steers you to the simplest option: a single API call for classification or extraction, tool use for workflows you orchestrate, and Managed Agents when you want Anthropic to run the agent loop and host the sandbox.
What subcommands does it have?
You can type a subcommand after the skill name, such as /claude-api migrate. The GitHub copy defines:
| Subcommand | What it does |
|---|---|
migrate |
Moves existing Claude API code to a newer model, confirming scope first |
upgrade |
Moves the SDK across a major version, currently Python anthropic 0.x to 1.x |
prompt-audit |
Flags prompt and skill text written for older models |
cost-optimize |
Profiles spend and proposes savings one change at a time |
build-eval |
Interviews you to build an eval set for your app |
hillclimb |
Improves your app against an existing eval |
preserved-thinking-migration |
Finds edits that invalidate preserved thinking blocks |
managed-agents-onboard |
Walks you through creating a Managed Agent, from scratch, a quickstart template or a URL |
The Claude Code docs list two more for the bundled version, api-version and managed-agents-secure, which the GitHub copy did not include when checked.
What is in the folder?
SKILL.md: about 105 KB of routing, defaults, quick references and pitfalls.python/,typescript/,java/,go/,ruby/,php/: each has aclaude-api/folder (README, tool use, streaming and more) and amanaged-agents/folder.csharp/: aclaude-api/folder.curl/:examples.mdandmanaged-agents.md.shared/: language-neutral docs such asmodels.md,prompt-caching.md,tool-use-concepts.md,error-codes.md,model-migration.md,cost-optimization.mdand the Managed Agents guides.LICENSE.txt: Apache License 2.0.
How do you install the claude-api skill?
Claude Code. It is bundled, so start by checking whether /claude-api already works. The Claude Code docs list the minimum Claude Code version for each subcommand.
Claude Code plugin. The repo's marketplace file lists claude-api as its own plugin, separate from example-skills. Add the marketplace as the repo README shows, then install the plugin by name in the plugin@marketplace form from the Claude Code plugin docs:
/plugin marketplace add anthropics/skills
/plugin install claude-api@anthropic-agent-skills
Other agents, or an editable copy. The command on skills.sh:
npx skills add https://github.com/anthropics/skills --skill claude-api
Add -g for all projects. In Claude Code, a personal copy lives at ~/.claude/skills/claude-api/. Codex and Cursor read the same SKILL.md format; see Codex skills and Cursor skills.
How do you use it?
Mention Claude or Anthropic, or just open a file that imports the SDK. Name the language if the project has several.
Example prompts (suggestions, not from the repo):
Add a Claude-powered summary endpoint to this FastAPI app. Stream the response./claude-api migrate(then name the files and the target model when asked)Build a TypeScript agent loop with two tools: search_orders and refund_order./claude-api cost-optimizeon a project that already calls the APIWhich Claude model should I use for high-volume classification, and what does it cost?
What do you need?
The Anthropic SDK for your language and credentials. The skill reads ANTHROPIC_API_KEY or an ant CLI profile from ant auth login, and tells the agent to run ant auth status before asking you for a key. The skill itself costs nothing; API calls are billed by Anthropic.
Tips and limits
- A local copy can shadow the bundled one. The Claude Code docs say a personal or project skill with the same name as a bundled skill replaces the bundled command. A copy installed with
npx skills addinto~/.claude/skills/claude-api/can therefore fall behind the version Claude Code updates for you. A plugin install is namespaced as/claude-api:claude-api, so it does not take over the/claude-apiname. - Prices in the skill are cached. Its model table is marked as cached on 6 October 2026. For live numbers, check Anthropic's pricing page, or let the skill query the Models API for capabilities, which it suggests.
- It is opinionated about models. It defaults to Opus 5.5 and does not downgrade for cost on its own. Name a model explicitly if you want a different one.
- It fetches documentation. When a binding isn't in its files, the agent fetches the official SDK repos. In a locked-down network, the skill says to write from its patterns and iterate on compiler errors instead.
- Audit and license. On 24 October 2026, skills.sh showed Pass from Gen Agent Trust Hub, Socket and Snyk. The folder is Apache 2.0, so you can copy and adapt it with the license notice.
Save it in your Kipt library
Most people should keep using the bundled version in Claude Code. If you want a pinned copy for Codex, Cursor or a team repo, open Skills in Kipt and paste https://github.com/anthropics/skills/tree/main/skills/claude-api into the import box; Kipt brings in the SKILL.md and its language folders. Kipt stores skills in your own private GitHub repo and installs them into Claude Code or Codex with one command:
npx skills add https://github.com/<you>/<repo>.git --all -g
Kipt is not affiliated with Anthropic.
Similar skills
- MCP builder skill: Anthropic's guide to building MCP servers your Claude app can call.
- Skill creator: write and test your own skills, including ones that wrap your API code.
- Claude Code pricing: what Claude Code itself costs, separate from API billing.
- Best Claude Code skills: the wider directory of skills worth installing.