Works with the AI Agents you already use
Token Usage, API Spend & Budget Leak Auditor
Audit LLM token usage, detect agent loops, and implement FinOps controls to stop budget leaks.
$15
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
| Provider | Model | Usage (Tokens) | Estimated Cost | Finding |
|---|---|---|---|---|
| OpenAI | gpt-4o | 90M (Input) / 30M (Out) | $450.00 | Confirmed Leak |
| Anthropic | claude-3-5-sonnet | 15M (Input) / 8M (Out) | $120.00 | Efficiency 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_hopsceiling of 10 on thesupport-agent-v2workflow 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.pyscript to your full month export for a precise forecast. - Deploy the
max_hopscircuit breaker to the production agent handler. - Update your rate card in
pricing_example.jsonto 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
- Scope and evidence defines the audit period, currency, and data sources while identifying gaps.
- Spend forensics reconciles usage by environment, agent, and model to map exactly where capital is deployed.
- Risk quantification ranks findings by financial impact and remediation effort.
- 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
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 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