Confirm successful installation by checking the skill directory location:
.cursor/skills/claude-api
Restart Cursor to activate claude-api. Access via /claude-api in your agent's command palette.
โ
Security Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Build applications with the Anthropic Claude API and SDKs.
When to Activate
Building applications that call the Claude API
Code imports anthropic (Python) or @anthropic-ai/sdk (TypeScript)
User asks about Claude API patterns, tool use, streaming, or vision
Implementing agent workflows with Claude Agent SDK
Optimizing API costs, token usage, or latency
Model Selection
Model
ID
Best For
Opus 4.1
claude-opus-4-1
Complex reasoning, architecture, research
Sonnet 4
claude-sonnet-4-0
Balanced coding, most development tasks
Haiku 3.5
claude-3-5-haiku-latest
Fast responses, high-volume, cost-sensitive
Default to Sonnet 4 unless the task requires deep reasoning (Opus) or speed/cost optimization (Haiku). For production, prefer pinned snapshot IDs over aliases.
Python SDK
Installation
pip install anthropic
Basic Message
import anthropic
client = anthropic.Anthropic()# reads ANTHROPIC_API_KEY from envmessage = client.messages.create( model="claude-sonnet-4-0", max_tokens=1024, messages=[{"role":"user","content":"Explain async/await in Python"}])print(message.content[0].text)
Streaming
with client.messages.stream( model="claude-sonnet-4-0", max_tokens=1024, messages=[{"role":"user","content":"Write a haiku about coding"}])as stream:for text in stream.text_stream:print(text, end="", flush=True)
System Prompt
message = client.messages.create( model="claude-sonnet-4-0", max_tokens=1024, system="You are a senior Python developer. Be concise.", messages=[{"role":"user","content":"Review this function"}])
TypeScript SDK
Installation
npminstall @anthropic-ai/sdk
Basic Message
import Anthropic from"@anthropic-ai/sdk";const client =newAnthropic();// reads ANTHROPIC_API_KEY from envconst message =await client.messages.create({ model:"claude-sonnet-4-0", max_tokens:1024, messages:[{ role:"user", content:"Explain async/await in TypeScript"}],});console.log(message.content[0].text);
Streaming
const stream = client.messages.stream({ model:"claude-sonnet-4-0", max_tokens:1024, messages:[{ role:"user", content:"Write a haiku"}],});forawait(const event of stream){if(event.type ==="content_block_delta"&& event.delta.type ==="text_delta"){ process.stdout.write(event.delta.text);}}
Tool Use
Define tools and let Claude call them:
tools =[{"name":"get_weather","description":"Get current weather for a location","input_schema":{"type":"object","properties":{"location":{"type":"string","description":"City name"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}]message = client.messages.create( model="claude-sonnet-4-0", max_tokens=1024, tools=tools, messages=[{"role":"user","content":"What's the weather in SF?"}])# Handle tool use responsefor block in message.content:if block.type=="tool_use":# Execute the tool with block.input result = get_weather(**block.input)# Send result back follow_up = client.messages.create( model="claude-sonnet-4-0", max_tokens=1024, tools=tools, messages=[{"role":"user","content":"What's the weather in SF?"},{"role":"assistant","content": message.content},{"role":"user","content":[{"type":"tool_result","tool_use_id": block.id,"content":str(result)}]}])
โบClaude Desktop or compatible AI client with skill support
โบClear understanding of task or problem to solve
โบWillingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Steps
1Install skill using provided installation command
2Test with simple use case relevant to your work
3Evaluate output quality and relevance
4Iterate on prompts to improve results
5Integrate into regular workflow if valuable
Common Pitfalls
โ Expecting perfect results without iteration
โ Not providing enough context in prompts
โ Using skill for tasks outside its intended scope
โ Accepting outputs without review and validation
Best Practices
โ Do
+Start with clear, specific prompts
+Provide relevant context and constraints
+Review and refine all outputs before using
+Iterate to improve output quality
+Document successful prompt patterns
โ Don't
โDon't use without understanding skill limitations
โDon't skip validation of outputs
โDon't share sensitive information in prompts
โDon't expect skill to replace human judgment
๐ก Pro Tips
โ Be specific about desired format and style
โ Ask for multiple options to choose from
โ Request explanations to understand reasoning
โ Combine AI efficiency with human expertise
When to Use This
โ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
โ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path
1Familiarize yourself with skill capabilities and limitations
2Start with low-risk, non-critical tasks
3Progress to more complex and valuable use cases
4Build expertise through regular use and experimentation