Skip to content
/claude-apiOfficial

Build apps with the Claude API or Anthropic SDK. Triggers when code imports anthropic/@anthropic-ai/sdk/claude_agent_sdk, or user asks to use Claude API, Anthropic SDKs, or Agent SDK.

APISDKDevelopmentAIPythonTypeScriptΒ· 2 min read

Quick import: Download the .md file and save it to .claude/commands/ (Claude Code), .cursorrules (Cursor), or paste as a system prompt in ChatGPT, Gemini, or any LLM API.

#What it does

The Claude API skill provides comprehensive guidance for building LLM-powered applications with Claude. It covers the full Claude API surface -- from single API calls to agentic workflows -- across Python, TypeScript, Java, Go, Ruby, C#, PHP, and cURL. It includes up-to-date model information, SDK patterns, and best practices.

#How to use

The skill activates when your code imports anthropic, @anthropic-ai/sdk, or claude_agent_sdk, or when you ask about using the Claude API, Anthropic SDKs, or Agent SDK.

Build a chatbot using the Claude API in Python
How do I use tool use with the Anthropic TypeScript SDK?

#Skill instructions

#Surface Selection

Choose the right integration tier based on your needs:

| Use Case | Recommended Surface | |----------|-------------------| | Classification, summarization, Q&A | Claude API (single call) | | Multi-step pipelines with code-controlled logic | Claude API + tool use | | Custom agent with your own tools | Claude API + tool use (agentic loop) | | Agent with file/web/terminal access | Agent SDK |

#Language Detection

The skill auto-detects your project language from file extensions and config files, then provides language-specific code examples and SDK patterns.

#Key Features Covered

  • Adaptive thinking: Recommended for Opus 4.6 and Sonnet 4.6 (thinking: {type: "adaptive"})
  • Streaming: For chat UIs and long responses
  • Tool use: Function calling with tool runner or manual loop
  • Batch processing: Async processing at 50% cost
  • Files API: Upload once, use across multiple requests
  • Agent SDK: Built-in file/web/terminal tools with permissions and MCP support
  • Compaction: Server-side context summarization for long conversations
  • Structured outputs: Schema-validated responses via output_config

#Current Models

| Model | ID | Context | |-------|-----|---------| | Claude Opus 4.6 | claude-opus-4-6 | 200K (1M beta) | | Claude Sonnet 4.6 | claude-sonnet-4-6 | 200K (1M beta) | | Claude Haiku 4.5 | claude-haiku-4-5 | 200K |

Default: Always use claude-opus-4-6 unless the user explicitly names a different model.

This skill is from the Anthropic Skills Repository.

AnthropicΒ·
View all skills