LLM API cost checker

Drop your project or paste a file that calls OpenAI, Anthropic, Gemini, the Vercel AI SDK, LangChain or LiteLLM to find the patterns that quietly multiply the bill.

Run the check

Drop a project folder or files here

node_modules, .git, virtualenvs and build folders are skipped. Limit 25 MB / 5,000 files.

The Python engine (Pyodide, a few MB, cached by your browser) loads when you start.

The mistake

Calls with no output cap or request timeout, one request per item fired all at once, a conversation history that is never trimmed, a large system prompt sent uncached on every call, a top-tier model doing a classification job, embeddings recomputed on every request, and retired model names.

Why it is dangerous

Without an output cap the model may write until its maximum output length, and you pay for every token: a prompt bug or a loop turns one request into the most expensive request the model can produce. The OpenAI and Anthropic SDKs default to a 10-minute request timeout with 2 retries. One request per item multiplies cost by the size of the list, and firing them all at once hits rate limits, so retries re-send work that was already billed. Retired model ids fail in production.

How to fix it

Set an explicit output cap (max_completion_tokens / max_tokens, max_output_tokens, maxOutputTokens) and a timeout that matches how long the caller can wait. Bound concurrency, use the providers' batch APIs for offline jobs, trim history, mark large static prompts for caching (Anthropic cache_control), and keep per-request values out of the start of long prompts. Each finding shows the exact code for the SDK it was found in.

What this checker looks for

This page runs llm-cost-lint, which reads Python and JavaScript/TypeScript using OpenAI, Anthropic, Google GenAI, Vercel AI SDK, LangChain or LiteLLM. The rules most relevant to this page:

RuleWhat it finds
LCL001No output token cap
LCL003No request timeout configured
LCL004LLM call per item in a loop
LCL006Large static prompt sent without prompt caching (Anthropic)
LCL007Dynamic value near the start of a large prompt
LCL008Top-tier model used for a simple or repeated task
LCL010Conversation history grows without a limit
LCL011Retired or deprecated model name

Every finding has a rule id, a severity, file:line, the offending line (secrets masked), why it matters and how to fix it. Run llm-cost-lint rules for the full list.

FAQ

Does it call any model or price API?

No. Model facts (which models are retired, which are top tier) come from a small dated data file in the package, not from the internet.

Is the model-tier rule a hard rule?

No. LCL008 is a heuristic: confirm with an eval on real examples before switching models.

Are my files uploaded anywhere?

No. The checker is Python running inside your browser tab (Pyodide, WebAssembly). Your files are read with the browser's File API and written into an in-memory file system that exists only in this tab. Your files are never sent anywhere. The only network requests load the Python runtime and the checker code, plus Google Analytics page-view counting, which never sees your files. You can disconnect from the internet after the engine has loaded and the scan still works.

Is a clean report a guarantee?

No. It is a static check for known patterns, not a penetration test. A clean report means none of these patterns were found, nothing more.

Can I run the same check on my machine or in CI?

Yes. Every checker on this site is an open-source command-line tool (MIT licence, Python 3.10+ standard library only). The results here are the same as `scan --json` on the command line, except for checks that need git (whether a file is committed or ignored), which cannot run in a browser.