claude-api

Build, debug, and migrate applications using the Claude API and Anthropic SDKs.

Updated May 17, 2026
One-click install
npx skills add https://github.com/irrit-us/agent_misc --skill claude-api-irrit-us
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: claude-api
Source: https://github.com/irrit-us/agent_misc/tree/main/skills/claude-api
Command: npx skills add https://github.com/irrit-us/agent_misc --skill claude-api-irrit-us

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct Claude API and Anthropic SDK code requires up-to-date knowledge of model IDs, SDK bindings across eight languages, beta headers, and features like prompt caching, adaptive thinking, compaction, and Managed Agents — details that change faster than model training data and are easy to get wrong. ## Core Features & Use Cases - Multi-language SDK guidance: Language detection routes to accurate code examples for Python, TypeScript, Java, Go, Ruby, C#, PHP, and cURL, with verified SDK signatures rather than guessed APIs. - Feature implementation: Covers streaming, tool use and tool runners, structured outputs, prompt caching, compaction, batch processing, Files API, and server-side tools with correct parameters and beta headers. - Model migration: Handles upgrades between Claude model versions (e.g., 4.6 to 4.8), retired-model replacements, and translation of deprecated patterns like budget_tokens and prefills. - Use Case: A developer asks to add prompt caching to an existing Python Anthropic SDK project; the skill detects the language, reads the caching reference, and produces code with correct cache_control breakpoints and usage verification. ## Quick Start Ask the assistant to add prompt caching to your Anthropic SDK project or to migrate your Claude API code to the latest model version.

Frequently Asked Questions about claude-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add prompt caching to the Anthropic SDK?▼

Set cache_control with type ephemeral on the last block of your system prompt or use top-level auto-caching on messages.create. Keep stable content first in the prefix and verify hits via usage.cache_read_input_tokens; zero reads across repeated requests indicates a silent invalidator.

How do I migrate Claude API code to a newer model version?▼

Use the exact model ID strings from the current models table, such as claude-opus-4-8, without date suffixes. Replace deprecated budget_tokens with adaptive thinking and remove assistant prefills, which return 400 errors on Opus 4.6 and later.

Which languages does the Anthropic SDK support for tool use?▼

Python, TypeScript, Java, Go, Ruby, and PHP support beta tool runners with automatic loop handling. C# supports tool use through the Messages API with raw JSON schema definitions but has no class-annotation-based tool runner.

Does Managed Agents work on Amazon Bedrock or Google Vertex AI?▼

No, Managed Agents is first-party only and unavailable on Bedrock, Vertex AI, or Microsoft Foundry. For agents on third-party providers, use the Claude API with tool use and run the agent loop yourself.

Why does extended thinking with budget_tokens return a 400 error?▼

Opus 4.7 and 4.8 removed budget_tokens entirely along with temperature, top_p, and top_k; only adaptive thinking is accepted. On Opus 4.6 and Sonnet 4.6 budget_tokens is deprecated but still functional as a transitional escape hatch.