EOR & SaaS · USD

LLM API Token, Prompt Caching & AI SaaS Margin Cost Calculator

Forecast monthly LLM inference bills across budget and frontier model tiers, quantify prompt-caching savings, and verify that AI token COGS stays inside your SaaS gross margin.

✓ Verified Local Engine (3) Reviewed: 2026-11-26

Inputs & Parameters USD

Total LLM completion calls executed across all users or automated workflows per month.
System prompt + RAG context + conversation history (1,000 tokens ≈ 750 English words).
Model-generated response tokens (note: output tokens typically cost 3x–5x more than input tokens).
%
Share of input tokens served from provider prompt cache (typically saves 50%–90% on cached prefixes).
Representative per-million token rates across budget Flash, DeepSeek, Mini, Frontier Pro, and Flagship tiers.
$
Used to evaluate AI inference COGS as a share of recurring subscription revenue.
Total paying accounts generating the monthly API call volume.

Calculated Results Live

Estimated Monthly LLM Bill
$83.35
Combined input (post-cache) + output token cost
Post-AI SaaS Gross Margin
99.43%
Revenue share left after LLM inference bill
Monthly API Bill Split: Input Tokens vs. Output Tokens
Monthly Input Token Spend 34.0% Monthly Output Token Spend 66.0%
Blended Cost per 1,000 Calls $0.83
Monthly Input Token Spend $28.35
Monthly Output Token Spend $55.00
AI Token Spend % of MRR 0.57%

Why Output Tokens and Model Routing Dominate AI Product Economics

Most AI SaaS teams overestimate input token spend and underestimate output tokens (priced 3x–5x higher) and multi-turn agent loops. Routing routine extraction/translation to Flash or DeepSeek tiers while reserving Frontier models for high-stakes reasoning routinely cuts monthly API costs by 70%–85%.

Core Formula: InputCost = (Reqs×InTok/1M) × InPrice × (1 − CacheHit×CacheDisc) | OutputCost = (Reqs×OutTok/1M) × OutPrice
  1. Convert monthly requests × average input/output tokens into millions of tokens.
  2. Apply the provider's prompt-caching discount to the cached fraction of input tokens.
  3. Compare total monthly API spend against subscription MRR to ensure AI COGS stays below 10%–15% for healthy SaaS valuation multiples.

Worked Example: 100,000 Monthly Requests on Frontier Pro vs. Value Tier

An AI workflow SaaS with 400 paying users at $25/mo ($10,000 MRR) runs 100,000 calls/month averaging 2,000 input tokens and 500 output tokens at a 50% cache hit rate.

  • On a Frontier Pro tier ($2.50 in / $10.00 out), prompt caching trims input spend to $312.50 while output costs $500—totaling $812.50/month (8.13% of MRR).
  • Routing 80% of lightweight classification and translation calls to a $0.15/$0.60 Flash or DeepSeek tier drops the blended bill below $220/month.
  • Notice that output tokens account for over 60% of the bill even when input prompts are 4x longer than outputs.

Practical Cost-Optimization Levers for AI Founders & Ops Teams

  • Task-Based Model Routing: Never run translation, JSON formatting, or SEO meta rewrites on flagship reasoning models—reserve expensive reasoning tokens strictly for architecture, code, and QA verification.
  • Structure Static System Prompts First: Place fixed instructions, schemas, and few-shot examples at the exact beginning of every prompt to maximize automatic prompt-cache hit rates (often 60%–85%).
  • Cap Max Output & Thinking Tokens: Explicitly set `max_tokens` and avoid unbounded verbose explanations on automated cron pipelines to prevent runaway monthly API bills.

Frequently Asked Questions

How many words equal 1,000 LLM tokens?

In English prose, 1,000 tokens is roughly 750 words. Non-Latin scripts (Japanese, Korean, Chinese) and dense JSON code consume roughly 1.3x–2.0x more tokens per semantic unit.

Do reasoning / thinking tokens count as input or output tokens?

Most providers bill hidden chain-of-thought reasoning tokens at the higher OUTPUT token rate—include estimated thinking tokens inside Average Output Tokens when modeling reasoning models.

What AI COGS percentage is healthy for a subscription SaaS?

Aim to keep LLM inference below 10%–15% of MRR so that after payment/MoR fees (5%–7%) and cloud hosting, your overall SaaS gross margin stays above 75%.

Important Notice: LLM provider pricing, cache write surcharges, and context-length tier surcharges evolve rapidly. Verify current per-million token rates on each provider's official pricing page.