claude-api

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

2|Updated May 30, 2026
One-click install
npx skills add https://github.com/virahitvin8/crafty-gis --skill claude-api-virahitvin8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-api
Source: https://github.com/virahitvin8/crafty-gis/tree/main/GIT_STAR/assignment-generator/antigravity-skills-main/antigravity-skills-main/skills/claude-api
Command: npx skills add https://github.com/virahitvin8/crafty-gis --skill claude-api-virahitvin8

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct Claude API and Anthropic SDK code requires knowing current model IDs, SDK bindings across eight languages, beta headers, and breaking changes between model versions — details that are easy to get wrong from memory. ## Core Features & Use Cases - Multi-language SDK guidance: Language detection routes to dedicated references for Python, TypeScript, Java, Go, Ruby, C#, PHP, and cURL, covering streaming, tool use, prompt caching, structured outputs, batches, and the Files API. - Model migration and feature configuration: Handles upgrades between Claude model versions (e.g., 4.5 to 4.7), adaptive thinking, effort levels, compaction, and prompt caching optimization with silent-invalidator diagnostics. - Managed Agents support: Provides onboarding flows and client patterns for server-managed stateful agents with Anthropic-hosted tool execution. - 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 emits correct cache_control placement code. ## Quick Start Ask the assistant to add prompt caching to your Anthropic SDK project or 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 in the response.

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

Update the model ID to the exact string from the current models table, replace budget_tokens thinking with adaptive thinking, and remove assistant prefills which return 400 on Opus 4.6, 4.7, and Sonnet 4.6. The shared model-migration reference lists all breaking changes.

Which languages does the Anthropic SDK support?

Official SDKs exist for Python, TypeScript, Java, Go, Ruby, C#, and PHP, with cURL/raw HTTP as a fallback. Tool runner and Managed Agents beta support varies by language; C# lacks Managed Agents support.

Why is my prompt cache hit rate zero?

A silent invalidator breaks the prefix match, such as timestamps in the system prompt, unsorted JSON, or a varying tool set. Any byte change in the prefix invalidates everything after it, and prefixes under roughly 1024 tokens never cache.

Can I use Managed Agents on Amazon Bedrock or Vertex AI?

No. Managed Agents is first-party only and unavailable on Bedrock, Vertex AI, or Microsoft Foundry. On third-party providers, use the Claude API with tool use for all agent workloads.