You build a small tool that summarizes support tickets. Each ticket is an email thread, and your help desk stores every message the way it arrived. You join the messages, send them to a model, and get a good summary back. The token count in the response is about ten times what you expected from looking at the conversation.
It has been revealed that nothing went wrong. The model read exactly what you sent, and most of it was the same text, copied again and again by the mail client. (Related: How to train a new language model from scratch using Tr...)
It has been revealed that A token is a chunk of text the model reads; APIs bill per million of them. A tokenizer is the program that cuts text into tokens; I used tiktoken with o200k_base, the one OpenAI's current models use. Input tokens are what you send, output tokens are what the model writes back, and output usually costs five or six times more per token. A quoted reply is the previous message pasted under your answer, each line starting with >, under a line like "On Mon, Nov 3, Dana wrote:". A list price is the vendor's official price per million tokens, before any discount. (Related: Block Sparse Matrices for Smaller and Faster Language M...)
In a recent development, I wrote a synthetic 10-message thread: a customer charged twice, a support agent, a refund. The messages are short, between 26 and 65 tokens each, with a two-line signature. Every reply quotes the whole previous message, which already contains its own quote, which contains the one before. That is the default in most mail clients. Lines are wrapped at 72 characters, as in plain-text mail.
Industry observers note that the whole conversation is 487 tokens of fresh text. Stored message by message, it's 5,068: 10.4 times as much. Even the last message on its own, 1,030 tokens, is more than twice the whole conversation, because it carries every earlier message plus the clutter around them.
If every message only copied the earlier text, a thread of N messages would come out at about (N + 1) / 2 times the new text, so 5.5x for ten messages. That alone grows fast: twenty messages would be 10.5x. Two things push the real number higher.
Sources indicate that the first is the > markers. Each level of quoting adds another > to the start of every line, and the tokenizer bills it. A line of 10 tokens costs 11 at depth one, 15 at depth five and 19 at depth nine. In the 10th message, markers alone are 36% of the tokens. Clients that nest as >>> without spaces are a bit cheaper (4,240 tokens for the same thread), but not much.
The second is everything around the text. Every "On ... wrote:" line and every signature gets quoted along with the message and copied down the thread at every level.
Say your summarizer sends 300 tokens of instructions plus the thread and gets back a 150-token summary, for 1,000 tickets a day. At gpt-5.6's list price of $2 per million input and $12 per million output (from the catalog snapshot of the LLM gateway I work on), a thread costs $0.0125 as stored and $0.0034 with the quotes removed. That's 3.7x, or $376 against $101 a month. On gpt-5.6-mini it's $37.61 against $10.12. On claude-haiku-5.5 and claude-sonnet-5.5 it's 4.0x, because their output is relatively cheaper, so input is a larger share of the bill.
The fix is to cut the quoted block before the text reaches the model. Each message keeps only what its author wrote, and the thread as a whole still has every word once:.
Industry observers note that the pattern finds the "wrote:" line and every line under it that starts with >, and removes them together. In my test thread it gives back each message's own text exactly, and the ten stripped messages add up to the 487 tokens in the table.
According to recent reports, it only handles plain-text quoting. HTML mail usually wraps the quote in a or a div with a client-specific class, and the "wrote:" line is localized: a German client indicates "schrieb", a Russian one says "Π½Π°ΠΏΠΈΡΠ°Π»". You'll need a pattern per format you actually receive, or a mail-parsing library that knows them.
In a recent development, some replies answer inline, writing between quoted lines: "> Which card? / The Visa ending in 4471." Strip the quote there and the answer loses its question. If your consumers do this, keep the quoted line directly above each inline answer.
According to recent reports, the saving depends on the job. My summarizer reads the whole thread once, so input dominates. A bot that drafts a reply to each incoming message pays for instructions and output every time, and with the same numbers it saves only 27% (1.37x). Measure your own split before expecting 3.7x.
Recent findings suggest that finally, the thread is synthetic and counted with one tokenizer. Real threads have longer signatures, legal footers and forwarded chains, so they probably repeat even more, but I haven't measured that. Claude and Gemini tokenize differently, though they still read every copy. To check your own data, compare the token count of one stored thread with and without quotes.
