Cut your LLM bill: stop paying tokens for boilerplate
Teams optimizing LLM costs usually tune prompts and models first. The bigger lever is usually upstream: what you feed the model. A typical web page served raw carries 40–70% non-content — nav bars, footers, cookie banners, scripts, ads. Every token of that gets processed on every call.
Do the math once
Take an agent that reads 50 pages/day with a 12k-token context window per read:
- Raw HTML/text dumps: ~8k tokens of junk per read → ~12M junk tokens/month
- Clean extraction: ~2k tokens of junk → ~3M junk tokens/month
Same answers, roughly a quarter of the input volume. On any serious monthly bill, that's the difference between a rounding error and a budget line.
Three layers of waste to remove
- Markup and chrome — tags, menus, banners, legal boilerplate.
- Repetition across reads — the same page fetched twice pays twice; caching fixes this for free.
- Wrong pages entirely — crawling without mapping wastes credits on PDFs, tag pages, and pagination shells nobody reads.
The pipeline that fixes it
# Clean markdown only (boilerplate stripped at the edge)
POST /api/v1/scrape {"url": "...", "onlyMainContent": true}
# Repeat reads come from cache in milliseconds — free
POST /api/v1/scrape {"url": "...", "maxAge": 3600}- Extract at the edge, not in the prompt: request clean markdown with main-content filtering, not raw HTML dumps.
- Cache aggressively: unchanged pages shouldn't re-render, let alone re-enter a prompt.
- Monitor instead of poll: scheduled change detection means you only pay when content actually moves.
The counterintuitive part
Cheaper inputs aren't just cheaper — they're better. Models attend to signal, not noise; stripped, structured input measurably improves extraction accuracy and reduces hallucinated details. Cost optimization and quality optimization point the same direction here.
Clean markdown, edge caching, monitors — included on every plan, from $0.
Start free