void-llm-cost-discipline

Enforces cost controls on Anthropic LLM API calls through model defaults, prompt caching, batching, and token budgets.

Updated May 29, 2026
One-click install
npx skills add https://github.com/voidcorp-core/void-harness --skill void-llm-cost-discipline-voidcorp-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: void-llm-cost-discipline
Source: https://github.com/voidcorp-core/void-harness/tree/main/packages/core/skills/void-llm-cost-discipline
Command: npx skills add https://github.com/voidcorp-core/void-harness --skill void-llm-cost-discipline-voidcorp-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? LLM API costs grow silently: Opus used everywhere costs 5x Sonnet, uncached system prompts re-bill thousands of tokens per call, unbounded retries burn budget, and missing max_tokens lets outputs run long. This Skill makes cost a first-class design concern at every LLM call site. ## Core Features & Use Cases - Model selection discipline: Sonnet 4.6 as default, Haiku 4.5 for high-volume classification, Opus 4.7 only with a justifying comment at the call site. - Prompt caching and batching: cache_control required on prompts over 1024 tokens for ~90% savings on cached blocks, and the Batch API for non-interactive workloads at a 50% discount. - Token budgets and bounded retries: explicit max_tokens per task class, retries capped with exponential backoff and jitter, and fallback models documented for critical paths. - Use Case: While adding an LLM-powered checkout classifier, the Skill guides you to use Sonnet with a cached system prompt, a 256-token output budget, structured cost logging, and a companion pre-commit hook that warns on violations. ## Quick Start Review my Anthropic API call in this file and apply the LLM cost discipline rules for model choice, caching, and token budgets.

Frequently Asked Questions about void-llm-cost-discipline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce Anthropic API costs in my application?

Reduce Anthropic API costs by defaulting to Sonnet instead of Opus, enabling prompt caching on system prompts over 1024 tokens for roughly 90% savings on cached blocks, and using the Batch API for non-interactive workloads at a 50% discount.

When should I use Opus vs Sonnet vs Haiku?

Use Sonnet 4.6 as the default for agentic work and code generation, Haiku 4.5 for high-volume classification at roughly 3x lower cost, and Opus 4.7 only for high-stakes reasoning with a justifying comment at the call site, since it costs about 5x Sonnet.

How does prompt caching work with the Anthropic API?

Prompt caching works by adding cache_control with type ephemeral to stable blocks like system prompts, tool definitions, and few-shot examples. Cached blocks cost about 90% less per call, with a default 5-minute TTL and an optional 1-hour TTL for stable prompts.

Should I use the Batch API for LLM workloads?

Use the Batch API when the workload is non-interactive and tolerates latency over one hour, such as overnight processing, bulk analysis, or periodic reports, since it offers a 50% discount. Keep user-facing interactive calls on real-time streaming endpoints.

Why should I avoid retrying LLM calls on invalid_request_error?

Retrying on invalid_request_error is pointless because the request itself is malformed and will fail identically every time, wasting tokens. Retries should be bounded with exponential backoff and jitter, and skipped for malformed requests and prompt-injection refusals.

What are the limitations of this LLM cost discipline approach?

This approach does not choose your provider, since Anthropic versus OpenAI versus Gemini is a project-level decision, and it does not impose a model-router abstraction by default. It also forbids caching prompts containing user PII without per-user cache keys.