Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Estimates LLM token counts and per-request costs across models, flags wasteful prompt text, and models prompt-cache break-even.
57% 96%+39 ptsof test cases passed
Passed 22 of 23 test cases with the skill, and 13 of 23 without it.
This test ran on v1. v3 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
The agent turns "what will this cost?" into a number with its assumptions shown: estimated tokens, cost per request and per 1,000 requests by model, savings from caching, and prompt text that costs tokens without changing the result. The built-in price table is an illustrative snapshot, not verified current pricing: for real numbers, copy rates from each provider's pricing page into a JSON file and pass it with --prices FILE (shape: assets/sample_prices.json).
The LLM Cost Optimizer skill provides tools for counting tokens, estimating costs across different LLM providers, and optimizing prompts to reduce token usage without sacrificing quality. Essential for teams managing LLM API budgets at scale.
Before estimating or optimizing, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
--file/--text/--stdin).--models and the pricing comparison).token_counter.py vs prompt_optimizer.py and sets --target-reduction).Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
# Count tokens and estimate costs. Built-in prices are illustrative; real numbers come from --prices FILE
python3 scripts/token_counter.py --text "Summarize the attached contract in five bullets." --models claude-opus-5-5 claude-sonnet gpt-4o-mini
# Count tokens from stdin
echo "Hello world" | python3 scripts/token_counter.py --stdin --models all
# Costs from your own price file (copy current rates from the providers' pricing pages)
python3 scripts/token_counter.py --file assets/sample_prompt.txt --prices assets/sample_prices.json
# Analyze a prompt: three findings, one per line (role preamble, CoT scaffold, all-caps emphasis)
python3 scripts/prompt_optimizer.py --file assets/sample_prompt.txt
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.