Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Token Usage, API Spend & Budget Leak Auditor

    1

    Audit LLM token usage, detect agent loops, and implement FinOps controls to stop budget leaks.

    $15

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Token Usage, API Spend & Budget Leak Auditor

    Token Usage, API Spend & Budget Leak Auditor

    Example session with this skill installed

    Audit my spend for the last 3 days. We spent $450 on gpt-4o and $120 on claude-3-5-sonnet. The agent seems to be stuck in a loop. I've attached the redacted usage logs for 'support-agent-v2'.

    • Read your context and instructions
    • Compiled the token usage api

    The audit of the 'support-agent-v2' workflow indicates a confirmed budget leak caused by a recursive tool-call loop in the production environment. At the current burn rate, you will exceed your monthly budget by 240% within 11 days.

    Spend Audit: support-agent-v2

    ProviderModelUsage (Tokens)Estimated CostFinding
    OpenAIgpt-4o90M (Input) / 30M (Out)$450.00Confirmed Leak
    Anthropicclaude-3-5-sonnet15M (Input) / 8M (Out)$120.00Efficiency Risk
    Total-143M$570.00-

    Top Findings

    Tool-Call Recursion (Critical): The gpt-4o logs show a specific request ID (req_9928) making 45 identical calls to a search tool in 120 seconds. This accounted for 65% of the 3-day spend.
    2.

    Context Bloat (Medium): The system prompt is being re-sent in every turn of a 50-turn conversation without utilizing prompt caching, leading to redundant input costs.
    3. Model Overqualification (Low): 12% of traffic is simple classification that could be routed to a cheaper model.

    Remediation Plan

    • Immediate: Implement a max_hops ceiling of 10 on the support-agent-v2 workflow to break infinite loops.
    • 7 Days: Enable prompt caching for static system instructions and knowledge base snippets.
    • 30 Days: Implement a model router to send simple intent classification to a lightweight model.

    Proposed Alert Policy

    • Anomaly Alert: Trigger at >$50/hour burn for this specific workflow.
    • Hard Limit: Set a per-request ceiling of 4,000 output tokens to prevent runaway verbosity.

    Next steps

    • Apply the calculate_costs.py script to your full month export for a precise forecast.
    • Deploy the max_hops circuit breaker to the production agent handler.
    • Update your rate card in pricing_example.json to include latest tier discounts.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    AI infrastructure costs can spiral out of control due to inefficient agent loops, oversized prompts, and lack of token governance. This skill provides an engineering-focused audit of LLM spend, identifying specific leaks and quantifying potential savings across providers and models.

    What it does

    • Usage normalization converts disparate provider logs into a unified schema for multi-model spend analysis.
    • Leak detection identifies runaway agent loops, retry storms, and redundant system instructions.
    • Architecture auditing evaluates model routing, context bloat, and caching opportunities to reduce waste.
    • Budget forecasting calculates burn rates and projected period-end spend based on historical usage patterns.
    • Control design builds actionable alert policies, circuit breaker thresholds, and token ceilings.

    How it works

    1. Scope and evidence defines the audit period, currency, and data sources while identifying gaps.
    2. Spend forensics reconciles usage by environment, agent, and model to map exactly where capital is deployed.
    3. Risk quantification ranks findings by financial impact and remediation effort.
    4. Remediation planning delivers a prioritized task list for immediate, 7-day, and 30-day cost reduction.

    Frameworks & tools

    Works with any provider (OpenAI, Anthropic, Google, etc.) using supplied logs or scripts/calculate_costs.py. Compatible with CSV and JSON usage exports following a standard schema.

    Why this beats prompting it yourself

    Generic prompts often fail to account for complex provider billing like cached-token discounts or agent-loop recursion. This skill uses a structured FinOps methodology to ensure savings don't compromise application safety or output quality.

    Use cases

    • Post-launch audit to find and fix unexpected spend spikes after deploying new agentic workflows.
    • Model optimization to determine if expensive models are being wasted on simple extraction tasks.
    • Governance setup to establish hard limits and anomaly detection for multi-tenant AI apps.

    Known limitations

    Does not support real-time telemetry without connected external data sources. Cannot verify provider-side billing accuracy without official invoice exports.

    No real-time monitoring without external telemetry. Accuracy depends on user-provided rate cards and logs. Does not handle secrets or API keys.

    How to use

    1. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    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

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed today

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listedtoday

    What's inside

    Frequently Asked Questions

    The skill analyzes your LLM logs to pinpoint 'runaway' agentic loops, identifies where expensive models are over-provisioned for simple tasks, and detects redundant prompt tokens that inflate your bill without improving output quality.

    It is model-agnostic and works with any provider—including OpenAI, Anthropic, and Google Vertex AI—provided you can export your usage data in CSV or JSON formats.

    You will receive the core logic for spend forensics, the `calculate_costs.py` utility for processing raw logs, and a structured remediation framework that prioritizes cost-cutting tasks by financial impact.

    While the skill does not offer a live dashboard, it provides the architecture for building automated circuit breakers and token ceilings that you can implement within your own infrastructure.

    No, this is a FinOps-focused audit that analyzes historical logs and provides a prioritized remediation plan; it does not require a persistent connection to your production environment or API keys.

    New in LLM Ops