AI Unit Economics

LLM API Cost & AI SaaS Margin Calculator

Compare OpenAI, Claude, Gemini & DeepSeek token bills with Prompt Caching, Batch API discounts, and live gross margin impact.

Quick presets:

Workload & Revenue Inputs

Monthly Volume

60,000 reqs

108M in · 36M out

Lowest Monthly Cost

$25.40

GPT-6 Luna (99.7% margin)

Projected MRR

$10,000

Spread: up to $1,991/mo saved via routing

Provider & Model Cost Matrix (Sorted Lowest to Highest)

ModelMonthly CostCost / UserGross MarginRelative Cost
GPT-6 Lunabudget

OpenAI · $0.1/$0.5 per 1M · 200K ctx

$25.40saved $3.40$0.05199.7%
Claude Haiku 5.5budget

Anthropic · $0.1/$0.5 per 1M · 200K ctx

$25.40saved $3.40$0.05199.7%
DeepSeek-V4.1-Flash (Off-Peak)budget

DeepSeek · $0.15/$0.6 per 1M · 128K ctx

$32.24saved $5.56$0.06499.7%
Gemini 3.8 Flashbalanced

Google · $0.75/$3.75 per 1M · 1M ctx

$190.49saved $25.51$0.38198.1%
DeepSeek-V4-Pro (Peak)balanced

DeepSeek · $1.32/$3.96 per 1M · 128K ctx

$237.22saved $47.90$0.47497.6%
GPT-6.2 Solbalanced

OpenAI · $2/$10 per 1M · 400K ctx

$504.18saved $71.82$1.0195.0%
Claude Sonnet 5.5balanced

Anthropic · $2/$10 per 1M · 200K ctx

$504.18saved $71.82$1.0195.0%
Claude Opus 5.5flagship

Anthropic · $4/$20 per 1M · 200K ctx

$1,008.36saved $143.64$2.0289.9%
Gemini 4 Argon (Dec 1 rate)flagship

Google · $4/$20 per 1M · 2M ctx

$1,008.36saved $143.64$2.0289.9%
GPT-6.2 Astraflagship

OpenAI · $8/$40 per 1M · 400K ctx

$2,016.72saved $287.28$4.0379.8%

Vetted tools founders use to lower costs and automate compliance. Some links may be partner links at zero extra cost to you.

Optional Pro Templates · $19 one-time

Founder Unit Economics Pack (Notion + Excel + Sheets)

Download the investor-ready 3-year AI SaaS financial model, cohort churn tracker, and agency pricing templates.

Get the Pro Pack

How This Calculator Works & Key Benchmarks

Estimating real-world AI API costs requires looking beyond headline per-million-token pricing. Output tokens typically cost 4x to 6x more than input tokens, while prompt caching and asynchronous Batch APIs can cut monthly token spend by 50% to 85%. Use this interactive matrix to model your exact Monthly Active Users (MAU), request volume, and subscription gross margin before shipping AI features.

Token Billing Formula

Monthly Cost = [(Input Tokens / 1M) × Input Rate × (1 - Cache Hit % × Cache Discount) + (Output Tokens / 1M) × Output Rate] × Batch Multiplier

Actionable Founder Takeaways

  • Output tokens dominate AI COGS: cutting verbose completions by 30% often saves more than switching providers.
  • Prompt caching works best when you reuse long system instructions, tool schemas, or RAG context blocks across turns.
  • Target at least 75%–80% gross margin after LLM costs so you still have room for payment fees, infra, and customer acquisition.
  • Use model routing: send 80% of lightweight extraction/classification tasks to budget models and reserve flagship models for complex reasoning.

Frequently Asked Questions

How many tokens is 1,000 English words?
As a standard rule of thumb, 1,000 English words equals roughly 1,300 to 1,400 tokens (about 4 characters or 0.75 words per token). Code, JSON, and non-English languages generally consume more tokens per word.
Why are LLM output tokens much more expensive than input tokens?
Generating output tokens is memory-bandwidth bound and sequential (one token at a time per user), whereas input prompt tokens are processed in parallel during prefill. That is why output rates are usually 4x to 6x higher.
When should I use Batch API pricing?
Batch APIs offer a 50% discount in exchange for asynchronous completion (typically within 24 hours). They are ideal for nightly summarization, bulk dataset classification, SEO content generation, and offline evaluations.
What is a healthy gross margin for an AI SaaS startup?
Traditional B2B SaaS achieves 80%–85% gross margins. For AI-native SaaS, investors generally look for 65%–75%+ gross margins at scale after accounting for LLM inference, embeddings, and payment processing fees.