Find what inflates your AI bill before it ships
The IntentiAI cost audit reads your repository, finds every call to a language model, and flags the patterns that make the bill grow: loops with no limit, endpoints with no spending cap, and answers you pay for twice. It is free, open source, and runs on your machine.
npx intentiaiNode 20 or later. No API key. See a sample report.
What it looks for
Every rule describes a pattern that has cost real teams money, and most cite the research behind them. Each one has its own page with an example and the fix.
- No spend cap on LLM callsNo dollar or token cap anywhere on the path to a paid call.
- Rate limiter that only exists when env vars are setA spending or abuse guard that only exists when certain env vars are set.
- LLM call with no output token limitA call with no output cap on a model where long answers are expensive.
- Frontier model used for a short, simple taskA frontier model doing a short, simple job where a cheaper sibling is likely enough.
- Agent loop with no iteration limitAn agent or tool loop with no iteration limit.
- Retries on a paid call with no cap or backoffRetries on a paid call with no cap, no backoff, or both.
- Async generation job polled with no deadline or cancelA billable job polled with no deadline and no way to cancel it.
- Full chat history re-sent on every turnThe whole conversation re-sent on every turn, so cost grows with its square.
- Scheduled job that calls a model on a timerA scheduled job that calls a model whether or not anyone is using the app.
- Images sent to a model in a loop at full resolutionImage or vision calls inside a loop with no limit on how many.
- High reasoning budget on a call that runs many timesA high reasoning budget on a call that runs many times.
- One request that triggers many model callsExtra model calls (moderation, titles, summaries) multiplying every request.
- Gemini context cache created and never deletedProvider-side caches created and never deleted, billed by the hour.
- Prompt cache breakpoint on text that changes every callPrompt caching on text that changes every call, so you pay to write and never read.
- Same deterministic call paid for on every requestThe same deterministic call paid for again on every duplicate request.
- Bulk work sent one call at a timeBulk work sent one call at a time where a batch API costs half.
- Fallback model that never switches backA fallback to a pricier model that never switches back.
- Request fields passed to a paid call without validationRequest fields reaching a paid call with no validation.
- Public endpoint that spends your model budgetAn endpoint anyone can call that spends your model budget.
- LLM API key shipped to the browserA provider key shipped to the browser.
- Provider API key committed in sourceA provider key committed in source. The key is masked in every report.
How it works
- Scan.
npx intentiaifinds each model call and the code around it: loops, retries, schedules, request handlers, guards. - Price. Each finding is estimated against current public pricing for the model it calls, and a cheaper model is suggested where one fits.
- Report. You get a summary in the terminal and a private link to the full report: file, line, fix, and citation for every finding. Add
--localto keep everything offline.
How accurate it is
On seven hand-labelled open-source apps, it found 98.6% of model calls. On five apps the rules were not written against, it found 45% of the labelled cost problems. The misses are listed in the repository. The rules are tuned to be right when they fire rather than to fire often.
Questions
How does the cost audit find model calls?
It reads your source statically. It recognises the official provider SDKs, LangChain, LiteLLM, the Vercel AI SDK, Spring AI, LangChain4j, LangChainGo and plain HTTP calls to provider endpoints, then checks each call site against 21 rules.
Do I need an API key or production traffic?
No. It runs on your machine against the code in your repository, before anything is deployed. Estimates use public pricing, not your usage data.
Which languages does it support?
TypeScript, JavaScript and Python get every rule with a real parser. Go, Java, Ruby and PHP get every call site and the 8 rules that need no deeper analysis. Other languages are counted and named as not scanned.
How is this different from LLM observability tools?
Observability tools such as Langfuse or Helicone measure traffic after you deploy. The cost audit reads code before you deploy, so it finds a loop with no limit before it runs. The two work well together.