{"id":"0943cd45-8c19-4366-8081-22f6bdf68d7c","shortId":"j8wVdc","kind":"skill","title":"claude-api","tagline":"Build, debug, and optimize Claude API / Anthropic SDK apps. Apps built with this skill should include prompt caching. Also handles migrating existing Claude API code between Claude model versions (4.5 → 4.6, 4.6 → 4.7, retired-model replacements). TRIGGER when: code imports `anth","description":"# Building LLM-Powered Applications with Claude\n\nThis 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.\n\n## Before You Start\n\nScan 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. If you find any, stop and tell the user that this skill produces Claude/Anthropic SDK code; ask whether they want to switch the file to Claude or want a non-Claude implementation. Do not edit a non-Anthropic file with Anthropic SDK calls.\n\n## Output Requirement\n\nWhen the user asks you to add, modify, or implement a Claude feature, your code must call Claude through one of:\n\n1. **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.\n2. **Raw HTTP** (`curl`, `requests`, `fetch`, `httpx`, etc.) — only when the user explicitly asks for cURL/REST/raw HTTP, the project is a shell/cURL project, or the language has no official SDK.\n\nNever mix the two — don't reach for `requests`/`fetch` in a Python or TypeScript project just because it feels lighter. Never fall back to OpenAI-compatible shims.\n\n**Never guess SDK usage.** Function names, class names, namespaces, method signatures, and import paths must come from explicit documentation — either the `{lang}/` files in this skill or the official SDK repositories or documentation links listed in `shared/live-sources.md`. If the binding you need is not explicitly documented in the skill files, WebFetch the relevant SDK repo from `shared/live-sources.md` before writing code. Do not infer Ruby/Java/Go/PHP/C# APIs from cURL shapes or from another language's SDK.\n\n## Defaults\n\nUnless the user requests otherwise:\n\nFor the Claude model version, please use Claude Opus 4.7, which you can access via the exact model string `claude-opus-4-7`. Please default to using adaptive thinking (`thinking: {type: \"adaptive\"}`) for anything remotely complicated. And finally, please default to streaming for any request that may involve long input, long output, or high `max_tokens` — it prevents hitting request timeouts. Use the SDK's `.get_final_message()` / `.finalMessage()` helper to get the complete response if you don't need to handle individual stream events\n\n---\n\n## Subcommands\n\nIf the User Request at the bottom of this prompt is a bare subcommand string (no prose), search every **Subcommands** table in this document — including any in sections appended below — and follow the matching Action column directly. This lets users invoke specific flows via `/claude-api <subcommand>`. If no table in the document matches, treat the request as normal prose.\n\n\n---\n\n## Language Detection\n\nBefore reading code examples, determine which language the user is working in:\n\n1. **Look at project files** to infer the language:\n\n   - `*.py`, `requirements.txt`, `pyproject.toml`, `setup.py`, `Pipfile` → **Python** — read from `python/`\n   - `*.ts`, `*.tsx`, `package.json`, `tsconfig.json` → **TypeScript** — read from `typescript/`\n   - `*.js`, `*.jsx` (no `.ts` files present) → **TypeScript** — JS uses the same SDK, read from `typescript/`\n   - `*.java`, `pom.xml`, `build.gradle` → **Java** — read from `java/`\n   - `*.kt`, `*.kts`, `build.gradle.kts` → **Java** — Kotlin uses the Java SDK, read from `java/`\n   - `*.scala`, `build.sbt` → **Java** — Scala uses the Java SDK, read from `java/`\n   - `*.go`, `go.mod` → **Go** — read from `go/`\n   - `*.rb`, `Gemfile` → **Ruby** — read from `ruby/`\n   - `*.cs`, `*.csproj` → **C#** — read from `csharp/`\n   - `*.php`, `composer.json` → **PHP** — read from `php/`\n\n2. **If multiple languages detected** (e.g., both Python and TypeScript files):\n\n   - Check which language the user's current file or question relates to\n   - If still ambiguous, ask: \"I detected both Python and TypeScript files. Which language are you using for the Claude API integration?\"\n\n3. **If language can't be inferred** (empty project, no source files, or unsupported language):\n\n   - Use AskUserQuestion with options: Python, TypeScript, Java, Go, Ruby, cURL/raw HTTP, C#, PHP\n   - If AskUserQuestion is unavailable, default to Python examples and note: \"Showing Python examples. Let me know if you need a different language.\"\n\n4. **If unsupported language detected** (Rust, Swift, C++, Elixir, etc.):\n\n   - Suggest cURL/raw HTTP examples from `curl/` and note that community SDKs may exist\n   - Offer to show Python or TypeScript examples as reference implementations\n\n5. **If user needs cURL/raw HTTP examples**, read from `curl/`.\n\n### Language-Specific Feature Support\n\n| Language   | Tool Runner | Managed Agents | Notes                                 |\n| ---------- | ----------- | -------------- | ------------------------------------- |\n| Python     | Yes (beta)  | Yes (beta)     | Full support — `@beta_tool` decorator |\n| TypeScript | Yes (beta)  | Yes (beta)     | Full support — `betaZodTool` + Zod    |\n| Java       | Yes (beta)  | Yes (beta)     | Beta tool use with annotated classes  |\n| Go         | Yes (beta)  | Yes (beta)     | `BetaToolRunner` in `toolrunner` pkg  |\n| Ruby       | Yes (beta)  | Yes (beta)     | `BaseTool` + `tool_runner` in beta    |\n| C#         | No          | No             | Official SDK                          |\n| PHP        | Yes (beta)  | Yes (beta)     | `BetaRunnableTool` + `toolRunner()`   |\n| cURL       | N/A         | Yes (beta)     | Raw HTTP, no SDK features             |\n\n> **Managed Agents code examples**: dedicated language-specific READMEs are provided for Python, TypeScript, Go, Ruby, PHP, Java, and cURL (`{lang}/managed-agents/README.md`, `curl/managed-agents.md`). Read your language's README plus the language-agnostic `shared/managed-agents-*.md` concept files. **Agents are persistent — create once, reference by ID.** Store the agent ID returned by `agents.create` and pass it to every subsequent `sessions.create`; do not call `agents.create` in the request path. The Anthropic CLI is one convenient way to create agents and environments from version-controlled YAML — its URL is in `shared/live-sources.md`. If a binding you need isn't shown in the README, WebFetch the relevant entry from `shared/live-sources.md` rather than guess. C# does not currently have Managed Agents support; use cURL-style raw HTTP requests against the API.\n\n---\n\n## Which Surface Should I Use?\n\n> **Start simple.** Default to the simplest tier that meets your needs. Single API calls and workflows handle most use cases — only reach for agents when the task genuinely requires open-ended, model-driven exploration.\n\n| Use Case                                        | Tier            | Recommended Surface       | Why                                                          |\n| ----------------------------------------------- | --------------- | ------------------------- | ------------------------------------------------------------ |\n| Classification, summarization, extraction, Q&A  | Single LLM call | **Claude API**            | One request, one response                                    |\n| Batch processing or embeddings                  | Single LLM call | **Claude API**            | Specialized endpoints                                        |\n| Multi-step pipelines with code-controlled logic | Workflow        | **Claude API + tool use** | You orchestrate the loop                                     |\n| Custom agent with your own tools                | Agent           | **Claude API + tool use** | Maximum flexibility                                          |\n| Server-managed stateful agent with workspace    | Agent           | **Managed Agents**        | Anthropic runs the loop and hosts the tool-execution sandbox |\n| Persisted, versioned agent configs              | Agent           | **Managed Agents**        | Agents are stored objects; sessions pin to a version         |\n| Long-running multi-turn agent with file mounts  | Agent           | **Managed Agents**        | Per-session containers, SSE event stream, Skills + MCP       |\n\n> **Note:** Managed Agents is the right choice when you want Anthropic to run the agent loop *and* host the container where tools execute — file ops, bash, code execution all run in the per-session workspace. If you want to host the compute yourself or run your own custom tool runtime, Claude API + tool use is the right choice — use the tool runner for automatic loop handling, or the manual loop for fine-grained control (approval gates, custom logging, conditional execution).\n\n> **Third-party providers (Amazon Bedrock, Google Vertex AI, Microsoft Foundry):** Managed Agents is **not available** on Bedrock, Vertex, or Foundry. If you are deploying through any third-party provider, use **Claude API + tool use** for all use cases — including ones where Managed Agents would otherwise be the recommended surface.\n\n### Decision Tree\n\n```\nWhat does your application need?\n\n0. Are you deploying through Amazon Bedrock, Google Vertex AI, or Microsoft Foundry?\n   └── Yes → Claude API (+ tool use for agents) — Managed Agents is 1P only.\n   No → continue.\n\n1. Single LLM call (classification, summarization, extraction, Q&A)\n   └── Claude API — one request, one response\n\n2. Do you want Anthropic to run the agent loop and host a per-session\n   container where Claude executes tools (bash, file ops, code)?\n   └── Yes → Managed Agents — server-managed sessions, persisted agent configs,\n       SSE event stream, Skills + MCP, file mounts.\n       Examples: \"stateful coding agent with a workspace per task\",\n                 \"long-running research agent that streams events to a UI\",\n                 \"agent with persisted, versioned config used across many sessions\"\n\n3. Workflow (multi-step, code-orchestrated, with your own tools)\n   └── Claude API with tool use — you control the loop\n\n4. Open-ended agent (model decides its own trajectory, your own tools, you host the compute)\n   └── Claude API agentic loop (maximum flexibility)\n```\n\n### Should I Build an Agent?\n\nBefore choosing the agent tier, check all four criteria:\n\n- **Complexity** — Is the task multi-step and hard to fully specify in advance? (e.g., \"turn this design doc into a PR\" vs. \"extract the title from this PDF\")\n- **Value** — Does the outcome justify higher cost and latency?\n- **Viability** — Is Claude capable at this task type?\n- **Cost of error** — Can errors be caught and recovered from? (tests, review, rollback)\n\nIf the answer is \"no\" to any of these, stay at a simpler tier (single call or workflow).\n\n---\n\n## Architecture\n\nEverything goes through `POST /v1/messages`. Tools and output constraints are features of this single endpoint — not separate APIs.\n\n**User-defined tools** — You define tools (via decorators, Zod schemas, or raw JSON), and the SDK's tool runner handles calling the API, executing your functions, and looping until Claude is done. For full control, you can write the loop manually.\n\n**Server-side tools** — Anthropic-hosted tools that run on Anthropic's infrastructure. Code execution is fully server-side (declare it in `tools`, Claude runs code automatically). Computer use can be server-hosted or self-hosted.\n\n**Structured outputs** — Constrains the Messages API response format (`output_config.format`) and/or tool parameter validation (`strict: true`). The recommended approach is `client.messages.parse()` which validates responses against your schema automatically. Note: the old `output_format` parameter is deprecated; use `output_config: {format: {...}}` on `messages.create()`.\n\n**Supporting endpoints** — Batches (`POST /v1/messages/batches`), Files (`POST /v1/files`), Token Counting, and Models (`GET /v1/models`, `GET /v1/models/{id}` — live capability/context-window discovery) feed into or support Messages API requests.\n\n---\n\n## Current Models (cached: 2026-04-15)\n\n| Model             | Model ID            | Context        | Input $/1M | Output $/1M |\n| ----------------- | ------------------- | -------------- | ---------- | ----------- |\n| Claude Opus 4.7   | `claude-opus-4-7`   | 1M             | $5.00      | $25.00      |\n| Claude Opus 4.6   | `claude-opus-4-6`   | 1M             | $5.00      | $25.00      |\n| Claude Sonnet 4.6 | `claude-sonnet-4-6` | 1M             | $3.00      | $15.00      |\n| Claude Haiku 4.5  | `claude-haiku-4-5`  | 200K           | $1.00      | $5.00       |\n\n**ALWAYS use `claude-opus-4-7` unless the user explicitly names a different model.** This is non-negotiable. Do not use `claude-sonnet-4-6`, `claude-sonnet-4-5`, or any other model unless the user literally says \"use sonnet\" or \"use haiku\". Never downgrade for cost — that's the user's decision, not yours.\n\n**CRITICAL: Use only the exact model ID strings from the table above — they are complete as-is. Do not append date suffixes.** For example, use `claude-sonnet-4-5`, never `claude-sonnet-4-5-20250514` or any other date-suffixed variant you might recall from training data. If the user requests an older model not in the table (e.g., \"opus 4.5\", \"sonnet 3.7\"), read `shared/models.md` for the exact ID — do not construct one yourself.\n\nA note: if any of the model strings above look unfamiliar to you, that's to be expected — that just means they were released after your training data cutoff. Rest assured they are real models; we wouldn't mess with you like that.\n\n**Live capability lookup:** The table above is cached. When the user asks \"what's the context window for X\", \"does X support vision/thinking/effort\", or \"which models support Y\", query the Models API (`client.models.retrieve(id)` / `client.models.list()`) — see `shared/models.md` for the field reference and capability-filter examples.\n\n---\n\n## Thinking & Effort (Quick Reference)\n\n**Opus 4.7 — Adaptive thinking only:** Use `thinking: {type: \"adaptive\"}`. `thinking: {type: \"enabled\", budget_tokens: N}` returns a 400 on Opus 4.7 — adaptive is the only on-mode. `{type: \"disabled\"}` and omitting `thinking` both work. Sampling parameters (`temperature`, `top_p`, `top_k`) are also removed and will 400. See `shared/model-migration.md` → Migrating to Opus 4.7 for the full breaking-change list.\n**Opus 4.6 — Adaptive thinking (recommended):** Use `thinking: {type: \"adaptive\"}`. Claude dynamically decides when and how much to think. No `budget_tokens` needed — `budget_tokens` is deprecated on Opus 4.6 and Sonnet 4.6 and should not be used for new code. Adaptive thinking also automatically enables interleaved thinking (no beta header needed). **When the user asks for \"extended thinking\", a \"thinking budget\", or `budget_tokens`: always use Opus 4.7 or 4.6 with `thinking: {type: \"adaptive\"}`. The concept of a fixed token budget for thinking is deprecated — adaptive thinking replaces it. Do NOT use `budget_tokens` for new 4.6/4.7 code and do NOT switch to an older model.** *Gradual-migration carve-out:* `budget_tokens` is still functional on Opus 4.6 and Sonnet 4.6 as a transitional escape hatch — if you're migrating existing code and need a hard token ceiling before you've tuned `effort`, see `shared/model-migration.md` → Transitional escape hatch. Note: this carve-out does **not** apply to Opus 4.7 — `budget_tokens` is fully removed there.\n**Effort parameter (GA, no beta header):** Controls thinking depth and overall token spend via `output_config: {effort: \"low\"|\"medium\"|\"high\"|\"max\"}` (inside `output_config`, not top-level). Default is `high` (equivalent to omitting it). `max` is Opus-tier only (Opus 4.6 and later — not Sonnet or Haiku). Opus 4.7 adds `\"xhigh\"` (between `high` and `max`) — the best setting for most coding and agentic use cases on 4.7, and the default in Claude Code; use a minimum of `high` for most intelligence-sensitive work. Works on Opus 4.5, Opus 4.6, Opus 4.7, and Sonnet 4.6. Will error on Sonnet 4.5 / Haiku 4.5. On Opus 4.7, effort matters more than on any prior Opus — re-tune it when migrating. Combine with adaptive thinking for the best cost-quality tradeoffs. Lower effort means fewer and more-consolidated tool calls, less preamble, and terser confirmations — `high` is often the sweet spot balancing quality and token efficiency; use `max` when correctness matters more than cost; use `low` for subagents or simple tasks.\n\n**Opus 4.7 — thinking content omitted by default:** `thinking` blocks still stream but their text is empty unless you opt in with `thinking: {type: \"adaptive\", display: \"summarized\"}` (default is `\"omitted\"`). Silent change — no error. If you stream reasoning to users, the default looks like a long pause before output; set `\"summarized\"` to restore visible progress.\n\n**Task Budgets (beta, Opus 4.7):** `output_config: {task_budget: {type: \"tokens\", total: N}}` tells the model how many tokens it has for a full agentic loop — it sees a running countdown and self-moderates (minimum 20,000; beta header `task-budgets-2026-03-13`). Distinct from `max_tokens`, which is an enforced per-response ceiling the model is not aware of. See `shared/model-migration.md` → Task Budgets.\n\n**Sonnet 4.6:** Supports adaptive thinking (`thinking: {type: \"adaptive\"}`). `budget_tokens` is deprecated on Sonnet 4.6 — use adaptive thinking instead.\n\n**Older models (only if explicitly requested):** If the user specifically asks for Sonnet 4.5 or another older model, use `thinking: {type: \"enabled\", budget_tokens: N}`. `budget_tokens` must be less than `max_tokens` (minimum 1024). Never choose an older model just because the user mentions `budget_tokens` — use Opus 4.7 with adaptive thinking instead.\n\n---\n\n## Compaction (Quick Reference)\n\n**Beta, Opus 4.7, Opus 4.6, and Sonnet 4.6.** For long-running conversations that may exceed the 1M context window, enable server-side compaction. The API automatically summarizes earlier context when it approaches the trigger threshold (default: 150K tokens). Requires beta header `compact-2026-01-12`.\n\n**Critical:** Append `response.content` (not just the text) back to your messages on every turn. Compaction blocks in the response must be preserved — the API uses them to replace the compacted history on the next request. Extracting only the text string and appending that will silently lose the compaction state.\n\nSee `{lang}/claude-api/README.md` (Compaction section) for code examples. Full docs via WebFetch in `shared/live-sources.md`.\n\n---\n\n## Prompt Caching (Quick Reference)\n\n**Prefix match.** Any byte change anywhere in the prefix invalidates everything after it. Render order is `tools` → `system` → `messages`. Keep stable content first (frozen system prompt, deterministic tool list), put volatile content (timestamps, per-request IDs, varying questions) after the last `cache_control` breakpoint.\n\n**Top-level auto-caching** (`cache_control: {type: \"ephemeral\"}` on `messages.create()`) is the simplest option when you don't need fine-grained placement. Max 4 breakpoints per request. Minimum cacheable prefix is ~1024 tokens — shorter prefixes silently won't cache.\n\n**Verify with `usage.cache_read_input_tokens`** — if it's zero across repeated requests, a silent invalidator is at work (`datetime.now()` in system prompt, unsorted JSON, varying tool set).\n\nFor placement patterns, architectural guidance, and the silent-invalidator audit checklist: read `shared/prompt-caching.md`. Language-specific syntax: `{lang}/claude-api/README.md` (Prompt Caching section).\n\n---\n\n## Managed Agents (Beta)\n\n**Managed Agents** is a third surface: server-managed stateful agents with Anthropic-hosted tool execution. You create a persisted, versioned Agent config (`POST /v1/agents`), then start Sessions that reference it. Each session provisions a container as the agent's workspace — bash, file ops, and code execution run there; the agent loop itself runs on Anthropic's orchestration layer and acts on the container via tools. The session streams events; you send messages and tool results back.\n\n**Managed Agents is first-party only.** It is not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. For agents on third-party providers, use Claude API + tool use.\n\n**Mandatory flow:** Agent (once) → Session (every run). `model`/`system`/`tools` live on the agent, never the session. See `shared/managed-agents-overview.md` for the full reading guide, beta headers, and pitfalls.\n\n**Beta headers:** `managed-agents-2026-04-01` — the SDK sets this automatically for all `client.beta.{agents,environments,sessions,vaults,memory_stores}.*` calls. Skills API uses `skills-2025-10-02` and Files API uses `files-api-2025-04-14`, but you don't need to explicitly pass those in for endpoints other than `/v1/skills` and `/v1/files`.\n\n**Subcommands** — invoke directly with `/claude-api <subcommand>`:\n\n| Subcommand | Action |\n|---|---|\n| `managed-agents-onboard` | Walk the user through setting up a Managed Agent from scratch. **Read `shared/managed-agents-onboarding.md` immediately** and follow its interview script: mental model → know-or-explore branch → template config → session setup → emit code. Do not summarize — run the interview. |\n\n**Reading guide:** Start with `shared/managed-agents-overview.md`, then the topical `shared/managed-agents-*.md` files (core, environments, tools, events, memory, client-patterns, onboarding, api-reference). For Python, TypeScript, Go, Ruby, PHP, and Java, read `{lang}/managed-agents/README.md` for code examples. For cURL, read `curl/managed-agents.md`. **Agents are persistent — create once, reference by ID.** Store the agent ID returned by `agents.create` and pass it to every subsequent `sessions.create`; do not call `agents.create` in the request path. The Anthropic CLI is one convenient way to create agents and environments from version-controlled YAML (URL in `shared/live-sources.md`). If a binding you need isn't shown in the language README, WebFetch the relevant entry from `shared/live-sources.md` rather than guess. C# does not currently have Managed Agents support; use raw HTTP from `curl/managed-agents.md` as a reference.\n\n**When the user wants to set up a Managed Agent from scratch** (e.g. \"how do I get started\", \"walk me through creating one\", \"set up a new agent\"): read `shared/managed-agents-onboarding.md` and run its interview — same flow as the `managed-agents-onboard` subcommand.\n\n**When the user asks \"how do I write the client code for X\":** reach for `shared/managed-agents-client-patterns.md` — covers lossless stream reconnect, `processed_at` queued/processed gate, interrupt, `tool_confirmation` round-trip, the correct idle/terminated break gate, post-idle status race, stream-first ordering, file-mount gotchas, keeping credentials host-side via custom tools, etc.\n\n---\n\n## Reading Guide\n\nAfter detecting the language, read the relevant files based on what the user needs:\n\n### Quick Task Reference\n\n**Single text classification/summarization/extraction/Q&A:**\n→ Read only `{lang}/claude-api/README.md`\n\n**Chat UI or real-time response display:**\n→ Read `{lang}/claude-api/README.md` + `{lang}/claude-api/streaming.md`\n\n**Long-running conversations (may exceed context window):**\n→ Read `{lang}/claude-api/README.md` — see Compaction section\n**Migrating to a newer model (Opus 4.7 / Opus 4.6 / Sonnet 4.6) or replacing a retired model:**\n→ Read `shared/model-migration.md`\n**Prompt caching / optimize caching / \"why is my cache hit rate low\":**\n→ Read `shared/prompt-caching.md` + `{lang}/claude-api/README.md` (Prompt Caching section)\n\n**Function calling / tool use / agents:**\n→ Read `{lang}/claude-api/README.md` + `shared/tool-use-concepts.md` + `{lang}/claude-api/tool-use.md`\n\n**Agent design (tool surface, context management, caching strategy):**\n→ Read `shared/agent-design.md`\n\n**Batch processing (non-latency-sensitive):**\n→ Read `{lang}/claude-api/README.md` + `{lang}/claude-api/batches.md`\n\n**File uploads across multiple requests:**\n→ Read `{lang}/claude-api/README.md` + `{lang}/claude-api/files-api.md`\n\n**Managed Agents (server-managed stateful agents with workspace):**\n→ Read `shared/managed-agents-overview.md` + the rest of the `shared/managed-agents-*.md` files. For Python, TypeScript, Go, Ruby, PHP, and Java, read `{lang}/managed-agents/README.md` for code examples. For cURL, read `curl/managed-agents.md`. **Agents are persistent — create once, reference by ID.** Store the agent ID returned by `agents.create` and pass it to every subsequent `sessions.create`; do not call `agents.create` in the request path. The Anthropic CLI is one convenient way to create agents and environments from version-controlled YAML (URL in `shared/live-sources.md`). If a binding you need isn't shown in the language README, WebFetch the relevant entry from `shared/live-sources.md` rather than guess. C# does not currently support Managed Agents — use raw HTTP from `curl/managed-agents.md` as a reference.\n\n### Claude API (Full File Reference)\n\nRead the **language-specific Claude API folder** (`{language}/claude-api/`):\n\n1. **`{language}/claude-api/README.md`** — **Read this first.** Installation, quick start, common patterns, error handling.\n2. **`shared/tool-use-concepts.md`** — Read when the user needs function calling, code execution, memory, or structured outputs. Covers conceptual foundations.\n3. **`shared/agent-design.md`** — Read when designing an agent: bash vs. dedicated tools, programmatic tool calling, tool search/skills, context editing vs. compaction vs. memory, caching principles.\n4. **`{language}/claude-api/tool-use.md`** — Read for language-specific tool use code examples (tool runner, manual loop, code execution, memory, structured outputs).\n5. **`{language}/claude-api/streaming.md`** — Read when building chat UIs or interfaces that display responses incrementally.\n6. **`{language}/claude-api/batches.md`** — Read when processing many requests offline (not latency-sensitive). Runs asynchronously at 50% cost.\n7. **`{language}/claude-api/files-api.md`** — Read when sending the same file across multiple requests without re-uploading.\n8. **`shared/prompt-caching.md`** — Read when adding or optimizing prompt caching. Covers prefix-stability design, breakpoint placement, and anti-patterns that silently invalidate cache.\n9. **`shared/error-codes.md`** — Read when debugging HTTP errors or implementing error handling.\n10. **`shared/model-migration.md`** — Read when upgrading to newer models, replacing retired models, or translating `budget_tokens` / prefill patterns to the current API.\n11. **`shared/live-sources.md`** — WebFetch URLs for fetching the latest official documentation.\n\n> **Note:** For Java, Go, Ruby, C#, PHP, and cURL — these have a single file each covering all basics. Read that file plus `shared/tool-use-concepts.md` and `shared/error-codes.md` as needed.\n\n> **Note:** For the Managed Agents file reference, see the `## Managed Agents (Beta)` section above — it lists every `shared/managed-agents-*.md` file and the language-specific READMEs.\n\n---\n\n## When to Use WebFetch\n\nUse WebFetch to get the latest documentation when:\n\n- User asks for \"latest\" or \"current\" information\n- Cached data seems incorrect\n- User asks about features not covered here\n\nLive documentation URLs are in `shared/live-sources.md`.\n\n## Common Pitfalls\n\n- 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.\n- **Opus 4.7 thinking:** Adaptive only. `thinking: {type: \"enabled\", budget_tokens: N}` returns 400 on Opus 4.7 — `budget_tokens` is fully removed there (along with `temperature`, `top_p`, `top_k`). Use `thinking: {type: \"adaptive\"}`.\n- **Opus 4.6 / Sonnet 4.6 thinking:** Use `thinking: {type: \"adaptive\"}` — do NOT use `budget_tokens` for new 4.6 code (deprecated on both Opus 4.6 and Sonnet 4.6; for gradual migration of existing code, see the transitional escape hatch in `shared/model-migration.md` — note this carve-out does not apply to Opus 4.7). For older models, `budget_tokens` must be less than `max_tokens` (minimum 1024). This will throw an error if you get it wrong.\n- **4.6/4.7 family prefill removed:** Assistant message prefills (last-assistant-turn prefills) return a 400 error on Opus 4.6, Opus 4.7, and Sonnet 4.6. Use structured outputs (`output_config.format`) or system prompt instructions to control response format instead.\n- **Confirm migration scope before editing:** When a user asks to migrate code to a newer Claude model without naming a specific file, directory, or file list, **ask which scope to apply first** — the entire working directory, a specific subdirectory, or a specific set of files. Do not start editing until the user confirms. Imperative phrasings like \"migrate my codebase\", \"move my project to X\", \"upgrade to Sonnet 4.6\", or bare \"migrate to Opus 4.7\" are **still ambiguous** — they tell you what to do but not where, so ask. Proceed without asking only when the prompt names an exact file, a specific directory, or an explicit file list (\"migrate `app.py`\", \"migrate everything under `services/`\", \"update `a.py` and `b.py`\"). See `shared/model-migration.md` Step 0.\n- **`max_tokens` defaults:** Don't lowball `max_tokens` — hitting the cap truncates output mid-thought and requires a retry. For non-streaming requests, default to `~16000` (keeps responses under SDK HTTP timeouts). For streaming requests, default to `~64000` (timeouts aren't a concern, so give the model room). Only go lower when you have a hard reason: classification (`~256`), cost caps, or deliberately short outputs.\n- **128K output tokens:** Opus 4.6 and Opus 4.7 support up to 128K `max_tokens`, but the SDKs require streaming for values that large to avoid HTTP timeouts. Use `.stream()` with `.get_final_message()` / `.finalMessage()`.\n- **Tool call JSON parsing (4.6/4.7 family):** Opus 4.6, Opus 4.7, and Sonnet 4.6 may produce different JSON string escaping in tool call `input` fields (e.g., Unicode or forward-slash escaping). Always parse tool inputs with `json.loads()` / `JSON.parse()` — never do raw string matching on the serialized input.\n- **Structured outputs (all models):** Use `output_config: {format: {...}}` instead of the deprecated `output_format` parameter on `messages.create()`. This is a general API change, not 4.6-specific.\n- **Don't reimplement SDK functionality:** The SDK provides high-level helpers — use them instead of building from scratch. Specifically: use `stream.finalMessage()` instead of wrapping `.on()` events in `new Promise()`; use typed exception classes (`Anthropic.RateLimitError`, etc.) instead of string-matching error messages; use SDK types (`Anthropic.MessageParam`, `Anthropic.Tool`, `Anthropic.Message`, etc.) instead of redefining equivalent interfaces.\n- **Don't define custom types for SDK data structures:** The SDK exports types for all API objects. Use `Anthropic.MessageParam` for messages, `Anthropic.Tool` for tool definitions, `Anthropic.ToolUseBlock` / `Anthropic.ToolResultBlockParam` for tool results, `Anthropic.Message` for responses. Defining your own `interface ChatMessage { role: string; content: unknown }` duplicates what the SDK already provides and loses type safety.\n- **Report and document output:** For tasks that produce reports, documents, or visualizations, the code execution sandbox has `python-docx`, `python-pptx`, `matplotlib`, `pillow`, and `pypdf` pre-installed. Claude can generate formatted files (DOCX, PDF, charts) and return them via the Files API — consider this for \"report\" or \"document\" type requests instead of plain stdout text.","tags":["claude","api","skills","anthropics","agent-skills"],"capabilities":["skill","source-anthropics","skill-claude-api","topic-agent-skills"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/anthropics/skills/claude-api","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add anthropics/skills","source_repo":"https://github.com/anthropics/skills","install_from":"skills.sh"}},"qualityScore":"0.950","qualityRationale":"deterministic score 0.95 from registry signals: · indexed on github topic:agent-skills · official publisher · 122919 github stars · SKILL.md body (31,893 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-24T00:50:10.295Z","embedding":null,"createdAt":"2026-04-18T20:24:34.376Z","updatedAt":"2026-04-24T00:50:10.295Z","lastSeenAt":"2026-04-24T00:50:10.295Z","tsv":"'-01':2621,2976 '-02':2998 '-03':2476 '-04':1692,2975,3007 '-10':2997 '-12':2622 '-13':2477 '-14':3008 '-15':1693 '-2025':2996 '-20250514':1842 '-2026':2620 '-4':114 '-5':116,1742,1778,1835,1841 '-6':1720,1731,1773 '-7':393,1709,1752 '/1m':1699,1701 '/4.7':2134,3997,4261 '/claude-api':501,3030,3571 '/claude-api/batches.md':3424,3664 '/claude-api/files-api.md':3434,3682 '/claude-api/readme.md':2674,2824,3329,3340,3353,3389,3400,3422,3432,3574 '/claude-api/streaming.md':3342,3650 '/claude-api/tool-use.md':3403,3629 '/managed-agents/readme.md':863,3108,3463 '/sdk':216 '/v1/agents':2856 '/v1/files':1668,3025 '/v1/messages':1524 '/v1/messages/batches':1665 '/v1/models':1674,1676 '/v1/skills':3023 '0':1271,4154 '000':2469 '1':202,529,1298,3572 '1.00':1744 '10':3731 '1024':2553,2769,3985 '11':3752 '128k':4222,4233 '15.00':1734 '150k':2614 '16000':4182 '1m':1710,1721,1732,2593 '1p':1294 '2':231,624,1313,3585 '20':2468 '200k':1743 '2025':3006 '2026':1691,2475,2974 '25.00':1712,1723 '256':4215 '3':668,1384,3603 '3.00':1733 '3.7':1871 '4':392,718,1405,1708,1719,1730,1741,1751,1772,1777,1834,1840,2761,3627 '4.5':33,1737,1869,2294,2306,2308,2532 '4.6':34,35,1715,1726,2038,2065,2068,2106,2133,2157,2160,2247,2296,2301,2501,2514,2580,2583,3365,3367,3924,3926,3939,3945,3948,3996,4015,4020,4101,4226,4260,4264,4269,4328 '4.7':36,379,1704,1977,1996,2029,2104,2198,2255,2273,2298,2311,2379,2436,2568,2578,3363,3891,3905,3972,4017,4107,4229,4266 '400':1993,2023,3902,4011 '5':751,3648 '5.00':1711,1722,1745 '50':3678 '6':3662 '64000':4194 '7':3680 '8':3696 '9':3720 'a.py':4148 'access':383 'across':1381,2787,3427,3689 'act':2892 'action':491,3032 'ad':3700 'adapt':398,402,1978,1984,1997,2039,2045,2077,2110,2122,2328,2401,2503,2507,2516,2570,3893,3922,3931 'add':187,2256 'advanc':1455 'agent':770,843,879,889,918,957,997,1060,1065,1076,1079,1081,1095,1097,1099,1100,1115,1119,1121,1133,1145,1225,1257,1290,1292,1321,1340,1346,1358,1368,1375,1409,1424,1432,1436,2269,2456,2829,2832,2841,2853,2870,2882,2910,2930,2943,2954,2973,2985,3035,3045,3116,3126,3155,3193,3212,3230,3243,3397,3404,3436,3441,3471,3481,3510,3548,3609,3793,3799 'agent-openai.py':120 'agents.create':893,904,3130,3141,3485,3496 'agnost':874 'ai':215,1221,1280,2925 'along':3912 'alreadi':4431 'also':22,2019,2079 'alway':1746,2101,4288 'amazon':1217,1276,2921 'ambigu':649,4110 'and/or':1629 'annot':800 'anoth':360,2534 'answer':1503 'anth':45 'anthrop':10,103,173,176,205,212,214,910,1082,1141,1317,1585,1591,2844,2887,3147,3502 'anthropic-ai':213 'anthropic-host':1584,2843 'anthropic.message':4378,4415 'anthropic.messageparam':4376,4403 'anthropic.ratelimiterror':4364 'anthropic.tool':4377,4406 'anthropic.toolresultblockparam':4411 'anthropic.tooluseblock':4410 'anti':3714 'anti-pattern':3713 'anyth':404 'anywher':2695 'api':3,9,27,354,666,968,986,1025,1038,1052,1067,1183,1246,1286,1308,1397,1423,1537,1561,1625,1686,1957,2602,2646,2938,2993,3001,3005,3096,3558,3568,3751,3864,4325,4400,4481 'api-refer':3095 'app':12,13 'app.py':4142 'append':485,1825,2624,2664 'appli':2195,3969,4064 'applic':50,61,1269 'approach':1637,2609 'approv':1207 'architectur':1519,2808 'aren':4196 'as-i':1820 'ask':150,184,244,650,1937,2091,2529,3249,3828,3839,4042,4060,4121,4124 'askuserquest':684,697 'assist':4001,4006 'assur':1913 'asynchron':3676 'audit':2815 'auto':2739 'auto-cach':2738 'automat':1195,1608,1646,2080,2603,2981 'avail':1228,2919 'avoid':4246 'awar':2494 'b.py':4150 'back':284,2630,2908 'balanc':2358 'bare':469,4103 'base':68,3313 'basetool':816 'bash':1156,1334,2873,3610 'basic':3779 'batch':1030,1663,3414 'bedrock':1218,1230,1277,2922 'best':2263,2332 'beta':774,776,779,784,786,793,795,796,804,806,813,815,820,828,830,836,2085,2209,2434,2470,2576,2617,2830,2965,2969,3800 'betarunnabletool':831 'betatoolrunn':807 'betazodtool':789 'bind':329,933,3168,3523 'block':2386,2638 'bottom':463 'branch':3062 'break':2034,3279 'breaking-chang':2033 'breakpoint':2734,2762,3710 'budget':1988,2056,2059,2097,2099,2117,2129,2150,2199,2433,2440,2474,2499,2508,2541,2544,2564,3744,3898,3906,3935,3976 'build':4,46,57,1430,3653,4346 'build.gradle':572 'build.gradle.kts':579 'build.sbt':590 'built':14 'byte':2693 'c':614,694,725,821,951,3187,3542,3767 'cach':21,1690,1933,2687,2732,2740,2741,2776,2826,3376,3378,3382,3391,3410,3625,3704,3719,3834 'cacheabl':2766 'call':178,197,903,987,1023,1036,1301,1516,1559,2346,2991,3140,3394,3495,3593,3616,4257,4278 'cap':4165,4217 'capability-filt':1968 'capability/context-window':1679 'capabl':1483,1927,1969 'carv':2148,2191,3965 'carve-out':2147,2190,3964 'case':993,1011,1252,2271 'caught':1494 'ceil':2177,2489 'chang':2035,2408,2694,4326 'chart':4474 'chat':3330,3654 'chatmessag':4422 'check':635,1438 'checklist':2816 'choic':1137,1189 'choos':64,1434,2555 'chunk':3883 'class':296,801,4363 'classif':1016,1302,4214 'classification/summarization/extraction/q':3324 'claud':2,8,26,30,52,63,159,165,192,198,372,377,390,665,1024,1037,1051,1066,1182,1245,1285,1307,1331,1396,1422,1482,1568,1605,1702,1706,1713,1717,1724,1728,1735,1739,1749,1770,1775,1832,1838,2046,2278,2937,3557,3567,4049,4467 'claude-api':1 'claude-haiku':1738 'claude-opus':389,1705,1716,1748 'claude-sonnet':1727,1769,1774,1831,1837 'claude/anthropic':147 'cli':911,3148,3503 'client':3092,3255 'client-pattern':3091 'client.beta':2984 'client.messages.parse':1639 'client.models.list':1960 'client.models.retrieve':1958 'code':28,43,130,149,195,349,519,844,1047,1157,1337,1357,1390,1594,1607,2076,2135,2171,2267,2279,2678,2877,3068,3110,3256,3465,3594,3637,3643,3940,3954,4045,4450 'code-control':1046 'code-orchestr':1389 'codebas':4092 'column':492 'com.anthropic':217 'combin':2326 'come':305 'common':3581,3851 'communiti':737 'compact':2573,2600,2619,2637,2652,2670,2675,3355,3622 'compat':288 'complet':444,1819 'complex':1442 'complic':406 'composer.json':619 'comput':1173,1421,1609 'concept':877,2112 'conceptu':3601 'concern':4199 'condit':1211 'config':1096,1347,1379,1657,2220,2228,2438,2854,3064,4310 'confirm':2351,3272,4034,4086 'consid':4482 'consolid':2344 'constrain':1622 'constraint':1528 'construct':1880 'contain':1125,1150,1329,2867,2895 'content':2381,2711,2721,3861,3867,4425 'context':1697,1941,2594,2606,3349,3408,3619,3875 'continu':1297 'control':924,1048,1206,1402,1573,2211,2733,2742,3161,3516,4030 'conveni':914,3151,3506 'convers':2588,3346 'core':3086 'correct':2366,3277 'cost':1477,1488,1796,2334,2370,3679,4216 'cost-qual':2333 'count':1670 'countdown':2462 'cover':3262,3600,3705,3777,3843 'creat':882,917,2849,3119,3154,3224,3474,3509 'credenti':3295 'criteria':1441 'critic':1805,2623 'cs':612 'csharp':617 'csproj':613 'curl':234,356,733,760,833,861,961,3113,3468,3770 'curl-styl':960 'curl/managed-agents.md':864,3115,3199,3470,3553 'curl/raw':692,729,755 'curl/rest/raw':246 'current':641,954,1688,3190,3545,3750,3832 'custom':1059,1179,1209,3300,4388 'cutoff':1911 'data':1855,1910,3835,4392 'date':1826,1847 'date-suffix':1846 'datetime.now':2796 'debug':5,3724 'decid':1411,2048 'decis':1264,1802 'declar':1601 'decor':781,1546 'dedic':846,3612 'default':222,364,395,410,700,976,2233,2276,2384,2404,2418,2613,4157,4180,4192 'defin':1540,1543,4387,4418 'definit':4409 'deliber':4219 'deploy':1237,1274 'deprec':1654,2062,2121,2511,3941,4315 'depth':2213 'design':1459,3405,3607,3709 'detect':72,516,628,652,722,3306 'determin':521 'determinist':2716 'differ':716,1759,4272 'direct':493,3028 'directori':4056,4069,4135 'disabl':2005 'discoveri':1680 'discuss':3881 'display':2402,3337,3659 'distinct':2478 'doc':1460,2681 'document':83,308,322,335,480,507,3761,3825,3846,4439,4446,4487 'docx':4456,4472 'done':1570 'downgrad':1794 'driven':1008 'duplic':4427 'dynam':2047 'e.g':629,1456,1867,3215,4281 'earlier':2605 'edit':169,3620,4038,4082 'effici':2362 'effort':1973,2182,2205,2221,2312,2338 'either':309 'elixir':726 'embed':1033 'emit':3067 'empti':675,2393 'enabl':1987,2081,2540,2596,3897 'end':1005,1408 'endpoint':1040,1534,1662,3020 'enforc':2485 'entir':4067 'entri':945,3181,3536 'environ':920,2986,3087,3157,3512 'ephemer':2744 'equival':2236,4383 'error':1490,1492,2303,2410,3583,3726,3729,3990,4012,4371 'escap':2164,2186,3958,4275,4287 'etc':218,238,727,3302,3885,4365,4379 'event':455,1127,1349,1371,2901,3089,4356 'everi':475,898,2635,2946,3135,3490,3805 'everyth':1520,2700,4144 'exact':386,1809,1876,4131 'exampl':520,703,708,731,747,757,845,1355,1829,1971,2679,3111,3466,3638 'exceed':2591,3348 'except':4362 'execut':1091,1153,1158,1212,1332,1562,1595,2847,2878,3595,3644,4451 'exist':25,227,740,2170,3953 'expect':1900 'explicit':125,243,307,334,1756,2523,3015,4138 'explor':1009,3061 'export':4396 'extend':2093 'extract':1018,1304,1465,2658 'fall':283 'famili':3998,4262 'featur':193,764,841,1530,3841 'feed':1681 'feel':280 'fetch':236,270,3757 'fewer':2340 'field':1965,4280 'file':90,95,117,157,174,312,339,533,559,634,642,657,679,878,1117,1154,1335,1353,1666,2874,3000,3004,3085,3291,3312,3425,3452,3560,3688,3775,3782,3794,3808,3859,4055,4058,4078,4132,4139,4471,4480 'file-mount':3290 'files-api':3003 'filter':1970 'final':408,437,4253 'finalmessag':439,4255 'find':136 'fine':1204,2757 'fine-grain':1203,2756 'first':2712,2913,3288,3577,4065 'first-parti':2912 'fit':3872 'fix':2115 'flexibl':1071,1427 'flow':499,2942,3238 'folder':3569 'follow':488,3052 'format':1627,1651,1658,4032,4311,4317,4470 'forward':4285 'forward-slash':4284 'foundat':3602 'foundri':1223,1233,1283,2928 'four':1440 'frozen':2713 'full':777,787,1572,2032,2455,2680,2962,3559 'fulli':1452,1597,2202,3909 'function':294,1564,2154,3393,3592,4334 'ga':2207 'gate':1208,3269,3280 'gemfil':607 'general':4324 'generat':4469 'generic.py':122 'genuin':1001 'get':436,442,1673,1675,3219,3822,3993,4252 'give':4201 'go':600,602,605,690,802,856,3101,3456,3765,4206 'go.mod':601 'goe':1521 'googl':1219,1278,2923 'gotcha':3293 'gpt':113,115 'gradual':2145,3950 'gradual-migr':2144 'grain':1205,2758 'guess':291,950,3186,3541 'guid':2964,3076,3304 'guidanc':2809 'haiku':1736,1740,1792,2253,2307 'handl':23,452,990,1197,1558,3584,3730 'hard':1450,2175,4212 'hatch':2165,2187,3959 'header':2086,2210,2471,2618,2966,2970 'help':55 'helper':440,4341 'high':424,2224,2235,2259,2284,2352,4339 'high-level':4338 'higher':1476 'histori':2653 'hit':429,3383,4163 'host':1087,1148,1171,1324,1419,1586,1615,1619,2845,3297 'host-sid':3296 'http':233,247,693,730,756,838,964,3197,3551,3725,4187,4247 'httpx':237 'id':886,890,1677,1696,1811,1877,1959,2726,3123,3127,3478,3482 'idl':3283 'idle/terminated':3278 'immedi':3050 'imper':4087 'implement':166,190,750,3728 'import':44,106,302 'includ':19,481,1253 'incorrect':3837 'increment':3661 'individu':453 'infer':352,535,674 'inform':3833 'infrastructur':1593 'input':420,1698,2781,3856,4279,4291,4303 'insid':2226 'instal':3578,4466 'instead':2518,2572,4033,4312,4344,4352,4366,4380,4490 'instruct':126,4028 'integr':667 'intellig':2288 'intelligence-sensit':2287 'interfac':3657,4384,4421 'interleav':2082 'interrupt':3270 'interview':3054,3074,3236 'invalid':2699,2792,2814,3718 'invok':497,3027 'involv':418 'isn':936,3171,3526 'java':570,573,576,580,584,588,591,595,599,689,791,859,3105,3460,3764 'js':555,562 'json':1551,2801,4258,4273 'json.loads':4293 'json.parse':4294 'jsx':556 'justifi':1475 'k':2017,3918 'keep':128,2709,3294,4183 'know':711,3059 'know-or-explor':3058 'kotlin':581 'kt':577 'kts':578 'lang':311,862,2673,2823,3107,3328,3339,3341,3352,3388,3399,3402,3421,3423,3431,3433,3462 'langchain':110 'languag':75,81,211,256,361,515,523,537,627,637,659,670,682,717,721,762,766,848,867,873,2820,3176,3308,3531,3565,3570,3573,3628,3633,3649,3663,3681,3812 'language-agnost':872 'language-specif':80,761,847,2819,3564,3632,3811 'larg':4244 'last':2731,4005 'last-assistant-turn':4004 'latenc':1479,3418,3673 'latency-sensit':3672 'later':2249 'latest':3759,3824,3830 'layer':2890 'less':2347,2548,3980 'let':495,709 'level':2232,2737,4340 'lighter':281 'like':119,1924,2420,4089 'link':323 'list':324,2036,2718,3804,4059,4140 'liter':1786 'live':1678,1926,2951,3845 'llm':48,59,1022,1035,1300 'llm-power':47,58 'log':1210 'logic':1049 'long':419,421,1110,1365,2422,2586,3344,3870 'long-run':1109,1364,2585,3343 'look':530,1892,2419 'lookup':1928 'loop':1058,1085,1146,1196,1201,1322,1404,1425,1566,1578,2457,2883,3642 'lose':2668,4434 'lossless':3263 'low':2222,2372,3385 'lowbal':4160 'lower':2337,4207 'manag':769,842,956,1074,1080,1098,1120,1132,1224,1256,1291,1339,1343,2828,2831,2839,2909,2972,3034,3044,3192,3211,3242,3409,3435,3439,3547,3792,3798 'managed-ag':2971 'managed-agents-onboard':3033,3241 'mandatori':2941 'mani':1382,2449,3668 'manual':1200,1579,3641 'marker':105 'match':490,508,2691,4299,4370 'matplotlib':4460 'matter':2313,2367 'max':425,2225,2240,2261,2364,2480,2550,2760,3982,4155,4161,4234 'maximum':1070,1426 'may':417,739,2590,3347,4270 'mcp':1130,1352 'md':876,3084,3451,3807 'mean':1903,2339 'medium':2223 'meet':982 'memori':2989,3090,3596,3624,3645 'mental':3056 'mention':2563 'mess':1921 'messag':438,1624,1685,2633,2708,2904,4002,4254,4372,4405 'messages.create':1660,2746,4320 'method':299 'microsoft':1222,1282,2927 'mid':4169 'mid-thought':4168 'might':1851 'migrat':24,2026,2146,2169,2325,3357,3951,4035,4044,4090,4104,4141,4143 'minimum':2282,2467,2552,2765,3984 'mix':262 'mode':2003 'model':31,39,373,387,1007,1410,1672,1689,1694,1695,1760,1782,1810,1862,1889,1917,1951,1956,2143,2447,2491,2520,2536,2558,2948,3057,3361,3372,3738,3741,3975,4050,4203,4307 'model-driven':1006 'moder':2466 'modifi':188 'more-consolid':2342 'mount':1118,1354,3292 'move':4093 'much':2052 'multi':1042,1113,1387,1447 'multi-step':1041,1386,1446 'multi-turn':1112 'multipl':626,3428,3690 'must':196,304,2546,2642,3978 'n':1990,2444,2543,3900 'n/a':834 'name':118,295,297,1757,4052,4129 'namespac':298 'need':71,331,450,714,754,935,984,1270,2058,2087,2173,2755,3013,3170,3318,3525,3591,3788 'negoti':1765 'neutral':133 'never':261,282,290,1793,1836,2554,2955,4295 'new':2075,2132,3229,3938,4358 'newer':3360,3737,4048 'next':2656 'non':102,164,172,1764,3417,4177 'non-anthrop':101,171 'non-claud':163 'non-latency-sensit':3416 'non-negoti':1763 'non-stream':4176 'normal':513 'note':705,735,771,1131,1647,1884,2188,3762,3789,3962 'notifi':3877 'object':1103,4401 'offer':741 'offici':204,259,318,824,3760 'offlin':3670 'often':2354 'old':1649 'older':1861,2142,2519,2535,2557,3974 'omit':2007,2238,2382,2406 'on-mod':2001 'onboard':3036,3094,3244 'one':200,913,1026,1028,1254,1309,1311,1881,3150,3225,3505 'op':1155,1336,2875 'open':1004,1407 'open-end':1003,1406 'openai':107,109,111,112,287 'openai-compat':286 'opt':2396 'optim':7,3377,3702 'option':686,2750,3882 'opus':378,391,1703,1707,1714,1718,1750,1868,1976,1995,2028,2037,2064,2103,2156,2197,2243,2246,2254,2293,2295,2297,2310,2319,2378,2435,2567,2577,2579,3362,3364,3890,3904,3923,3944,3971,4014,4016,4106,4225,4228,4263,4265 'opus-ti':2242 'orchestr':1056,1391,2889 'order':2704,3289 'otherwis':369,1259 'outcom':1474 'output':179,422,1527,1621,1650,1656,1700,2219,2227,2425,2437,3599,3647,4023,4167,4221,4223,4305,4309,4316,4440 'output_config.format':1628,4024 'overal':2215 'p':2015,3916 'package.json':549 'paramet':1631,1652,2012,2206,4318 'pars':4259,4289 'parti':1215,1242,2914,2934 'pass':895,3016,3132,3487,3858 'path':303,908,3145,3500 'pattern':2807,3093,3582,3715,3747 'paus':2423 'pdf':1470,4473 'per':1123,1164,1327,1362,2487,2724,2763 'per-request':2723 'per-respons':2486 'per-sess':1122,1163,1326 'persist':881,1093,1345,1377,2851,3118,3473 'php':618,620,623,695,826,858,3103,3458,3768 'phrase':4088 'pillow':4461 'pin':1105 'pipelin':1044 'pipfil':542 'pitfal':2968,3852 'pkg':810 'placement':2759,2806,3711 'plain':4492 'pleas':375,394,409 'plus':870,3783 'pom.xml':571 'post':1523,1664,1667,2855,3282 'post-idl':3281 'power':49,60 'pptx':4459 'pr':1463 'pre':4465 'pre-instal':4464 'preambl':2348 'prefil':3746,3999,4003,4008 'prefix':2690,2698,2767,2772,3707 'prefix-st':3706 'present':560 'preserv':2644 'prevent':428 'principl':3626 'prior':2318 'proceed':4122 'process':1031,3266,3415,3667 'produc':146,4271,4444 'programmat':3614 'progress':2431 'project':74,99,209,230,249,253,276,532,676,4095 'promis':4359 'prompt':20,97,466,2686,2715,2799,2825,3375,3390,3703,4027,4128 'prose':473,514 'provid':104,132,852,1216,1243,2935,4337,4432 'provider-neutr':131 'provis':2865 'put':2719 'py':538 'pypdf':4463 'pyproject.toml':540 'python':273,543,546,631,654,687,702,707,744,772,854,3099,3454,4455,4458 'python-docx':4454 'python-pptx':4457 'q':1019,1305 'qualiti':2335,2359 'queri':1954 'question':644,2728 'queued/processed':3268 'quick':1974,2574,2688,3319,3579 'race':3285 'rate':3384 'rather':948,3184,3539,3886 'raw':232,837,963,1550,3196,3550,4297 'rb':606 're':2168,2321,3694 're-tun':2320 're-upload':3693 'reach':267,995,3259 'read':77,518,544,552,567,574,586,597,603,609,615,621,758,865,1872,2780,2817,2963,3048,3075,3106,3114,3231,3303,3309,3326,3338,3351,3373,3386,3398,3412,3420,3430,3444,3461,3469,3562,3575,3587,3605,3630,3651,3665,3683,3698,3722,3733,3780 'readm':850,869,941,3177,3532,3814 'real':1916,3334 'real-tim':3333 'reason':2414,4213 'recal':1852 'recommend':1013,1262,1636,2041 'reconnect':3265 'recov':1496 'redefin':4382 'refer':749,884,1966,1975,2575,2689,2861,3097,3121,3202,3321,3476,3556,3561,3795 'reimplement':4332 'relat':645 'releas':1906 'relev':79,342,944,3180,3311,3535 'remot':405 'remov':2020,2203,3910,4000 'render':2703 'repeat':2788 'replac':40,2124,2650,3369,3739 'repo':344 'report':4437,4445,4485 'repositori':320 'request':235,269,368,415,430,460,511,907,965,1027,1310,1687,1859,2524,2657,2725,2764,2789,3144,3429,3499,3669,3691,4179,4191,4489 'requir':180,1002,2616,4172,4239 'requirements.txt':539 'research':1367 'respons':445,1029,1312,1626,1642,2488,2641,3336,3660,4031,4184,4417 'response.content':2625 'rest':1912,3447 'restor':2429 'result':2907,4414 'retir':38,3371,3740 'retired-model':37 'retri':4174 'return':891,1991,3128,3483,3901,4009,4476 'review':1499 'right':66,1136,1188 'role':4423 'rollback':1500 'room':4204 'round':3274 'round-trip':3273 'rubi':608,611,691,811,857,3102,3457,3766 'ruby/java/go/php/c':353 'run':1083,1111,1143,1160,1176,1319,1366,1589,1606,2461,2587,2879,2885,2947,3072,3234,3345,3675 'runner':768,818,1193,1557,3640 'runtim':1181 'rust':723 'safeti':4436 'sampl':2011 'sandbox':1092,4452 'say':1787 'scala':589,592 'scan':87 'schema':1548,1645 'scope':4036,4062 'scratch':3047,3214,4348 'script':3055 'sdk':11,148,177,206,226,260,292,319,343,363,434,566,585,596,825,840,1554,2978,4186,4333,4336,4374,4391,4395,4430 'sdks':738,4238 'search':474 'search/skills':3618 'section':484,2676,2827,3356,3392,3801 'see':1961,2024,2183,2459,2496,2672,2958,3354,3796,3955,4151 'seem':3836 'self':1618,2465 'self-host':1617 'self-moder':2464 'send':2903,3685 'sensit':2289,3419,3674 'separ':1536 'serial':4302 'server':1073,1342,1581,1599,1614,2598,2838,3438 'server-host':1613 'server-manag':1072,1341,2837,3437 'server-sid':1580,1598,2597 'servic':4146 'session':1104,1124,1165,1328,1344,1383,2859,2864,2899,2945,2957,2987,3065 'sessions.create':900,3137,3492 'set':2264,2426,2804,2979,3041,3208,3226,4076 'setup':3066 'setup.py':541 'shape':357 'shared/agent-design.md':3413,3604 'shared/error-codes.md':3721,3786 'shared/live-sources.md':326,346,930,947,2685,3165,3183,3520,3538,3753,3850 'shared/managed-agents-':875,3083,3450,3806 'shared/managed-agents-client-patterns.md':3261 'shared/managed-agents-onboarding.md':3049,3232 'shared/managed-agents-overview.md':2959,3079,3445 'shared/model-migration.md':2025,2184,2497,3374,3732,3961,4152 'shared/models.md':1873,1962 'shared/prompt-caching.md':2818,3387,3697 'shared/tool-use-concepts.md':3401,3586,3784 'shell/curl':252 'shim':289 'short':4220 'shorter':2771 'show':706,743 'shown':938,3173,3528 'side':1582,1600,2599,3298 'signatur':300 'silent':2407,2667,2773,2791,2813,3717,3888 'silent-invalid':2812 'simpl':975,2376 'simpler':1513 'simplest':979,2749 'singl':985,1021,1034,1299,1515,1533,3322,3774 'skill':17,54,145,315,338,1129,1351,2992,2995 'skill-claude-api' 'slash':4286 'sonnet':1725,1729,1771,1776,1789,1833,1839,1870,2067,2159,2251,2300,2305,2500,2513,2531,2582,3366,3925,3947,4019,4100,4268 'sourc':678 'source-anthropics' 'special':1039 'specif':82,498,763,849,2528,2821,3566,3634,3813,4054,4071,4075,4134,4329,4349 'specifi':1453 'spend':2217 'spot':2357 'sse':1126,1348 'stabil':3708 'stabl':2710 'start':86,974,2858,3077,3220,3580,4081 'state':1075,1356,2671,2840,3440 'status':3284 'stay':1510 'stdout':4493 'step':1043,1388,1448,4153 'still':648,2153,2387,4109 'stop':138 'store':887,1102,2990,3124,3479 'strategi':3411 'stream':412,454,1128,1350,1370,2388,2413,2900,3264,3287,4178,4190,4240,4250 'stream-first':3286 'stream.finalmessage':4351 'strict':1633 'string':388,471,1812,1890,2662,4274,4298,4369,4424 'string-match':4368 'structur':1620,3598,3646,4022,4304,4393 'style':962 'subag':2374 'subcommand':456,470,476,3026,3031,3245 'subdirectori':4072 'subsequ':899,3136,3491 'suffix':1827,1848 'suggest':728 'summar':1017,1303,2403,2427,2604,3071,3884 'support':225,765,778,788,958,1661,1684,1947,1952,2502,3194,3546,4230 'surfac':67,970,1014,1263,2836,3407 'sweet':2356 'swift':724 'switch':155,2139 'syntax':2822 'system':2707,2714,2798,2949,4026 'tabl':477,504,1815,1866,1930 'target':89,94 'task':1000,1363,1445,1486,2377,2432,2439,2473,2498,3320,4442 'task-budget':2472 'tell':140,2445,4112 'temperatur':2013,3914 'templat':3063 'terser':2350 'test':1498 'text':2391,2629,2661,3323,4494 'think':399,400,1972,1979,1982,1985,2008,2040,2043,2054,2078,2083,2094,2096,2108,2119,2123,2212,2329,2380,2385,2399,2504,2505,2517,2538,2571,3892,3895,3920,3927,3929 'third':1214,1241,2835,2933 'third-parti':1213,1240,2932 'thought':4170 'threshold':2612 'throw':3988 'tier':980,1012,1437,1514,2244 'time':3335 'timeout':431,4188,4195,4248 'timestamp':2722 'titl':1467 'token':426,1669,1989,2057,2060,2100,2116,2130,2151,2176,2200,2216,2361,2442,2450,2481,2509,2542,2545,2551,2565,2615,2770,2782,3745,3899,3907,3936,3977,3983,4156,4162,4224,4235 'tool':767,780,797,817,1053,1064,1068,1090,1152,1180,1184,1192,1247,1287,1333,1395,1399,1417,1525,1541,1544,1556,1583,1587,1604,1630,2345,2706,2717,2803,2846,2897,2906,2939,2950,3088,3271,3301,3395,3406,3613,3615,3617,3635,3639,4256,4277,4290,4408,4413 'tool-execut':1089 'toolrunn':809,832 'top':2014,2016,2231,2736,3915,3917 'top-level':2230,2735 'topic':3082 'topic-agent-skills' 'total':2443 'tradeoff':2336 'train':1854,1909 'trajectori':1414 'transit':2163,2185,3957 'translat':3743 'treat':509 'tree':1265 'trigger':41,2611 'trip':3275 'true':1634 'truncat':3855,3889,4166 'ts':547,558 'tsconfig.json':550 'tsx':548 'tune':2181,2322 'turn':1114,1457,2636,4007 'two':264 'type':401,1487,1983,1986,2004,2044,2109,2400,2441,2506,2539,2743,3896,3921,3930,4361,4375,4389,4397,4435,4488 'typescript':275,551,554,561,569,633,656,688,746,782,855,3100,3455 'ui':1374,3331,3655 'unavail':699 'unfamiliar':1893 'unicod':4282 'unknown':4426 'unless':365,1753,1783,2394 'unsort':2800 'unsupport':681,720 'updat':4147 'upgrad':3735,4098 'upload':3426,3695 'url':927,3163,3518,3755,3847 'usag':293 'usage.cache':2779 'use':376,397,432,563,582,593,662,683,798,959,973,992,1010,1054,1069,1185,1190,1244,1248,1251,1288,1380,1400,1610,1655,1747,1768,1788,1791,1806,1830,1981,2042,2073,2102,2128,2270,2280,2363,2371,2515,2537,2566,2647,2936,2940,2994,3002,3195,3396,3549,3636,3817,3819,3919,3928,3934,4021,4249,4308,4342,4350,4360,4373,4402 'user':142,183,242,367,459,496,525,639,753,1539,1755,1785,1800,1858,1936,2090,2416,2527,2562,3039,3205,3248,3317,3590,3827,3838,3879,4041,4085 'user-defin':1538 'valid':1632,1641 'valu':1471,4242 'vari':2727,2802 'variant':1849 'vault':2988 've':2180 'verifi':2777 'version':32,374,923,1094,1108,1378,2852,3160,3515 'version-control':922,3159,3514 'vertex':1220,1231,1279,2924 'via':384,500,1545,2218,2682,2896,3299,4478 'viabil':1480 'visibl':2430 'vision/thinking/effort':1948 'visual':4448 'volatil':2720 'vs':1464,3611,3621,3623 'walk':3037,3221 'want':153,161,1140,1169,1316,3206 'way':915,3152,3507 'webfetch':340,942,2683,3178,3533,3754,3818,3820 'whenev':223 'whether':151 'window':1942,2595,3350,3876 'without':3692,4051,4123 'won':2774 'work':527,2010,2290,2291,2795,4068 'workflow':989,1050,1385,1518 'workspac':1078,1166,1361,2872,3443 'would':1258 'wouldn':1919 'wrap':4354 'write':348,1576,3253 'wrong':3995 'x':1944,1946,3258,4097 'xhigh':2257 'y':1953 'yaml':925,3162,3517 'yes':773,775,783,785,792,794,803,805,812,814,827,829,835,1284,1338 'zero':2786 'zod':790,1547","prices":[{"id":"8f1250a2-f224-4f2f-b5d2-9d4337c901a3","listingId":"0943cd45-8c19-4366-8081-22f6bdf68d7c","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"anthropics","category":"skills","install_from":"skills.sh"},"createdAt":"2026-04-18T20:24:34.376Z"}],"sources":[{"listingId":"0943cd45-8c19-4366-8081-22f6bdf68d7c","source":"github","sourceId":"anthropics/skills/claude-api","sourceUrl":"https://github.com/anthropics/skills/tree/main/skills/claude-api","isPrimary":false,"firstSeenAt":"2026-04-18T21:24:23.638Z","lastSeenAt":"2026-04-24T00:50:10.295Z"},{"listingId":"0943cd45-8c19-4366-8081-22f6bdf68d7c","source":"skills_sh","sourceId":"anthropics/skills/claude-api","sourceUrl":"https://skills.sh/anthropics/skills/claude-api","isPrimary":true,"firstSeenAt":"2026-04-18T20:24:34.376Z","lastSeenAt":"2026-04-24T00:40:10.945Z"}],"details":{"listingId":"0943cd45-8c19-4366-8081-22f6bdf68d7c","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"anthropics","slug":"claude-api","github":{"repo":"anthropics/skills","stars":122919,"topics":["agent-skills"],"license":null,"html_url":"https://github.com/anthropics/skills","pushed_at":"2026-04-23T17:07:20Z","description":"Public repository for Agent Skills","skill_md_sha":"ebff1c7961e1898f58cfc7d9147e7cae51850b2f","skill_md_path":"skills/claude-api/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/anthropics/skills/tree/main/skills/claude-api"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"claude-api","license":"Complete terms in LICENSE.txt","description":"Build, debug, and optimize Claude API / Anthropic SDK apps. Apps built with this skill should include prompt caching. Also handles migrating existing Claude API code between Claude model versions (4.5 → 4.6, 4.6 → 4.7, retired-model replacements). TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`; user asks for the Claude API, Anthropic SDK, or Managed Agents; user adds/modifies/tunes a Claude feature (caching, thinking, compaction, tool use, batch, files, citations, memory) or model (Opus/Sonnet/Haiku) in a file; questions about prompt caching / cache hit rate in an Anthropic SDK project. SKIP: file imports `openai`/other-provider SDK, filename like `*-openai.py`/`*-generic.py`, provider-neutral code, general programming/ML."},"skills_sh_url":"https://skills.sh/anthropics/skills/claude-api"},"updatedAt":"2026-04-24T00:50:10.295Z"}}