skillmake
← marketplace
aiapisha:573eb1113c5b108amanual

claude-api

Use when building, debugging, or optimizing apps that call the Claude API or Anthropic SDK so the agent emits Claude-shaped code with prompt caching, the right model, and the current SDK surface.

Install confidence
curl --create-dirs -fsSL https://skillmake.xyz/i/claude-api -o ~/.claude/skills/claude-api/SKILL.md
Pinned content
sha:573eb1113c5b108a
Generated with
manual
Source
github.com

The file served at /api/marketplace/claude-api-573eb111/raw matches this hash. Inspect before install, then copy the command.

2,834 chars · ~709 tokens
---
name: claude-api
description: Use when building, debugging, or optimizing apps that call the Claude API or Anthropic SDK so the agent emits Claude-shaped code with prompt caching, the right model, and the current SDK surface.
source: https://github.com/anthropics/skills/tree/main/skills/claude-api
generated: 2026-05-25T05:10:30.215Z
category: api
audience: ai
---

## When to use

- A file imports anthropic or @anthropic-ai/sdk and the user is adding a new Claude feature
- Migrating Claude API code between model versions (4.5 → 4.6 → 4.7) or replacing a retired model
- Tuning prompt caching, thinking, tool use, batch, files, citations, or memory on an existing Anthropic SDK call
- Investigating low cache hit rate or unexpected token bills on an Anthropic-backed app

## Key concepts

### Provider-marker check before edits

Scans the target file for openai, gpt-4, gpt-5, langchain_openai, or *-openai.py / *-generic.py markers. If any are found, the skill stops and asks before introducing Anthropic-specific code into a non-Anthropic file.

### Prompt caching by default

Any non-trivial Claude call gets prompt caching applied. Cache hit rate is treated as a primary correctness metric, not a 'nice to have' optimization.

### Surface-aware code paths

Messages API, Managed Agents, batch, files, citations, and memory each have distinct snippets. The skill picks the right surface for the task instead of jamming everything into Messages.

### Model selection rules

Defaults to the latest Sonnet for general work, Opus for the hard cases, Haiku for cheap throughput. The skill names the exact current model IDs (e.g. claude-opus-4-7) rather than using legacy aliases.

### Migration guidance

Knows the breaking-change deltas between recent Claude versions and the retirement timelines for older models, so a migration PR doesn't ship behavior changes by accident.

## API reference

```
npx skills add anthropics/skills --skill claude-api
```

Install the Claude API skill from Anthropic's official skills repo.

```
npx skills add anthropics/skills --skill claude-api
```

## Gotchas

- Don't apply this skill to OpenAI-marked files; the skill explicitly refuses and asks first
- Prompt caching breaks silently when the system prompt or tool definitions change between calls — keep them stable
- Tool use response handling differs across SDK major versions; pin the SDK version per app
- Retired models still answer for a grace period, then start 404ing; check current model status before relying on a code freeze
- Managed Agents and the raw Messages API have different rate-limit and feature surfaces; pick one per app and stick with it

---
Generated by SkillMake from https://github.com/anthropics/skills/tree/main/skills/claude-api on 2026-05-25T05:10:30.215Z.
Verify against source before relying on details.

File: ~/.claude/skills/claude-api/SKILL.md