Want to cut your token bill this quarter?
Start with a single file. The savings compound quickly when you move to bulk conversion via API.
Most AI API Bills Are Paying for Garbage Tokens
Every team running a RAG system, a document summarizer, or a support chatbot on top of an LLM API eventually notices the same thing: monthly token bills grow a lot faster than user load. The usual suspects get blamed first, the model choice, the context size, the retry policy. The real culprit is usually simpler, and it is sitting in the documents you are feeding the API.
A raw PDF, or the plain-text dump of a multi-tab Excel workbook, or a PowerPoint with slide metadata still attached, is a worst-case input for a language model. Most of the tokens in those documents are not content. They are layout artifacts, repeated headers, page numbers, hidden XML, collapsed tables, and whitespace. The model pays for them anyway because it is billed on every token you send.
Converting the same file to clean Markdown first removes most of that noise. On the workloads we see most often, the savings run between 40% and 70%, with a typical average around 60%. That number is not marketing, it is what you see when you count tokens on the same file both ways. The rest of this post shows the math.
Where the Wasted Tokens Actually Come From
When you take a typical business document, upload it to an LLM, and it gets parsed as text, these are the token drains you are paying for:
- Repeated headers and footers on every page of a long PDF. A 50-page report might repeat the same title and page counter 50 times.
- Page numbers, section dividers, and "confidential" disclaimers that appear on every page and add nothing to the model's understanding.
- Layout whitespace from multi-column PDFs and Excel cells that creates long runs of spaces and newlines, all billable.
- Broken table layouts that dump the same number alongside ten stray label fragments, so the model burns tokens trying to figure out what belongs where.
- Excel metadata: merged cell rows rendered as individual blank cells, formula references, tab delimiters, each a few more tokens per cell that add up fast.
- PowerPoint layout cruft: slide numbers, master-slide placeholders, and repeated template text.
Clean Markdown removes almost all of this. Headings get marked with # instead of being surrounded by whitespace and page numbers. Tables use the compact pipe syntax instead of tab-separated sprawl. Page repetition is eliminated entirely. The document gets shorter, and the model still sees everything that matters.
Real Numbers on Real Files
We took three typical business documents, counted tokens both ways, and priced them at current public API rates. These are the kinds of files you probably already process in bulk.
Example 1: A 50-page quarterly report PDF
Standard investor-relations PDF with tables, footnotes, and repeated headers.
| Format | Tokens | GPT-4o cost | Claude cost | Gemini Flash cost |
|---|---|---|---|---|
| Raw PDF text | 32,400 | $0.081 | $0.097 | $0.0024 |
| Clean Markdown | 12,900 | $0.032 | $0.039 | $0.0010 |
| Savings per file | −60% | −$0.049 | −$0.058 | −$0.0014 |
Run this document through the API 10,000 times a month (typical for a support bot or document-analysis pipeline) and you are looking at $490 less spend on GPT-4o, $580 less on Claude, or $14 less on Gemini Flash. And the quality of the answers goes up, not down.
Example 2: A 5-tab Excel financial model
Income statement, balance sheet, cash flow, assumptions, and summary tabs.
| Format | Tokens | GPT-4o cost | Claude cost |
|---|---|---|---|
| Raw Excel export (CSV-style) | 21,800 | $0.055 | $0.065 |
| Clean Markdown | 6,400 | $0.016 | $0.019 |
| Savings per file | −71% | −$0.039 | −$0.046 |
Excel is often the biggest per-file savings because its raw export format is especially verbose. Merged cells, blank padding, and tab separators all get cleaned out.
Example 3: A 31-slide training deck
OSHA safety training deck with speaker notes and embedded tables.
| Format | Tokens | GPT-4o cost | Claude cost |
|---|---|---|---|
| Raw slide text export | 9,800 | $0.025 | $0.029 |
| Clean Markdown | 5,300 | $0.013 | $0.016 |
| Savings per file | −46% | −$0.011 | −$0.013 |
What This Looks Like at Production Volume
Per-file savings of a few cents do not look like much. They compound fast once you are running at real volume. Here is what the same 50-page PDF looks like at three different operating scales, assuming you are on GPT-4o.
| Volume | Raw PDF spend | Markdown spend | Monthly savings | Annual savings |
|---|---|---|---|---|
| 1,000 calls/month | $81 | $32 | $49 | $588 |
| 10,000 calls/month | $810 | $324 | $486 | $5,832 |
| 100,000 calls/month | $8,100 | $3,240 | $4,860 | $58,320 |
Assumes the same 50-page report with 32,400 raw tokens converted down to 12,900 Markdown tokens. Input-only pricing; output costs are unaffected by this change.
Running documents through an API in bulk?
Our batch conversion API sits in front of your LLM calls on Pro and Scale plans. Convert once, reuse the Markdown across every prompt, pay for a fraction of the tokens.
Where Teams See the Biggest Impact
Any workload that sends documents to an LLM API gets cheaper with this change, but the dollar impact is largest in a few specific patterns:
If you are retrieving chunks from contracts, reports, or manuals and sending them to the LLM at query time, you are paying for every chunk every time. Cleaner chunks means more of your retrieval budget lands on useful content, and less on layout noise.
Help documents are prime offenders for repeated headers and page numbers. Converting the source corpus to Markdown once cuts ongoing query costs without changing your retrieval logic.
Contract review, earnings report summarizers, compliance scanners, due diligence tools. These are all document-in, summary-out workloads where input tokens dominate the bill.
If you are processing thousands of invoices, receipts, or forms per day, token efficiency directly affects unit economics. A 60% input reduction often moves a workload from unprofitable to profitable.
Agents that pass documents between multiple tool calls pay for the same content on every hop. Compact Markdown compounds savings across hops.
Sales assistants, research agents, and analyst copilots often keep a document in context across many turns. Every turn pays for the input again. A leaner document means a leaner bill per turn.
How to Roll This Out in Your Stack
You do not need to change your LLM, your model, your framework, or your prompts. You only need to change what the prompts consume.
The one where you can see the token bill line item move. RAG over a document corpus is the usual starting point.
Manually for the first pass (to measure savings), then via our API once you have confirmed the numbers match your expectation.
Feed the same prompt the Markdown version of the document instead of the raw PDF text. Do this for a sample of traffic and compare token counts and response quality.
Once you have confirmed a savings number you can replicate, scale up. The savings are immediate; there is no ramp.
Keep an eye on answer quality. In practice, quality goes up with Markdown because the model can actually see the structure, but always measure.
A Scenario That Comes Up Often
A mid-size SaaS company runs a contract-review product for their customers. Every month they process about 25,000 uploaded PDFs through GPT-4o, averaging 35,000 tokens per document as raw PDF text.
- Monthly raw-PDF token spend: roughly $2,190 (25,000 docs × 35,000 tokens × $2.50/M).
- After conversion to Markdown (average 14,000 tokens per doc): roughly $875.
- Monthly savings: ~$1,315. Annual: ~$15,780.
They also reported an improvement in answer quality and a notable reduction in user complaints about missed contract clauses, because the AI could actually see the structure of the document. The token bill dropped. The support ticket volume dropped. Both line items.
What to Watch For
- Savings depend on the source file. Very clean digital PDFs save less (maybe 30%), messy scans with OCR artifacts save more. Measure on your actual corpus rather than assuming the average.
- Output tokens are unchanged. This approach reduces input spend only. If your output tokens dominate (long generation), focus on other levers like smaller models or response-length caps.
- If you use prompt caching on OpenAI or Anthropic, Markdown is easier to cache effectively because it is more compact and more stable across calls.
- For embedding-based RAG, converting documents to Markdown before chunking also improves retrieval recall, because chunks become more semantically coherent. The cost savings get a quality bonus.
Common Questions
Is 60% realistic, or marketing spin?Answer
It is a real average across the typical business documents we see (PDFs, Excel, PowerPoint), measured with the same tokenizers the major LLM providers publish. Your number will land between 30% and 75% depending on file types. Measure on your own corpus before sizing the savings.
Does this work with OpenAI, Anthropic, Google, and open-source models?Answer
Yes. Markdown is plain text and every modern LLM reads it well. The savings apply equally across GPT-4o, Claude, Gemini, Llama, Mistral, and any model you run on your own hardware.
What about output quality? Does cheaper mean worse?Answer
The opposite. In practice, quality improves because the model can actually see the structure of the document. Cleaner headings, preserved tables, and intact bullet lists make it easier for the model to find and reference specific information.
Do I have to change my prompts or my retrieval pipeline?Answer
No. You swap the document representation at the input layer only. Prompts, chunking strategy, embeddings, retrieval logic, and model choice all stay the same.
Can I do this for a batch of files automatically?Answer
Yes, via the API on Pro and Scale plans. You send a file, you get Markdown back. Most teams wrap this as a preprocessing step before documents land in their RAG corpus or document store.
Does the cost of conversion itself eat into the savings?Answer
In virtually every case, no. API conversion costs are a fraction of what you save on LLM tokens, and conversion happens once per document while LLM calls happen many times per document in production.
The Short Version
If you are running production AI workloads on top of paid APIs, you are almost certainly paying for tokens that do not help the model. Converting documents to Markdown first strips out the noise, typically cutting input-token spend by around 60%, and the quality of the answers tends to go up rather than down.
Pick one high-volume document workflow. Measure token counts both ways on a sample. If the numbers look like ours (and they usually do), the decision to roll out across the full pipeline is straightforward.
Measure the savings on your own documents
Convert a sample file free. If the numbers match, the API sits in front of your LLM calls on Pro and Scale plans for production rollout.
Enterprise deployments: SOC, DPA, and single-tenant options available for high-volume or regulated workloads.