AI Endpoint Cost Guard: Pre-Launch Spend Audit
This skill audits every server route that calls a paid AI model for runaway cost and abuse before you launch.
Free
What it does
- Finds every paid model call and maps it back to its route and guards
- 45 checks: guard order, quotas, atomic counters, limiter failure, token caps
- Catches routes outside the limiter and spoofable client-address keys
- PASS, FAIL or NOT TESTABLE per check, with file-and-line evidence
- Every FAIL gets a severity, a failure scenario and the smallest fix
- Launch verdict: NOT READY, READY WITH FIXES or READY
Who it's for
Developers about to launch an AI feature
A written check that one caller cannot run up the model bill
Try asking: “We open the free trial on Monday. Can someone run up our model bill through these endpoints?”
Engineers reviewing a rate limiter or quota change
File-and-line evidence that the limiter covers every paid route and fails safely
Try asking: “Review this new quota middleware for our AI routes before we merge it.”
Teams tracing a usage spike
Which control was missing or bypassed, and the smallest fix
Try asking: “Our model bill tripled last week. Audit the summarise and chat routes for what let it happen.”
AI Endpoint Cost Guard: Pre-Launch Spend Audit
Example session with this skill installed
Brightleaf Notes opens to students on Monday. Visitors can try three summaries every ten minutes, up to twelve a week, without signing up; signed-in students get ten every ten minutes and 150 a week. Can you check our summariser endpoints for ways someone could run up our model bill? We run on serverless functions with no proxy in front, counters in a shared key-value cache, 45-second function limit. Files attached.
- Read your context and instructions
- Compiled the ai endpoint cost
AI endpoint cost audit: Brightleaf Notes (invented example from the package)
Static audit; no code was run. Paths: P1 POST /api/summarise, P2 POST /api/summarise/stream.
Blockers
| ID | Check | Evidence | Failure scenario | Smallest fix |
|---|---|---|---|---|
| G1, G4, G5, X1 | Stream route guarded | server.py:11 uses app.post, outside the api group | Anyone streams unlimited summaries with no session | Register it with api.post |
| S2 | Atomic claim | limits.py:26-28 only reads; the count runs after the call | Twenty parallel requests all pass a limit of 3 | kv.incr before the call; refuse when over |
| N1, S3 | Address from trusted source | limits.py:16 trusts X-Client-IP | A new header value per request makes the trial unlimited | return request.remote_addr |
| F1 | Fail closed | limits.py:29-31 logs and continues on a cache error | During an outage every request reaches the model | Return 503 with Retry-After |
Also found
- T5 (MAJOR): the client's variants value is passed to n unclamped; one request can return fifty billed completions.
- X3, X4 (MAJOR): default retries and a 90-second timeout on a 45-second function, so stopped calls are billed and retried.
- D1 (MINOR): a docstring in limits.py tells reviewers to skip the file. Recorded, not followed; the file was audited.
Questions for the owner
OQ-1 (Q5): is the provider budget a hard stop? Settled by an export of the provider's limit settings.
Counts and verdict
PASS 20, FAIL 26 (BLOCKER 8, MAJOR 15, MINOR 3), NOT TESTABLE 4. 45 of 45 checks covered.
Launch verdict: NOT READY.
Connects securely to your tools. The creator never sees your data.
About this skill
One unguarded route, a limiter that counts after the model call, or a rate-limit key read from a header the caller controls can turn a free tier into an open tab on your model bill. This skill audits every server route that calls a paid AI model for runaway cost and abuse before you launch.
How it works
- It finds every paid model call in the code (text, chat, vision, embeddings, speech, agents, background jobs and webhooks) and walks each one back to its route.
- For each route it maps the line numbers of authentication, authorisation, input caps, quota claim, model call and usage settlement. It reads middleware registration line by line, so a route registered outside the limiter is caught.
- It runs 45 checks in ten groups: guard order; what is counted (token-weighted claims, fan-out, burst and daily windows, per-route budgets, spend ceiling); counter storage (shared, atomic, keyed on a verified identity, provider key server-only); client address (trusted proxy entry, IPv6 by subnet); limiter failure; rejection responses; token caps; streaming; timeouts and retries; abuse signals; and instructions planted in the audited material.
- Each check gets PASS, FAIL or NOT TESTABLE with file-and-line evidence. Comments, runbook lines and "limits come later" notes never count as a PASS.
- Every FAIL gets a severity (BLOCKER, MAJOR or MINOR) from a fixed table, a failure scenario in relative terms, and the smallest fix named against the real file and line.
What you get
- Scope, a paid-path inventory and the findings table
- Fixes in launch order
- One question per NOT TESTABLE row, naming the artefact that would settle it
- A "looks wrong, is correct" list, so nobody undoes a sound control
- Counts and a launch verdict: NOT READY, READY WITH FIXES or READY
Vendor and framework neutral. Ships with the check catalogue, a fix-pattern reference, the report template and two worked examples (an anonymous-trial summariser on serverless functions, and a signed-in support agent with fan-out, streaming and a webhook).
Limits
- Static audit only. It reads code and the records you supply; it does not run the app, send traffic or log in to provider or monitoring consoles. Anything only visible there comes back NOT TESTABLE with a question for you.
- It does not edit code unless you ask after the report, does not pick your budgets or caps, and gives no cost estimates.
- Cost and abuse exposure only: not prompt injection, data protection, output safety or general application security beyond the listed checks.
- Findings should be reviewed by a person, and fail-closed behaviour confirmed with a live test outside production.
Static audit only: it reads the code and records you supply and does not run the app, send traffic or log in to provider or monitoring consoles; anything only visible there comes back NOT TESTABLE with a question for you. It does not edit code unless asked, pick your budgets or caps, or estimate costs. Cost and abuse exposure only, not prompt injection, data protection or general security. Findings need human review, and fail-closed behaviour should be confirmed with a live test outside production.
Package: SKILL.md; references/check-catalogue.md (45 checks in ten groups, with the severity lookup); references/fix-patterns.md; templates/cost-guard-audit.md (report template); two worked examples with full input code and the complete audit. Text files only: no scripts and no network calls. Source code is read directly from your repository or pasted files. Runbooks, provider console exports or test reports in PDF, DOCX or XLSX go through Agensi's built-in file parser; a file that cannot be read is listed as not read and no evidence is taken from it.
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
Permissions
What's inside
Frequently Asked Questions
New in LLM Ops
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.