How to Cut Your LLM API Bill When Feeding It Documents
July 3, 2026 · 6 min read
LLM costs scale with tokens, and documents are full of tokens you are paying for but the model ignores. Here is how to find and cut that waste.
Your LLM bill scales with tokens. Documents are token-heavy, and a large share of those tokens carry no information at all. You pay input-token price for that waste on every single call. Here is where it hides and how to cut it.
Where the tokens actually go
When you drop a raw PDF or a spreadsheet export into an API call, much of what you send is not content. It is page headers and footers repeated on every page, navigation and watermark junk, broken hyphenation that splits one word into two tokens, encoding artifacts like (cid:32), and whitespace padding from tables. The model reads past all of it, and you are billed for all of it.
The math that makes it matter
Input tokens are cheaper than output tokens, but documents are almost entirely input, and you usually send the same document many times: once per question, or once per user in a retrieval loop. A 30-page report can be 25,000 tokens raw. If a third of that is repeated boilerplate and formatting noise, you pay for roughly 8,000 wasted tokens every call.
- Sent once: the waste is negligible.
- Sent 100 times a day across users and questions: 800,000 wasted tokens a day.
- Over a month: around 24 million tokens you paid for and the model ignored.
The exact dollar figure depends on your model, but the pattern holds: document waste compounds with call volume. The higher your traffic, the more a one-time cleanup pays back.
Five ways to cut it
- Strip boilerplate. Remove repeated headers, footers, page numbers and watermarks before sending.
- Fix broken text. Rejoin hyphenated line breaks so one word is one token, not two.
- Convert tables to Markdown. A clean Markdown table is far more compact than a padded CSV dump or a tag-heavy HTML table, and models read it better.
- Send the compact version, keep the full one. Most questions need the cleaned prose and tables, not the raw layout. Keep a full version for when you truly need every cell.
- Cache and reuse. Preprocess once, store the clean Markdown, and send that from then on instead of re-parsing the source every time.
Measure before and after
You cannot cut what you do not measure. Count tokens on the raw document and on the cleaned version with a real tokenizer, the same one your model uses, not a word count. A well-cleaned document typically lands 40 to 70 percent smaller with no loss of meaning.
Doing it without building a pipeline
You can do all of this by hand or with a script. If you would rather not maintain one, PackForAI does exactly this: it converts PDFs, Word, Excel, CSV and JSON into clean, compact Markdown and shows the token count before and after, so the savings are visible on every file. Up to 65 percent fewer tokens is common.
Every token you send a model, you pay for, whether or not it carries meaning. Cleaning the input is the cheapest optimization most teams are not doing.
Try it on your most-sent document at packforai.com and read the before and after token count for yourself, no account needed for the first one.
Try PackForAI
Turn your PDFs, DOCX, PPTX, and XLSX into clean, AI-ready Markdown with token savings. Free to start.
Open the app