What it does
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).
This entry summarizes the public skill for discovery. Prefer the upstream SKILL.md for the full instruction text (we do not paste restricted or lengthy proprietary prompt bodies).
Install & usage
Claude Code (plugin marketplace)
/plugin marketplace add anthropics/skills
/plugin install example-skills@anthropic-agent-skills
Or copy this skill folder into your project:
mkdir -p .claude/skills
git clone --depth 1 https://github.com/anthropics/skills.git /tmp/anthropics-skills
cp -R /tmp/anthropics-skills/skills/claude-api .claude/skills/claude-api
Then ask Claude Code to use the claude-api skill for a matching task.
Best for
Correct Claude API / SDK usage across languages and model IDs.
Hands-on test
- test_level: installed-validated
- Ran: yes
- When: 2026-11-01T01:20:00+08:00 (Asia/Shanghai)
- Result: Drafted messages_dry_run.py from skill refs (91 files); live Messages call skipped — ANTHROPIC_API_KEY unset (no paid API).
- Gotchas: Cannot complete live API path without a key/credits.
Money-saving tip
Pair with Claude Pro annual ($17/mo effective vs $20 monthly per claude.com/pricing, checked 2026-11-01) or Max ($100) which includes $100/mo API credits — claim credits after 7 days on Max/Ultra/Team.
Source & license
- source_repo: anthropics/skills
- Source: https://github.com/anthropics/skills/tree/main/skills/claude-api
- License: Apache-2.0 — https://github.com/anthropics/skills/blob/main/skills/claude-api/LICENSE.txt
- Restrictions: Apache-2.0 examples may be redistributed with attribution. Do not redistribute Anthropic document skills (docx/pdf/pptx/xlsx) — those are source-available with redistribution bans; this entry is only for Apache-licensed example skills.