claude-api

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

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

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, thinking parameters, prompt caching, tool use, and Managed Agents — details that change between model versions and are easy to get wrong from memory. ## Core Features & Use Cases - Multi-language SDK guidance: Detects the project language (Python, TypeScript, Java, Go, Ruby, C#, PHP, cURL) and routes to language-specific reference files with correct SDK bindings. - Feature implementation: Covers prompt caching, adaptive thinking, effort levels, compaction, streaming, tool use, structured outputs, batches, and the Files API with current model IDs and pricing. - Model migration: Handles upgrades between Claude model versions (e.g., 4.6 to 4.8) and retired-model replacements, including breaking changes like removed budget_tokens and prefills. - Use Case: A developer asks to add prompt caching to an existing Python Anthropic SDK app; the skill detects Python, reads the caching reference, and emits code with correct cache_control breakpoints and verification via usage.cache_read_input_tokens. ## Quick Start Ask the agent to add prompt caching to your Anthropic SDK application 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?

Add cache_control breakpoints with type ephemeral on stable prefix content, keeping tools and system prompts before volatile message content. Verify hits by checking usage.cache_read_input_tokens; zero across repeated requests indicates a silent invalidator like timestamps in the system prompt.

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

Confirm the migration scope first, then update the model ID to an exact string like claude-opus-4-8 without date suffixes. Replace budget_tokens with adaptive thinking, remove assistant prefills and sampling parameters, and re-tune the effort parameter for Opus 4.7 and 4.8.

Which Claude model should I use for my application?

Default to claude-opus-4-8 unless the user explicitly names another model. Use the Models API (client.models.retrieve or list) for live capability and context-window lookups rather than relying on cached tables.

Does the Anthropic SDK support tool use in Go and Ruby?

Yes, tool runners are available in beta for Go via BetaToolRunner in the toolrunner package and for Ruby via BaseTool plus tool_runner. Python, TypeScript, Java, and PHP also have beta tool runner support; C# does not.

Can I use Managed Agents on Amazon Bedrock or Google 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, hosting the tool execution yourself.

Why does my Claude API request return a 400 error with thinking enabled?

On Opus 4.7 and 4.8, thinking with type enabled and budget_tokens returns 400 because only adaptive thinking is supported, and temperature, top_p, and top_k are also removed. Use thinking type adaptive and control depth via the effort parameter in output_config.