Localized reading guide
claude-apiPurpose, usage and source
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).
Source retrieved:
- Source repository
- anthropics/skills
- SKILL.md
skills/claude-api/SKILL.md- Repository stars
- 185,373
- Repository updated
- 2026-10-29
- Categories
- Development
- Last collected
License: License file needs review
Workflow excerpts are reading aids, not executable instructions from Codez. No third-party Skill was run to produce this page.
The purpose and workflow passages below are upstream material, organized and translated for reading. They are distinct from the separately labeled Codez editorial analysis.
What this Skill 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).
How the upstream workflow works
When to Use WebFetch
Use WebFetch to get the latest documentation when: User asks for "latest" or "current" information Cached data seems incorrect User asks about features not covered here
Upstream passage · L577 ↗Building LLM-Powered Applications with Claude
This skill helps you build LLM-powered applications with Claude. Choose the right surface based on your needs, detect the project language, then read the relevant language-specific documentation.
Upstream passage · L10 ↗Before You Start
Scan the target file (or, if no target file, the prompt and project) for non-Anthropic provider markers - import openai, from openai, langchain_openai, OpenAI(, gpt-4, gpt-5, file names like agent-openai.py or *-generic.py, or any explicit instruction to keep the code provider-neutral.
client.beta.messages.create(
model="claude-opus-5-5", max_tokens=4096,
speed="fast", betas=["fast-mode-2026-02-01"],
messages=[...],
)Requirements and setup
Output Requirement
When the user asks you to add, modify, or implement a Claude feature, your code must call Claude through one of: The official Anthropic SDK for the project's language (anthropic, @anthropic-ai/sdk, com.anthropic.*, etc.). This is the default whenever a supported SDK exists for the project.
Limits and quality checks
Warning: API Drift - Your Training Prior May Be Stale
Several common Claude API shapes changed in 2025-2026. If you recall a pattern from training, verify it against the {lang}/ files in this skill before writing - the rows below are the most frequent drift points: The {lang}/ files in this skill are authoritative over recalled patterns.
Common Pitfalls
Don't truncate inputs when passing files or content to the API. If the content is too long to fit in the context window, notify the user and discuss options (chunking, summarization, etc.) rather than silently truncating. Prefill removed (Fable 5, Claude Fable 5.1, Opus 5, Claude Opus 5.5, Sonnet 5, Claude Sonnet 5.5, and the 4.6/4.7/4.8 family): Assistant message prefills (last-assistant-turn prefills) return a 400 error on Fable 5, Claude Fable 5.1, Opus 5, Claude Opus 5.5, Sonnet 5, Claude Sonnet 5.5, Claude Haiku 5.5, Opus 4.6, Opus 4.7, Opus 4.8, and Sonnet 4.6. Use structured outputs (output_config.format) or system prompt instructions to control response format instead. (One exception: the fallback-credit prefill claim - when redeeming a credit with fallback_has_prefill_claim: true, the server accepts the echoed assistant message; see the migration guide's refusal section.)
Start with a safe trial
- Check the supported host and the repository installation instructions. Keep the Skill directory and its referenced scripts, assets and documentation together; SKILL.md alone may omit dependencies.
- Give the agent your real input, desired output and acceptance criteria. Invocation syntax and available tools depend on the host; this site does not assume a universal install command.
- Try the source workflow in a disposable project or on a copy. Review operations that change files, remote services or billable resources before allowing them.
- Validate the output against the source quality checks and your own requirements. A successful trigger or a high repository Star count does not establish a correct result.
Read further in the source
- Building LLM-Powered Applications with Claude
- 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 - 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)
- Amazon Bedrock
- Microsoft Foundry
- Google Cloud Vertex AI
- Context Editing (Quick Reference)
- Mid-Conversation System Messages (Quick Reference)
- Managed Agents (Beta)
Related Skills
Translation and scope
This reading guide selects passages from the pinned upstream SKILL.md. Translation is assisted. It is not a complete manual or a claim of tested compatibility. Read the original and its referenced files before use.
This introduction refers to the pinned version below; current repository activity and collection time are shown separately.
- Pinned source
- Read the original ↗
- Source retrieved
- Source commit
ca45fc496a3436251f191354091d557da31c15b5- Source SHA-256
40537cca17c4aa86e4ce83ced39efcbfb1204905e3cf4c4ff98f2eab011e4b7f