llm cost optimization audit

    by Elyas Shukri Elmi

    1

    Audit LLM spend to find recoverable waste in prompt caching, model routing, and token usage.

    Secure checkout via Stripe

    0 installsSecurity scanned

    Works with the AI tools you already use

    CClaude CodeCCursorCCodex CLIGGitHub CopilotGGemini CLIVVS CodeWWindsurf+15 more

    See it in action

    You say

    Our Claude bill is spiking. We added prompt caching but it hasn't moved the needle. Here is our prompt template and a sample of our usage logs. Can you find the leak?

    Your agent does

    The audit shows cache_read_input_tokens is zero despite cache_control being set. Your prompt template includes a 'current_time' variable at the start of the system prompt. This invalidates the cache for every request. Moving this after the stable prefix will save an estimated 70% on input tokens.

    What you get

    Identify silent cache invalidators in prompt-assembly codeRank cost-reduction levers by impact vs implementation effortVerify if prompt caching is actually saving money or increasing the billCalculate ROI for switching latency-tolerant traffic to batch processing

    About this skill

    The problem

    LLM bills often grow into unmanaged line items that eat product margins. Developers frequently mistake setting a configuration flag for actually saving money, leading to "optimized" prompts that are silently more expensive than the baseline.

    What it does

    • Profiles token usage across input, output, and cache creation to find the real cost drivers.
    • Identifies silent cache invalidators like per-request timestamps or unsorted JSON that break prompt caching.
    • Calculates the break-even point for caching based on reuse frequency and TTL windows.
    • Audits model routing to find high-volume, low-complexity tasks running on over-powered tiers.
    • Sizes estimated savings for request batching and context compaction before you write any code.

    Frameworks & tools

    Works with any LLM provider usage logs. Specific logic for Anthropic Claude API prompt caching and Batch API. Uses current pricing snapshots for ROI calculations.

    Why this beats prompting it yourself

    Generic prompts often guess at savings. This skill uses a "profile first" discipline to ensure recommendations are based on your actual token distribution. It accounts for hidden costs like the prompt-cache write premium, which can actually increase your bill if reuse is infrequent.

    Use cases

    • Diagnosing why prompt caching is resulting in zero read tokens despite being enabled.
    • Evaluating the margin impact of moving high-latency background jobs to a Batches API.
    • Reducing context waste in long-running agent loops or chat histories.
    • Right-sizing models for specific tasks like classification or extraction without losing quality.

    Known limitations

    Does not perform quality benchmarks or "capability bake-offs" between models. Focuses on inference costs only, excluding database, hosting, or egress fees.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    Listedtoday

    Creator

    Frequently Asked Questions

    Popular in AI Agents & LLM Ops