claude-api Skill for Claude Code: Build Apps with the Claude API
Anthropic's skill that makes Claude write correct Claude API and SDK code, with guides for migration, cost and evals.
- Installs
- 76.6K
- on skills.sh
- Stars
- 186.4K
- on GitHub
- Files
- 60+
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
claude-api makes Claude look up the current Claude API details before it writes code: model IDs, parameters, streaming, tool use, prompt caching, token counting and agents. It detects your project language and reads that language's guide instead of guessing SDK calls.
It triggers whenever a request names Claude or Anthropic, or asks about LLM pricing or limits. It also has eight subcommands you call with /claude-api, including migrate, cost-optimize and build-eval. It bundles four helper scripts and 96 files in total.
Good for
- Developers building apps on the Claude API in Python, TypeScript, Java, Go, Ruby, C# or PHP
- Teams migrating code to a newer Claude model or SDK version
- Engineers who want to cut API cost or build an eval for a Claude app
Install claude-api
Claude Code
- 1
Copy this prompt.
Install the claude-api skill in Claude Code. Run this command: npx skills add anthropics/skills --skill claude-api -a claude-code Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
The marketplace lists claude-api as its own one-skill plugin. The README documents the marketplace add and the example-skills and document-skills plugins, so the claude-api plugin name comes from the marketplace file.
From the vendor's docs. Source.
What's in the skill
When it loads
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file).
Sections in SKILL.md
- Before You Start
- Output Requirement
- Defaults
- Warning: API Drift - Your Training Prior May Be Stale
- Subcommands
- Language Detection
- Language-Specific Feature Support
- Which Surface Should I Use?
- Building an Agent: Four Approaches
- Should I Build an Agent?
- Architecture
- Current Models (cached: 2026-10-06)
- Claude Fable 5.1 (claude-fable-5-1) - most capable widely released model
- Claude Opus 5.5 (claude-opus-5-5) - the current Opus and the default model
- Claude Sonnet 5.5 (claude-sonnet-5-5) - the current Sonnet: speed and capability for everyday coding, agent, and enterprise work (Claude Opus 5.5 stays the default)
- Claude Haiku 5.5 (claude-haiku-5-5) - the current Haiku
Key facts
- Author
- Anthropic
- Installs on skills.sh
- 76,558 (Nov 2, 2026)
- GitHub stars (whole repo)
- 186,362 (Nov 2, 2026)
- Last commit to the repo
- Oct 28, 2026
- skills.sh audits
- Gen Agent Trust Hub pass, Socket pass, Snyk pass
What it includes
Moves existing Claude API code to a newer model
Asks which files or folders to change before any edit, classifies each file, applies the target model's breaking changes, then audits the prompts.
Write ·
/claude-api migrateFinds dated prompt text and contradictions
Scans prompts, tool descriptions, skills and CLAUDE.md files, then produces a report and a proposed diff.
Files ·
/claude-api prompt-auditUpgrades the Anthropic Python SDK from 0.x to 1.x
Follows a bundled guide step by step and reports. Other languages say no guide is bundled yet.
Runs code ·
/claude-api upgradeLowers what your Claude API code costs to run
Builds a token profile, then a ranked list of savings. It can use the Usage and Cost Admin API if you have an Admin API key.
Network ·
/claude-api cost-optimizeBuilds an eval set for your Claude-powered app
Interviews you, then produces a runnable script with a measured cost. It asks for your sign-off on inputs, grading and cost first.
Runs code ·
/claude-api build-evalImproves your app against an existing eval
Sets a budget and stopping condition, gets the plan approved, then loops: propose, apply, run, record.
Runs code ·
/claude-api hillclimbMakes an integration work with preserved thinking
Captures request bodies, compares consecutive requests with prefix_diff.py and tests the fix on a slice of traffic.
Runs code ·
/claude-api preserved-thinking-migrationSets up a Managed Agent from scratch
Walks through describe, configure, environment and session.
Network ·
/claude-api managed-agents-onboardReads the right guide for your project
Detects the language from your files, then reads that language's README, tool-use, streaming and other guides. Unsupported languages get cURL examples.
Read ·
Language detection and guidesAuth, thinking, caching, fast mode, task budgets, server tools
Short sections inside SKILL.md for common questions, plus a current models table.
Quick referencesFetches current docs when cached data may be stale
Uses WebFetch for "latest" questions or features the skill does not cover.
Network ·
Live docs lookup
From the official docs
Permissions
Medium risk
The skill makes Claude edit your code, run bundled scripts and sometimes call the Claude API on your account. Commit first and approve the cost before any eval or hillclimb run.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It edits your code during migrate and upgrade
It asks for the scope first. Commit before you start and review the diff.
Eval and hillclimb runs spend API credits
The skill asks you to sign off on cost, and to approve a budget, before it runs. Check the numbers.
It runs bundled scripts
Four scripts ship in shared/. drop_block_probe.py replays captured requests against the Claude API with your key or token, and only plans unless you pass --yes. prefix_diff.py compares captured requests and can scan a repo. runner-scaffold.mjs is a template for your eval runner, and build-report-lite.mjs writes a report.html. Read them before approving.
It reads your Claude login state
It runs ant auth status and may print a short-lived token for cURL tests. Do not paste that output into shared logs.
It can fetch live documentation
WebFetch is used for current docs. Pages it reads come from the web.
Technical details
| Talks to | Anthropic API (evals, hillclimb, Managed Agents). Live documentation pages |
|---|---|
| Sign-in and keys | It checks your existing login with ant auth status. If you have no login it suggests ant auth login, which stores a profile under ~/.config/anthropic/, or an exported ANTHROPIC_API_KEY. |
| Scopes |
|
Questions
How do I install claude-api?
Use the install box above. It lives in Anthropic's skills repo, whose README also documents adding the repo as a Claude Code plugin marketplace, and how to use skills in Claude.ai and the Claude API.
Does claude-api need an API key?
Only when a task calls the API. With no ANTHROPIC_API_KEY set, the SKILL.md says to run ant auth status first to see whether you already have a login, and to ask for a key only if none is active. It suggests ant auth login first and an exported ANTHROPIC_API_KEY as the alternative.
What can I run with /claude-api?
Eight subcommands: migrate, prompt-audit, upgrade, cost-optimize, build-eval, preserved-thinking-migration, hillclimb and managed-agents-onboard. Type /claude-api followed by the name, with no extra prose.
Will it help with OpenAI or Gemini code?
No. If it finds OpenAI, Gemini or similar markers in the target file, it stops and tells you the skill produces Claude and Anthropic SDK code, then asks what you want to do.
Does it work in the Claude app or Codex?
The anthropics/skills README says its example skills are already available to paid plans in Claude.ai, but it does not list which. Codex is not mentioned in that README.
Will it spend money on my API account?
Eval and hillclimb runs call the API, so they cost money. The skill says to get your sign-off on cost before building an eval and to set a budget before hillclimbing.
Is claude-api safe?
It is a large instruction set that bundles four scripts. Its subcommands can edit your code, run commands and, for evals, call the Claude API on your account. Commit first, answer the scope question when migrating, and approve commands as they appear.
Information
updated Nov 2, 2026
- Repository
- anthropics/skills
- Folder
skills/claude-api
Sources
Docs, issue trackers and discussions this page is built from.
Show all 10Hide
- anthropics/skills marketplace.json · github.com
- anthropics/skills README · github.com
- skills CLI commands · github.com
- claude-api SKILL.md · github.com
- claude-api on skills.sh · skills.sh
- anthropics/skills · github.com
- drop_block_probe.py · github.com
- prefix_diff.py · github.com
- runner-scaffold.mjs · github.com
- build-report-lite.mjs · github.com