LLM API margin calculator

Reselling or wrapping an LLM API for a flat per-call price? Token-billed models can cost more than you charge on a big prompt. Punch in the numbers and see your real margin — and the exact prompt size where you start losing money.

Prices are USD per 1M tokens (input / output).
Cost / call
Margin / call
Margin %
Break-even input tokens

Want to fix it, not just measure it? The AI API Pricing Kit bundles this calculator + a full Excel cost/margin model + drop-in margin-guard code that rejects oversize prompts before they cost you, plus a quick-start. Get the kit — €19 →
How the math works (and why flat pricing leaks)

cost = (input_tokens × input_price + output_tokens × output_price) / 1,000,000. A flat per-call price is fine until a prompt gets big: at $25/1M output, just 6,000 output tokens already costs $0.15. The break-even figure above is the largest input prompt (at your current output size) before a single call costs more than you charge. Above it, every call loses money. Fixes: cap input/output size, or switch to usage-based pricing. Add a margin buffer for prompt-caching misses, retries, and fallbacks.