Agent Skill
Claude API
Anthropic's reference skill for building with the Claude API and SDKs in several languages: models, streaming, tool use, caching, agents and migration.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkInstall
Commands are pinned to commit e4bb5d9, the version we read, wherever the install method supports it.
npx skills
npx skills add anthropics/skills@e4bb5d960d87126ff3b3a8af1a104b7db67560ba --skill claude-api -a claude-codeCopies the skill into .claude/skills/ in this project, pinned to the reviewed commit.
Plugin marketplace
/plugin marketplace add anthropics/skills
/plugin install claude-api@anthropic-agent-skillsRun inside Claude Code. Installs the whole claude-api plugin from its default branch, not the pinned commit.
npx skills
npx skills add anthropics/skills@e4bb5d960d87126ff3b3a8af1a104b7db67560ba --skill claude-api -a codexInstalls to .agents/skills/, which Codex scans from the working directory up to the repo root.
npx skills
npx skills add anthropics/skills@e4bb5d960d87126ff3b3a8af1a104b7db67560ba --skill claude-api -a cursorInstalls to .agents/skills/, one of the folders Cursor reads skills from.
gh skill
gh skill install anthropics/skills skills/claude-api --pin e4bb5d960d87126ff3b3a8af1a104b7db67560ba --agent github-copilotNeeds GitHub CLI 2.90.0 or later. Use --scope user to install for every repository.
npx skills
npx skills add anthropics/skills@e4bb5d960d87126ff3b3a8af1a104b7db67560ba --skill claude-apiPinned to the commit we reviewed. The CLI asks which agents to install for; add -g to install for your user instead of this project.
What it does
A large reference meant to stop the agent coding against outdated API knowledge. The SKILL.md covers which surface to use (Messages API, Agent SDK, Managed Agents), current models, defaults and a warning about API drift, and the folder has one subfolder per language (Python, TypeScript, Java, Go, C#, PHP, Ruby and curl) with streaming, tool use, Files API and batch examples. It is also bundled with Claude Code.
When to use it
Writing code against the Claude API or the Agent SDK in any of its eight languages, and migrating code that uses old models or deprecated parameters. Its main job is replacing the model’s stale training data with current model IDs, parameters and features.
When to skip it
Projects that call Claude through a framework such as LangChain or the Vercel AI SDK, where the framework’s API matters more. It is long and its description triggers eagerly, so uninstall it from repositories that do not call the API.
Try it
Add streaming to our support bot's Claude call in src/llm.ts, with
prompt caching on the system prompt and a tool for order lookup. Use
the current recommended model.
What it can touch
- Bundles scripts
- Yes
- Pre-approved tools
- See source
- Needs
- Nothing beyond the agent
- Client-specific fields
- None, spec fields only
claude.ai and the Claude API reject uploads that use fields outside the open spec or names containing "claude" or "anthropic", so this skill needs editing before you upload it there.
Its scripts run with your permissions, and it may have changed since the commit we read. How to check a skill.
At over 600 lines it exceeds the 500-line guideline, and its description is long and aggressive about triggering, so it loads often. The model list inside is dated; check it against Anthropic’s docs if something looks off.
At commit e4bb5d9 the SKILL.md is 617 lines long. Alongside it:
csharp/(6 entries)curl/(2 entries)go/(7 entries)java/(7 entries)php/(8 entries)python/(9 entries)ruby/(6 entries)shared/(58 entries)typescript/(6 entries)LICENSE.txt
Outline of the SKILL.md
We have not reproduced this SKILL.md because it is over 600 lines and about 100 KB, too large to show usefully here; it is licensed Apache-2.0, so you are free to read and copy it at the source. These are its section headings at the reviewed commit; read the full file at the source link.
- Before You Start
- Output Requirement
- Defaults
- Warning: API Drift - Your Training Prior May Be Stale
- Subcommands
- Language Detection
- Which Surface Should I Use?
- Architecture
- Current Models (cached: 2026-10-06)
- Authentication (Quick Reference)
- Thinking & Effort (Quick Reference)
- Compaction (Quick Reference)
- Prompt Caching (Quick Reference)
- Fast Mode (Quick Reference)
- Task Budgets (Quick Reference)
- Provider Clients (Quick Reference)
- Context Editing (Quick Reference)
- Mid-Conversation System Messages (Quick Reference)
- Managed Agents (Beta)
- Server Tools (Quick Reference)
Alternatives
Gemini API dev for Gemini. Our guide to Agent Skills in the Claude API covers running skills through the API, a different job from this skill.
SKILL.md
We have not reproduced this file here; the outline above lists its sections. Read the SKILL.md on GitHub.
Related skills
Gemini API development
Google's skill for writing code against the Gemini API in Python and TypeScript: current models and SDKs, chat, multimodal, function calling and agents.
MCP server builder
A four-phase guide to designing, building, testing and evaluating MCP servers in Python (FastMCP) or TypeScript, with reference docs and an eval harness.
Build an MCP server
Anthropic's entry point for MCP server work in Claude Code: asks about your use case, picks a deployment model and tool-design pattern, then hands off.
Guides and recipes that use Claude API
- Move an app to a new model without regressions
LLM model migration without surprises: freeze a golden set, run old and new models side by side, fix the prompts, compare cost, then roll out behind a flag.
- Give your coding agent current docs with Context7 or llms.txt
Stop your coding agent using outdated APIs: connect Context7 over MCP, point it at a library's llms.txt, or install a vendor skill, then check it worked.
- Claude Agent SDK
Build agents on the same harness that powers Claude Code.
- Build your first agent in Python
Three tools, a hard turn limit, a clear stop condition and a log of every tool call it makes.