Use a workload equation, not a model price alone
Estimate monthly LLM API cost by calculating the input and output cost of one representative request, then multiplying by effective monthly request volume. Adjust for cached input, retry traffic, and batch pricing when the provider supports them.
Use the DocuShell LLM Cost Calculator to compare source-linked rates across supported providers. Recheck pricing before procurement because model rates change.
monthly cost = effective requests ×
((uncached input tokens × input rate) +
(cached input tokens × cached rate) +
(output tokens × output rate)) / 1,000,000
| Variable | Include | Common forecasting mistake |
|---|---|---|
| Input tokens | Instructions, history, retrieved chunks, tools | Counting only the user message |
| Output tokens | Answers, JSON, tool arguments | Using maximum instead of observed distribution |
| Cached input | Eligible repeated context | Applying the discount to all input |
| Effective requests | User calls plus retries | Ignoring failed calls that consumed tokens |
| Model mix | Routed traffic by model | Pricing every request at one model |
| Non-token fees | Search, images, storage, taxes | Hiding them inside a token estimate |
Start with real request shapes
Measure the system prompt, user message, chat history, retrieved context, tool definitions, and expected output. For document RAG, retrieved chunks often dominate input tokens.
Do not plan from one short demo. Sample routine, long, and failed requests.
Use the visible formula
Per-request cost equals uncached input tokens times the input rate, plus cached input tokens times the cache rate, plus output tokens times the output rate.
Monthly cost multiplies that result by effective requests. If 5 percent of requests are retried, the effective volume is higher than the user-visible volume.
Model more than one scenario
Create a baseline for current traffic, a growth case, and a stress case with longer context and more retries. Compare model choices using the same workload.
The cheapest token rate may not produce the cheapest product if poor output causes repeated calls or more human review.
Track excluded charges
Basic token estimates may not include web search, grounding, images, audio, storage, cache writes, embeddings, reranking, taxes, or negotiated commitments.
List those exclusions beside the number. A precise-looking total with missing categories is not a useful budget.
Reconcile estimate and bill
After launch, compare forecast tokens with provider usage. Break variance into traffic, prompt size, output length, model mix, and retries.
Cost planning gets easier once every estimate states its workload, rate date, and exclusions. Without those, a monthly number is just a guess with a currency sign.
Worked example formula
Assume a request contains 8,000 input tokens and produces 800 output tokens. If 60 percent of the input is eligible for a lower cached-input rate, calculate cached and uncached input separately, add output cost, then multiply by effective requests after retries.
Do not copy prices from this example or an old spreadsheet. Use the current official rate for the exact model and pricing tier. The DocuShell LLM Cost Calculator keeps rate sources and a verification date visible.
Forecasting discipline: publish the workload assumptions and pricing verification date beside every total. A number without its request shape cannot be audited or compared later.
Segment the workload
One average request hides important differences. Separate document summaries, RAG questions, agent steps, classification, and background batch jobs. They have different context sizes, output lengths, latency needs, and model choices.
Forecast each segment, then combine them. This makes it easier to optimize the expensive path without weakening every request.
Add unit economics
Translate monthly spend into cost per document, answer, active user, or resolved support case. Compare API spend with revenue or operational value and include human review time.
Set alerts on both total cost and unit cost. A flat monthly bill can hide falling efficiency as traffic mix changes.
Reconcile continuously
Collect provider usage, application request counts, retry rates, cache hits, and model routing. Compare them with the forecast each month. Update assumptions when prompts, models, retrieval, or pricing changes.
For caching, read how prompt caching reduces LLM cost. For document systems, use the RAG chatbot cost guide and PDF parsing before embeddings. Cost should be evaluated beside answer quality using RAG faithfulness and citation checks.
Frequently Asked Questions
Free Tool
LLM Cost
Estimate AI API spend from tokens, traffic, cache rate, and model choice.
Try LLM CostDocuShell Team
The DocuShell editorial group writes and maintains guides for everyday PDF workflows, with updates made when tool behavior or documented limits change. See our editorial standards for the process behind each article.
Focus: LLM workload modeling and document AI cost planning
Questions or feedback? Get in touch.


