Works with the AI Agents you already use
LLM Cost Optimizer: Prompt Cache & Plan Break-Even
Offline Python CLI comparing 14 LLM APIs with prompt caching math, prompt bloat auditing, and Plus/Pro subscription break-even analysis.
Free
LLM Cost Optimizer: Prompt Cache & Plan Break-Even
Example session with this skill installed
Compare monthly API costs for 60 turns/day (8,000 input / 1,200 output tokens, 65% prompt cache hit rate) across GPT-5, Claude Sonnet 4, and Gemini 2.5 Flash, and check break-even vs $20/mo subscriptions.
- Read your context and instructions
- Compiled the llm cost optimizer
Monthly LLM Cost & Break-Even Comparison
| Model | Per Turn | Monthly API Cost | vs $20 Plan | Recommendation |
|---|---|---|---|---|
| Gemini 2.5 Flash-Lite | $0.00089 | $1.60/mo | -$18.40 | PAY_AS_YOU_GO_API |
| GPT-5 | $0.01615 | $29.07/mo | +$9.07 | SUBSCRIPTION (BE: 41.3 t/d) |
| Claude Sonnet 4 | $0.02796 | $50.33/mo | +$30.33 | SUBSCRIPTION (BE: 23.9 t/d) |
python scripts/llm_cost.py estimate --daily-turns 60 --avg-input-tokens 8000 --avg-output-tokens 1200 --cache-hit-rate 0.65 --format md
python scripts/llm_cost.py audit-prompt --file system_prompt.txt --model claude-sonnet-4
Connects securely to your tools. The creator never sees your data.
About this skill
Estimating LLM API costs across multiple providers is a manual, error-prone task that often leads to budget overruns. This skill provides an offline Python CLI to calculate exact spend, audit prompts for token bloat, and determine when a flat-rate subscription beats pay-as-you-go billing.
What it does
- Cost estimation across 14 models including GPT-5, Claude 4, Gemini 2.5, and DeepSeek with prompt-caching hit rates.
- Token auditing for local files to identify bloat like excessive whitespace, unminified JSON, or duplicate lines.
- Subscription analysis comparing API spend against ChatGPT Plus, Claude Pro, Cursor Pro, and $200/mo enterprise tiers.
- Savings projections calculating monthly and annual dollar savings from context trimming and prefix caching.
How it works
- Estimate workload costs by passing daily turns, average input/output tokens, and expected cache hit rates.
- Audit specific local files or system prompts to detect token-heavy patterns and estimate file-level pricing.
- Compare current API usage against flat-rate subscription tiers to find the exact daily turn break-even point.
- List current 2026 reference pricing or load a custom JSON file for internal/private model rates.
Frameworks & tools
Python 3.8+ standard library. Uses argparse, json, math, and re. No external dependencies or tokenizers like tiktoken required.
Why this beats prompting it yourself
Manual calculations fail to account for provider-specific caching logic, such as Anthropic's 1.25x cache write fees versus DeepSeek's automatic prefix caching. This tool automates the blended math for 14 models simultaneously, ensuring your architectural choices are backed by dollar-accurate data.
Use cases
- Budgeting agent workloads before deploying high-volume automated pipelines.
- Optimizing system prompts by identifying and removing redundant tokens.
- Evaluating plan migrations from API-only to Cursor Pro or ChatGPT Pro seats.
- Auditing codebase context to estimate the cost of RAG or full-repo context windows.
Known limitations
Uses an EN/CJK/code tokenization heuristic instead of exact BPE, requiring a 10-15% safety margin. Reasoning models require manually increased output token counts to account for internal tokens.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.
Token counts use a heuristic (~5-10% of BPE). Reasoning models (o3, R1) require manual adjustment of output token counts for internal reasoning overhead.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed today
- Free with an Agensi account
- Software
Python 3.8+
Permissions
Strictly offline local file reads for audit-prompt and optional custom pricing JSON files; zero outbound network calls.