claude-apilisted
Install: claude install-skill Claudient/Claudient
# Claude API Skill
## When to activate
- Writing code that calls the Anthropic Claude API (Python or TypeScript SDK)
- Implementing prompt caching, streaming, or batch processing
- Designing multi-turn conversation management
- Selecting the right Claude model (Haiku, Sonnet, Opus) for a task
- Adding tool use / function calling to a Claude integration
- Optimizing for cost or latency in a production Claude app
## When NOT to use
- OpenAI or other provider APIs — different SDK, different patterns
- Generic LLM advice unrelated to the Anthropic API
- Projects already using LangChain or LlamaIndex abstractions — address the abstraction layer instead
## Instructions
### Model selection guide
| Model | Use when | Avoid when |
|-------|----------|------------|
| `claude-haiku-4-5-20251001` | Classification, extraction, routing, simple Q&A, high-volume low-cost | Complex reasoning, multi-step code generation |
| `claude-sonnet-4-6` | General-purpose: code, analysis, writing, agentic workflows | Token-constrained budgets at massive scale |
| `claude-opus-4-7` | Expert-level reasoning, nuanced judgment, complex long-form | Most tasks — usually Sonnet is sufficient |
### Basic message call (Python)
```python
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY from env
message = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
system="You are a helpful assistant specialized in Python.",
messages=[
{"role": "user",