clade-cost-tuning

Featured

Optimize Anthropic API costs — model selection, prompt caching, batches, Use when working with cost-tuning patterns. token reduction, and usage monitoring. Trigger with "anthropic pricing", "claude cost", "reduce anthropic spend", "anthropic billing", "claude cheaper".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/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

# Anthropic Cost Tuning ## Overview Anthropic charges per token. Input tokens, output tokens, and cached tokens each have different prices. Here's how to minimize cost without losing quality. ## Pricing (per million tokens) | Model | Input | Output | Cached Input | Batch Input | Batch Output | |-------|-------|--------|-------------|-------------|--------------| | Claude Opus 4 | $15.00 | $75.00 | $1.50 | $7.50 | $37.50 | | Claude Sonnet 4 | $3.00 | $15.00 | $0.30 | $1.50 | $7.50 | | Claude Haiku 4.5 | $0.80 | $4.00 | $0.08 | $0.40 | $2.00 | ## Cost Reduction Strategies ## Instructions ### Step 1: Right-Size Your Model ```typescript // DON'T use Opus for everything // DO match model to task complexity: // Simple classification/extraction → Haiku (cheapest) const category = await classify(text, 'claude-haiku-4-5-20251001'); // General coding/writing → Sonnet (balanced) const code = await generate(spec, 'claude-sonnet-4-20250514'); // Complex multi-step reasoning → Opus (best quality) const analysis = await analyze(data, 'claude-opus-4-20250514'); ``` ### Step 2: Prompt Caching (90% off input tokens) ```typescript // Cache your system prompt — pays for itself after 2 calls const message = await client.messages.create({ model: 'claude-sonnet-4-20250514', max_tokens: 1024, system: [{ type: 'text', text: longSystemPrompt, // Must be 1024+ tokens cache_control: { type: 'ephemeral' }, // Cache for 5 minutes }], messages, }, { headers: { 'claude-beta...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

anth-cost-tuning

Optimize Anthropic Claude API costs with model routing, prompt caching, batching, and spend monitoring. Use when analyzing Claude API billing, reducing costs, or implementing cost controls and budget alerts. Trigger with phrases like "anthropic cost", "claude billing", "reduce claude spend", "anthropic budget", "claude pricing optimize".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-performance-tuning

Optimize Claude API performance with prompt caching, model selection, streaming, and latency reduction techniques. Use when experiencing slow responses, optimizing token usage, or reducing time-to-first-token in production. Trigger with phrases like "anthropic performance", "claude speed", "optimize claude latency", "anthropic caching", "faster claude responses".

2,266 Updated today
jeremylongshore
AI & Automation Featured

clade-performance-tuning

Optimize Anthropic API latency — streaming, prompt caching, model selection, Use when working with performance-tuning patterns. connection reuse, and parallel requests. Trigger with "anthropic slow", "claude latency", "speed up anthropic", "anthropic performance", "claude response time".

2,266 Updated today
jeremylongshore
AI & Automation Featured

langchain-cost-tuning

Optimize LangChain API costs with token tracking, model tiering, caching, prompt compression, and budget enforcement. Trigger: "langchain cost", "langchain tokens", "reduce langchain cost", "langchain billing", "langchain budget", "token optimization".

2,266 Updated today
jeremylongshore
AI & Automation Featured

cohere-cost-tuning

Optimize Cohere costs through model selection, token budgets, and usage monitoring. Use when analyzing Cohere billing, reducing API costs, or implementing usage monitoring and budget alerts. Trigger with phrases like "cohere cost", "cohere billing", "reduce cohere costs", "cohere pricing", "cohere expensive", "cohere budget".

2,266 Updated today
jeremylongshore