What the claude-api skill actually is
claude-api is an open-source Agent Skill that Anthropic writes and maintains itself. It's confirmed directly on Anthropic's own Agent Skills overview and documented in full on a dedicated reference page. The skill gives Claude detailed, current reference material for building on two Anthropic surfaces: the Messages API (single requests, streaming chat, tool use, batch processing, prompt caching, structured outputs, custom agent loops) and Claude Managed Agents (beta, an Anthropic-hosted surface for server-managed stateful agents with hosted tool execution and per-session sandboxes). It covers eight languages: Python, TypeScript, C#, Go, Java, PHP, Ruby, and cURL.
The problem it solves is straightforward. A model's knowledge of its own API freezes at training time, but SDK method signatures, model IDs, pricing, and beta headers keep moving after that. Rather than leaving Claude to recall API details from memory, which is exactly the kind of fact that goes stale fastest, the skill gives it a folder of reference material to read from at the moment it's actually writing the code.
It ships bundled with Claude Code
The skill "comes bundled with Claude Code" according to Anthropic's own overview page, which is a different arrangement from most skills on this site. You don't install it, browse for it, or add it to ~/.claude/skills/. Anthropic ships it as part of Claude Code itself, alongside the built-in commands and skills documented in Claude Code's commands reference. If you're on Claude Code and ask it to build a streaming chat feature with the Claude API, or open a project that already imports the anthropic package, this is the skill quietly doing the work.
Why it leans on progressive disclosure
The skill uses the same mechanic every well-built skill relies on: only its name and description load into context until something actually triggers it. Once triggered, it loads documentation scoped to your project's language, which surface you're targeting (Messages API or Managed Agents), and the specific task at hand: tool use, streaming, batches, and so on. It doesn't dump every language's SDK docs into context for a Python project. This is why a skill covering eight languages' worth of API surface can sit installed without meaningfully taxing every conversation it's available in.
What it detects and what it activates on
The skill's activation logic is documented explicitly, and it's narrower than "any coding question." According to Anthropic's reference page, automatic activation happens when:
- Your code imports an Anthropic SDK (
anthropicfor Python,@anthropic-ai/sdkfor TypeScript or JavaScript) - You ask Claude to build, debug, or optimize something using the Claude API, an Anthropic SDK, or Managed Agents
- You add, modify, or tune a Claude-specific feature in a file, such as prompt caching, adaptive thinking, compaction, tool use, batch processing, files, citations, or memory, or reference a model directly
It deliberately does not activate for general programming tasks, machine learning or data science work unrelated to Claude, or code that imports a different vendor's SDK, such as OpenAI's. If you're debugging a Flask route that happens to sit next to an Anthropic API call in the same repo, the skill isn't going to insert itself into unrelated work just because the codebase touches the API somewhere.
Language detection works the same way: the skill checks project files (requirements.txt for Python, tsconfig.json for TypeScript, go.mod for Go, and so on) and loads the matching documentation automatically. In a multi-language repository, Claude asks which one applies rather than guessing. For a language outside the eight it fully supports, such as Rust, Swift, or C++, it falls back to cURL and raw HTTP examples instead of leaving you with nothing.
Manual invocation with /claude-api
Beyond automatic triggering, you can call the skill directly in any environment where it's installed:
/claude-api
That bare form is a general entry point. Two documented subcommands go further.
Migrating your codebase with /claude-api migrate
This is the skill's most concrete party trick: it performs a Claude model migration across a codebase, not just a single file.
/claude-api migrate this project to claude-opus-5
You can scope it up front to skip a confirmation question:
/claude-api migrate everything under src/ to claude-opus-5
/claude-api migrate apps/api.py and apps/worker.py to claude-opus-5
Given an ambiguous scope, like a bare /claude-api migrate to claude-opus-5, it asks you to choose between the whole working directory, a specific subdirectory, or an explicit file list before touching anything. Per Anthropic's own documentation, the migration handles, among other things:
- Model ID swaps, including typed SDK constants such as
Model.CLAUDE_OPUS_4_8becomingModel.CLAUDE_OPUS_5, after classifying each file as a caller, a model definer, or an opaque string reference - Cloud platform detection, preserving platform-specific model ID formats (the
anthropic.prefix on Amazon Bedrock, for example) and skipping features unavailable on partner-operated platforms - Breaking parameter changes, such as removing
temperature,top_p, andtop_kfor Claude Opus 4.8 and 4.7, and convertingthinking: {type: "enabled", budget_tokens: N}tothinking: {type: "adaptive"} - Beta header cleanup, dropping headers the target model no longer needs and switching back from
client.beta.messages.createtoclient.messages.createwhere appropriate - Effort calibration, recommending an
output_config.effortstarting point for the target model - Refusal fallback configuration, adding
stop_reason: "refusal"handling and a fallback retry path when the target is Claude Fable 5 or Claude Opus 5
It explains each change inline as it edits, and finishes with a checklist of items that still need a human to verify, typically integration tests, length-control prompt tuning, and cost or rate-limit re-baselining. For the full list of what changes specifically when moving to Claude Opus 5, see Anthropic's migration guide and this site's own Claude Opus 5 and Agent Skills piece for what changed at launch.
Setting up a Managed Agent with managed-agents-onboard
Claude Managed Agents is a newer, Anthropic-hosted surface, and the skill includes a dedicated onboarding flow for it:
/claude-api managed-agents-onboard
This runs an interview that walks through the Managed Agents mental model (an agent config created once, versus a session created per run), templates an agent config, configures environments and tools, sets up the session loop, and emits runnable code in your project's language. It also enforces the mandatory pattern Anthropic documents: model, system, and tools live on the agent config, never on the session, and an agent should be created once and referenced by ID rather than recreated per run. Managed Agents requires the managed-agents-2026-04-01 beta header, which the SDK sets automatically for client.beta.agents.*, client.beta.environments.*, client.beta.sessions.*, and client.beta.vaults.* calls. It's currently available on the Claude API and Claude Platform on AWS only, not on Amazon Bedrock, Google Cloud, or Microsoft Foundry; the skill routes other deployments back to the Messages API and ordinary tool use instead.
Supported languages
| Language | Messages API SDK | Tool runner | Managed Agents |
|---|---|---|---|
| Python | Yes | Yes (beta) | Yes (beta) |
| TypeScript | Yes | Yes (beta) | Yes (beta) |
| C# | Yes | Yes (beta) | Yes (beta) |
| Go | Yes | Yes (beta) | Yes (beta) |
| Java | Yes | Yes (beta) | Yes (beta) |
| PHP | Yes | Yes (beta) | Yes (beta) |
| Ruby | Yes | Yes (beta) | Yes (beta) |
| cURL | Yes | N/A | Yes (beta) |
Installing it outside Claude Code
Because it's open source, you're not limited to Claude Code. Anthropic publishes the source in the Anthropic skills repository, and it installs the same way any other skill in that repository does, with the skills CLI:
npx skills add https://github.com/anthropics/skills --skill claude-api
Or as a Claude Code plugin, if you'd rather manage it through the plugin marketplace instead:
/plugin marketplace add anthropics/skills
/plugin install claude-api@anthropic-agent-skills
Either route drops the same SKILL.md and reference material any other Agent Skills implementation can read: Codex CLI, Cursor 2.4+, Google Antigravity, and the rest of the platforms this site tracks. Because it's a plain skill folder underneath, this is the same install pattern covered in how to install skills in Claude Code, just pointed at Anthropic's own repository instead of a third-party one.
How this differs from using Agent Skills with the Claude API
It's easy to conflate this with a different article on this site, how to use Agent Skills with the Claude API, because both pair the words "skill" and "Claude API." They're solving opposite problems. That guide is about shipping any Agent Skill to a production Claude API agent through a container upload and the code execution tool, using the API as the platform a skill runs on. The claude-api skill covered here is a specific skill that teaches Claude how to write code against the API and SDKs correctly. One is "how do I run skills on the API," the other is "here's a skill about the API itself." Both are real, and a team could reasonably use both at once: Claude Code equipped with claude-api to help you build a Claude API integration, which itself later runs a completely different skill in production.
Read it before you trust it, same as anything else
Anthropic's own overview page states plainly: "Use Skills only from trusted sources: those you created yourself or obtained from Anthropic." The claude-api skill clears that bar since Anthropic publishes and maintains it directly, but the general habit still applies if you're installing it from the GitHub repository rather than trusting the bundled copy sight unseen: the skills repository is public, so you can read SKILL.md and every reference file before you rely on it, the same as with any skill this site links to source rather than re-hosts.
Troubleshooting
The skill doesn't seem to activate on an obvious Claude API question. Confirm your project actually imports an Anthropic SDK, or phrase the request so it clearly mentions the Claude API, an Anthropic SDK, or Managed Agents. The activation logic is deliberately narrow to avoid firing on unrelated programming work; a vague request in a codebase that doesn't import the SDK may not trigger it.
/claude-api migrate asks which files to touch instead of just running. That's expected for an ambiguous scope. Pass a specific path or file list up front, as shown above, if you don't want the extra confirmation step.
Managed Agents documentation loads when you only wanted Messages API guidance. Be explicit about which surface you're targeting in your request. The skill distinguishes the two, but an ambiguous prompt referencing "an agent" without more context can pull in the wrong track.
You installed it from the skills repository but Claude Code already had a bundled copy. That's fine and not a conflict; the bundled copy in Claude Code and a separately installed copy elsewhere (Codex CLI, for instance) are independent installs of the same open-source skill, and neither depends on the other being present.
Documentation inside the skill looks out of date. Since the skill's reference material ships as static files rather than a live lookup, it's only as current as the version you have. Reinstalling with the same npx skills add command pulls the latest version from the repository; the bundled Claude Code copy updates whenever Claude Code itself does.
Where to go next
For the model migration details this skill automates, see Anthropic's own migration guide and this site's Claude Opus 5 and Agent Skills. For the general Agent Skills mechanics this piece assumes, see what are agent skills and the SKILL.md format explained. If you're shipping skills to a production API integration rather than using this specific one, how to use Agent Skills with the Claude API covers that separately. Browse the open-source repository directly at github.com/anthropics/skills, or the wider catalogue at getclaudeskills.com/skills.
Verified 23 August 2026 directly against Anthropic's Agent Skills overview and the dedicated claude-api skill reference page at platform.claude.com.
