Long context window cost: why big prompts get expensive
Long context window cost: every input token is billed on every call, so long prompts and chats add up. See the math and when chunking helps.
Updated
Long context window cost is the price of every input token you send, billed again on every call. A prompt twice as long costs about twice as much per call, and a long chat costs more than its length suggests because each turn resends the turns before it.
Why are long prompts expensive?
Model APIs bill input tokens (what you send) and output tokens (what the model writes) at separate rates. Input covers the instructions, the documents, any examples and the chat history. Nothing carries over between calls, so every call pays for the whole prompt again. A long document sent with every question bills the same tokens every time.
Here is a hypothetical example with round numbers. A 50,000-token contract sent with 1,000 questions is 50 million input tokens. At Claude Opus list price of $4 per million input tokens, that is $200 in input alone. At Claude Haiku list price of $0.10 per million, the same run is $5. Output tokens are billed on top of this, and they cost more per token (see /guides/input-vs-output-token-cost/).
What does a chatbot cost per conversation?
A chat API keeps no memory. Your app sends the system prompt and the full history with each new message, and the model’s reply joins that history for the next turn. The bill for a conversation is the sum of every turn’s input.
Here is a hypothetical chat with round numbers. Each turn adds 1,000 tokens of history, the user message and the reply together. Turn 1 sends 1,000 tokens, and turn 20 sends 20,000. Across 20 turns that is 210,000 input tokens. If each turn carried only its own 1,000 tokens, the total would be 20,000. At Claude Opus list price, the 210,000 tokens cost $0.84 per conversation. At Claude Haiku list price, they cost $0.021. This leaves out the system prompt and output tokens, so your real figure will be higher. Count tokens from a sample conversation to get your own number.
Why does multi-turn conversation token cost grow so fast?
Each turn resends everything before it, so input cost grows with the square of the number of turns. In the example above, a 40-turn chat sends about 820,000 input tokens, nearly four times the 20-turn total. Doubling the length of a chat roughly quadruples its input cost.
Two fixes cut this. Summarize older turns into a short note and send the note instead of the full history. Use prompt caching so the stable part of each request, such as the system prompt and early history, is billed at a lower rate after the first call. See /guides/prompt-caching-savings/ for when caching pays and when it does not.
Trimming has a cost too. A summary or a cut history can drop a detail the user refers to later, and then the model answers wrong. Test the trimmed version on real conversations before you ship it.
Should I chunk documents to save money?
Sometimes. Chunking sends only the parts a question needs. In a hypothetical with round numbers, a 50,000-token document is split into ten 5,000-token chunks. A retrieval step picks the two chunks most likely to hold the answer, so the answer call sends 10,000 tokens instead of 50,000. That is one fifth of the input for each call.
Chunking has three risks. The retrieval step costs money and can miss the clause that matters, and then the answer is wrong with no error to warn you. Clauses that depend on each other, such as a definition in section 1 used in section 9, can break when a document is split. For tasks that need the whole document, such as a summary of the full text or a check across sections, chunking removes the context the task needs. For more on long-document work, see /guides/llm-long-document-extraction/.
Chunking makes sense when the answer sits in a few known places, the documents are long and the volume is high.
What does a trained model cost per document?
Training for one task changes the price per document, not only the price per token. On a public exam of 510 commercial contracts, where the model must find 10 kinds of passage and quote each one exactly, our Accuracy model scored 0.717. Claude Opus scored 0.635 and Claude Haiku scored 0.584. Measured at list price on 102 held-out contracts from that exam, price per 1,000 documents was $4.50 for our Accuracy tier, $154.49 for Claude Opus, and $4.95 for Claude Haiku.
Claude took that exam with one prompt, no examples and no task training. Our models were fine-tuned for this exam, which shows what training for one task does. It is not a legal product or legal advice, and it does not mean our model beats Claude at everything. On the exam we ran, our fine-tuned models beat Claude. On a narrow task with good data, a fine-tuned model can beat a frontier model, but that is not guaranteed. Fine-tuning is the wrong choice when the task changes every few weeks, when volume is too low to repay training, or when you have no test set to prove the model is better.
If the numbers point at one task, Own Weights can train a model for it, test it against your current model on your own data, and serve it in your own cloud account. Start with the free AI cost audit, which runs on your own machine and uploads nothing. Or book a call and we will go through your numbers together.
Questions
Why are long prompts expensive?
You pay for every input token on every call, so a long prompt costs again each time it runs. API vendors price input per million tokens, and that rate applies to the whole prompt. Check your vendor's current pricing page for the rate.
What does a chatbot cost per conversation?
It depends on how many turns the chat runs, because each turn resends the history. The cost rises faster than the turn count. Count tokens from a sample conversation to get your own figure.
How much does a multi-turn conversation add to token cost?
Each turn adds to everything sent after it, so input tokens grow with the square of the turns. Summarizing old turns and caching the stable prefix both cut the bill. A summary can drop a detail the user needs later, so test it first.
Should I chunk documents to save money?
Only when the answer sits in a few known sections and retrieval finds them reliably. Chunking cuts input per call, but the retrieval step has its own cost and can miss the clause that matters. For whole-document tasks, chunking is usually the wrong fix.
What does it cost to send a whole document to an LLM?
Multiply the document's token count by the input price and by the number of calls. In a hypothetical, a 20,000-token file sent 500 times is 10 million input tokens, or $40 at Claude Opus list input price.