claude-api

Solid

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

AI & Automation 201,447 stars 30903 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 96/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Claude API 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 ```bash pip install anthropic ``` ### Basic Message ```python import anthropic client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY from env message = 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 ```python 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: pr...

Details

Author
affaan-m
Repository
affaan-m/everything-claude-code
Created
4 months ago
Last Updated
yesterday
Language
JavaScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

0 Updated today
CodeWithBehnam
AI & Automation Listed

claude

Call the Claude API (claude-opus, claude-sonnet, claude-haiku) through RunAPI using the official Anthropic SDK or any Anthropic-compatible client. Use when the user asks for Claude / Anthropic chat, streaming messages, multimodal vision input, tool use, extended thinking, or token counting, or when they want to point an existing Anthropic SDK setup at RunAPI as the base URL.

0 Updated today
runapi-ai
AI & Automation Featured

clade-model-inference

Stream Claude responses, use system prompts, handle multi-turn conversations, Use when working with model-inference patterns. and process structured output with the Messages API. Trigger with "anthropic streaming", "claude messages api", "claude inference", "stream claude response".

2,274 Updated today
jeremylongshore
AI & Automation Featured

anth-hello-world

Create a minimal working Anthropic Claude Messages API example. Use when starting a new Claude integration, testing your setup, or learning basic Messages API patterns for text, vision, and streaming. Trigger with phrases like "anthropic hello world", "claude api example", "anthropic quick start", "simple claude code", "first messages api call".

2,274 Updated today
jeremylongshore
AI & Automation Listed

claude-api

Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.

1 Updated 1 weeks ago
DROOdotFOO