claude-api

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

Updated Sep 5, 2025
One-click install
npx skills add https://github.com/MrS-E/config --skill claude-api-mrs-e
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-api
Source: https://github.com/MrS-E/config/tree/main/junie/versions/1588.20/skills/claude-api
Command: npx skills add https://github.com/MrS-E/config --skill claude-api-mrs-e

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, beta headers, and features like prompt caching, tool use, streaming, and Managed Agents, which are easy to get wrong from memory alone. ## Core Features & Use Cases - Multi-language SDK guidance: Provides verified code patterns for Python, TypeScript, Java, Go, Ruby, C#, PHP, and raw cURL, with automatic language detection from project files. - Feature implementation: Covers tool use, streaming, structured outputs, prompt caching, compaction, adaptive thinking, batch processing, and the Files API with correct current model IDs. - Managed Agents support: Guides setup of server-managed stateful agents with sessions, environments, and workspaces, including an onboarding interview flow. - Use Case: A developer adding tool use to a TypeScript app gets correct @anthropic-ai/sdk code with the right model string, streaming helpers, and cache breakpoints instead of hallucinated API shapes. ## Quick Start Ask the assistant to add a Claude API call with tool use and prompt caching to your project file.

Frequently Asked Questions about claude-api

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

FAQPage Schema
How do I add tool use to a Claude API application?

Define tools with the SDK's tool runner (decorators, Zod schemas, or annotated classes) for automatic loop handling, or write a manual loop checking stop_reason for tool_use and returning tool_result blocks. Language-specific examples exist for Python, TypeScript, Java, Go, Ruby, and PHP.

Which Claude model should I use with the Anthropic SDK?

Default to claude-opus-4-6 with adaptive thinking (thinking: {type: "adaptive"}). Use the exact model ID strings without date suffixes, and only switch to Sonnet or Haiku when the user explicitly requests them.

Does the Anthropic SDK support streaming responses?

Yes, all official SDKs support streaming, and it is recommended for long outputs or high max_tokens to avoid HTTP timeouts. Use the SDK's get_final_message() or finalMessage() helper to accumulate the complete response.

Why is my prompt caching not hitting the cache?

Cache misses usually come from silent invalidators like timestamps in the system prompt, unsorted JSON, or changing tool lists, since caching requires an exact byte-stable prefix. Verify hits via usage.cache_read_input_tokens and keep volatile content after the last cache_control breakpoint.

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.

When should I use raw HTTP instead of the Anthropic SDK?

Use raw HTTP only when the user explicitly asks for cURL/REST, the project is shell-based, or no official SDK exists for the language. Never mix raw HTTP with SDK calls in a language that has an official SDK.