[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78WZFWEJPDAR60PVKZQQF8X":3,"skill-same:01M78WZFWEJPDAR60PVKZQQF8X":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":39,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M78WZFWEJPDAR60PVKZQQF8X","anth-cost-tuning",null,"Optimize Anthropic Claude API costs with model routing, prompt caching,\nbatching, and spend monitoring.\nUse when analyzing Claude API billing, reducing costs,\nor implementing cost controls and budget alerts.\nTrigger with phrases like \"anthropic cost\", \"claude billing\",\n\"reduce claude spend\", \"anthropic budget\", \"claude pricing optimize\".","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--anthropic-pack--anth-cost-tuning\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: anth-cost-tuning\ndescription: |\n  Optimize Anthropic Claude API costs with model routing, prompt caching,\n  batching, and spend monitoring.\n  Use when analyzing Claude API billing, reducing costs,\n  or implementing cost controls and budget alerts.\n  Trigger with phrases like \"anthropic cost\", \"claude billing\",\n  \"reduce claude spend\", \"anthropic budget\", \"claude pricing optimize\".\nallowed-tools: Read, Write, Edit, Grep\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ntags: [saas, ai, anthropic]\ncompatible-with: claude-code\n---\n\n# Anthropic Cost Tuning\n\n## Overview\n\nOptimize Claude API spend through model routing, prompt caching, the Message Batches API, and real-time cost tracking. The four biggest levers: model selection (4-19x), prompt caching (10x input), batches (2x), and `max_tokens` discipline.\n\n## Pricing Reference (per million tokens)\n\n| Model | Input | Output | Cache Read | Cache Write |\n|-------|-------|--------|------------|-------------|\n| Claude Haiku | $0.80 | $4.00 | $0.08 | $1.00 |\n| Claude Sonnet | $3.00 | $15.00 | $0.30 | $3.75 |\n| Claude Opus | $15.00 | $75.00 | $1.50 | $18.75 |\n\n**Message Batches:** 50% off all model pricing for async processing.\n\n## Cost Calculator\n\n```python\ndef estimate_cost(\n    input_tokens: int,\n    output_tokens: int,\n    model: str = \"claude-sonnet-4-20250514\",\n    cached_input: int = 0,\n    use_batch: bool = False\n) -> float:\n    pricing = {\n        \"claude-haiku-4-20250514\": {\"input\": 0.80, \"output\": 4.00, \"cache_read\": 0.08},\n        \"claude-sonnet-4-20250514\": {\"input\": 3.00, \"output\": 15.00, \"cache_read\": 0.30},\n        \"claude-opus-4-20250514\": {\"input\": 15.00, \"output\": 75.00, \"cache_read\": 1.50},\n    }\n    rates = pricing[model]\n    uncached_input = input_tokens - cached_input\n\n    cost = (\n        uncached_input * rates[\"input\"] +\n        cached_input * rates[\"cache_read\"] +\n        output_tokens * rates[\"output\"]\n    ) \u002F 1_000_000\n\n    if use_batch:\n        cost *= 0.5\n\n    return cost\n\n# Example: 10K requests\u002Fday, 500 input + 200 output tokens each\ndaily = estimate_cost(500, 200, \"claude-sonnet-4-20250514\") * 10_000\nprint(f\"Daily: ${daily:.2f}\")      # ~$0.045 * 10K = $450\u002Fday\nprint(f\"Monthly: ${daily * 30:.2f}\")  # ~$13,500\u002Fmonth\n\n# Same with Haiku + batching\ndaily_optimized = estimate_cost(500, 200, \"claude-haiku-4-20250514\", use_batch=True) * 10_000\nprint(f\"Optimized: ${daily_optimized:.2f}\u002Fday\")  # ~$22\u002Fday (20x cheaper)\n```\n\n## Strategy 1: Model Routing\n\n```python\ndef route_to_model(task: str, complexity: str) -> str:\n    \"\"\"Route tasks to cheapest adequate model.\"\"\"\n    # Haiku: classification, extraction, yes\u002Fno, routing ($0.80\u002F$4)\n    if task in (\"classify\", \"extract\", \"route\", \"validate\"):\n        return \"claude-haiku-4-20250514\"\n\n    # Sonnet: general tasks, code, tool use ($3\u002F$15)\n    if complexity in (\"low\", \"medium\"):\n        return \"claude-sonnet-4-20250514\"\n\n    # Opus: only for complex reasoning, research ($15\u002F$75)\n    return \"claude-opus-4-20250514\"\n```\n\n## Strategy 2: Prompt Caching\n\n```python\n# Cache system prompts and reference documents (90% input savings)\n# Break-even: 2 requests with same cached content\nmessage = client.messages.create(\n    model=\"claude-sonnet-4-20250514\",\n    max_tokens=256,\n    system=[{\n        \"type\": \"text\",\n        \"text\": large_reference_document,  # 10K+ tokens\n        \"cache_control\": {\"type\": \"ephemeral\"}\n    }],\n    messages=[{\"role\": \"user\", \"content\": user_question}]\n)\n```\n\n## Strategy 3: Batches for Non-Real-Time\n\n```python\n# 50% cost reduction for anything that doesn't need immediate response\n# Ideal for: summarization pipelines, data extraction, content generation\nbatch = client.messages.batches.create(requests=[...])  # Up to 100K requests\n```\n\n## Strategy 4: Spend Tracking\n\n```python\nimport anthropic\nfrom dataclasses import dataclass, field\n\n@dataclass\nclass SpendTracker:\n    budget_usd: float = 100.0\n    spent_usd: float = 0.0\n    requests: int = 0\n\n    def track(self, response):\n        cost = estimate_cost(\n            response.usage.input_tokens,\n            response.usage.output_tokens,\n            response.model,\n            getattr(response.usage, \"cache_read_input_tokens\", 0)\n        )\n        self.spent_usd += cost\n        self.requests += 1\n\n        if self.spent_usd > self.budget_usd * 0.8:\n            print(f\"WARNING: 80% budget used (${self.spent_usd:.2f}\u002F${self.budget_usd})\")\n        if self.spent_usd > self.budget_usd:\n            raise RuntimeError(f\"Budget exceeded: ${self.spent_usd:.2f}\")\n\ntracker = SpendTracker(budget_usd=50.0)\n```\n\n## Cost Reduction Checklist\n\n- [ ] Use Haiku for classification\u002Fextraction\u002Frouting tasks\n- [ ] Enable prompt caching for repeated system prompts\n- [ ] Use Message Batches for non-real-time processing\n- [ ] Set `max_tokens` to realistic values (not maximum)\n- [ ] Use prefill to reduce output preamble tokens\n- [ ] Implement spend tracking and budget alerts\n- [ ] Monitor via [Usage API](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fapi\u002Fusage-cost-api)\n\n## Resources\n\n- [Pricing](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fabout-claude\u002Fpricing)\n- [Prompt Caching](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fbuild-with-claude\u002Fprompt-caching)\n- [Usage & Cost API](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fapi\u002Fusage-cost-api)\n- [Message Batches](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fapi\u002Fcreating-message-batches)\n\n## Next Steps\n\nFor architecture patterns, see `anth-reference-architecture`.\n","# Anthropic Cost Tuning\n\n## Overview\n\nOptimize Claude API spend through model routing, prompt caching, the Message Batches API, and real-time cost tracking. The four biggest levers: model selection (4-19x), prompt caching (10x input), batches (2x), and `max_tokens` discipline.\n\n## Pricing Reference (per million tokens)\n\n| Model | Input | Output | Cache Read | Cache Write |\n|-------|-------|--------|------------|-------------|\n| Claude Haiku | $0.80 | $4.00 | $0.08 | $1.00 |\n| Claude Sonnet | $3.00 | $15.00 | $0.30 | $3.75 |\n| Claude Opus | $15.00 | $75.00 | $1.50 | $18.75 |\n\n**Message Batches:** 50% off all model pricing for async processing.\n\n## Cost Calculator\n\n```python\ndef estimate_cost(\n    input_tokens: int,\n    output_tokens: int,\n    model: str = \"claude-sonnet-4-20250514\",\n    cached_input: int = 0,\n    use_batch: bool = False\n) -> float:\n    pricing = {\n        \"claude-haiku-4-20250514\": {\"input\": 0.80, \"output\": 4.00, \"cache_read\": 0.08},\n        \"claude-sonnet-4-20250514\": {\"input\": 3.00, \"output\": 15.00, \"cache_read\": 0.30},\n        \"claude-opus-4-20250514\": {\"input\": 15.00, \"output\": 75.00, \"cache_read\": 1.50},\n    }\n    rates = pricing[model]\n    uncached_input = input_tokens - cached_input\n\n    cost = (\n        uncached_input * rates[\"input\"] +\n        cached_input * rates[\"cache_read\"] +\n        output_tokens * rates[\"output\"]\n    ) \u002F 1_000_000\n\n    if use_batch:\n        cost *= 0.5\n\n    return cost\n\n# Example: 10K requests\u002Fday, 500 input + 200 output tokens each\ndaily = estimate_cost(500, 200, \"claude-sonnet-4-20250514\") * 10_000\nprint(f\"Daily: ${daily:.2f}\")      # ~$0.045 * 10K = $450\u002Fday\nprint(f\"Monthly: ${daily * 30:.2f}\")  # ~$13,500\u002Fmonth\n\n# Same with Haiku + batching\ndaily_optimized = estimate_cost(500, 200, \"claude-haiku-4-20250514\", use_batch=True) * 10_000\nprint(f\"Optimized: ${daily_optimized:.2f}\u002Fday\")  # ~$22\u002Fday (20x cheaper)\n```\n\n## Strategy 1: Model Routing\n\n```python\ndef route_to_model(task: str, complexity: str) -> str:\n    \"\"\"Route tasks to cheapest adequate model.\"\"\"\n    # Haiku: classification, extraction, yes\u002Fno, routing ($0.80\u002F$4)\n    if task in (\"classify\", \"extract\", \"route\", \"validate\"):\n        return \"claude-haiku-4-20250514\"\n\n    # Sonnet: general tasks, code, tool use ($3\u002F$15)\n    if complexity in (\"low\", \"medium\"):\n        return \"claude-sonnet-4-20250514\"\n\n    # Opus: only for complex reasoning, research ($15\u002F$75)\n    return \"claude-opus-4-20250514\"\n```\n\n## Strategy 2: Prompt Caching\n\n```python\n# Cache system prompts and reference documents (90% input savings)\n# Break-even: 2 requests with same cached content\nmessage = client.messages.create(\n    model=\"claude-sonnet-4-20250514\",\n    max_tokens=256,\n    system=[{\n        \"type\": \"text\",\n        \"text\": large_reference_document,  # 10K+ tokens\n        \"cache_control\": {\"type\": \"ephemeral\"}\n    }],\n    messages=[{\"role\": \"user\", \"content\": user_question}]\n)\n```\n\n## Strategy 3: Batches for Non-Real-Time\n\n```python\n# 50% cost reduction for anything that doesn't need immediate response\n# Ideal for: summarization pipelines, data extraction, content generation\nbatch = client.messages.batches.create(requests=[...])  # Up to 100K requests\n```\n\n## Strategy 4: Spend Tracking\n\n```python\nimport anthropic\nfrom dataclasses import dataclass, field\n\n@dataclass\nclass SpendTracker:\n    budget_usd: float = 100.0\n    spent_usd: float = 0.0\n    requests: int = 0\n\n    def track(self, response):\n        cost = estimate_cost(\n            response.usage.input_tokens,\n            response.usage.output_tokens,\n            response.model,\n            getattr(response.usage, \"cache_read_input_tokens\", 0)\n        )\n        self.spent_usd += cost\n        self.requests += 1\n\n        if self.spent_usd > self.budget_usd * 0.8:\n            print(f\"WARNING: 80% budget used (${self.spent_usd:.2f}\u002F${self.budget_usd})\")\n        if self.spent_usd > self.budget_usd:\n            raise RuntimeError(f\"Budget exceeded: ${self.spent_usd:.2f}\")\n\ntracker = SpendTracker(budget_usd=50.0)\n```\n\n## Cost Reduction Checklist\n\n- [ ] Use Haiku for classification\u002Fextraction\u002Frouting tasks\n- [ ] Enable prompt caching for repeated system prompts\n- [ ] Use Message Batches for non-real-time processing\n- [ ] Set `max_tokens` to realistic values (not maximum)\n- [ ] Use prefill to reduce output preamble tokens\n- [ ] Implement spend tracking and budget alerts\n- [ ] Monitor via [Usage API](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fapi\u002Fusage-cost-api)\n\n## Resources\n\n- [Pricing](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fabout-claude\u002Fpricing)\n- [Prompt Caching](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fbuild-with-claude\u002Fprompt-caching)\n- [Usage & Cost API](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fapi\u002Fusage-cost-api)\n- [Message Batches](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fapi\u002Fcreating-message-batches)\n\n## Next Steps\n\nFor architecture patterns, see `anth-reference-architecture`.\n",{"name":5,"tags":24,"author":28,"license":15,"version":29,"description":30,"allowed-tools":31,"compatible-with":32},[25,26,27],"saas","ai","anthropic","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Optimize Anthropic Claude API costs with model routing, prompt caching,\nbatching, and spend monitoring.\nUse when analyzing Claude API billing, reducing costs,\nor implementing cost controls and budget alerts.\nTrigger with phrases like \"anthropic cost\", \"claude billing\",\n\"reduce claude spend\", \"anthropic budget\", \"claude pricing optimize\".\n","Read, Write, Edit, Grep","claude-code","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Fsaas-packs--anthropic-pack--anth-cost-tuning",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill anth-cost-tuning",{"tool":48,"command":49},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill anth-cost-tuning",{"tool":51,"command":52},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill anth-cost-tuning","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--anthropic-pack--anth-cost-tuning\u002FSKILL.md",true,[],[57,64,71,78,85,93],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]