How to Cut Your LLM API Costs and Protect Your SaaS Margins
A cheaper model can swing gross margin from roughly 30% to 85%, but only if you model your real token mix first: output tokens, not the headline input price, decide your unit economics.
Jun 27, 2026 · 5 min read
Key takeaways
Agent loops, not chat, drive most spend: a single user task can fire 1,000+ calls and burn millions of tokens.
Headline input prices mislead. Output tokens often cost 3x to 6x more and quietly dominate the bill.
One founder who moved heavy backend work off a premium API reported cost per user run falling from about $0.42 to $0.05.
The number that matters is blended cost per active user, not cost per call.
Model a provider swap against your own usage before you touch production code.
Why are LLM API costs eating SaaS margins?
Building is cheap now. Running is not. A founder writing on Indie Hackers described launching a lead-enrichment micro-SaaS in a weekend, then watching the API bill consume about 70% of subscription revenue. The culprit was not chat. It was autonomous agent loops that read output, evaluate it, and run again, sometimes 50 times per task. At that volume a single heavy user can push monthly recurring revenue negative.
This is the trap of usage-based costs sitting under a flat subscription price: your revenue per user is fixed, but your cost per user is not.
The mistake: optimizing the input price
When founders compare models, they usually look at the input price per million tokens. That is the wrong anchor. In agent workflows the model reads a short instruction and writes long reasoning, tool calls, and revisions. Output tokens are where the money goes, and output is typically priced 3x to 6x higher than input.
So a model that looks cheap on input can still wreck your margin if it is verbose. The blended rate, input plus output weighted by how your product actually uses them, is the only number worth comparing.
How much can a model swap actually save?
The Indie Hackers writer moved heavy backend logic to a lower-cost model and kept a premium model only as an optional fallback. The reported result, which is illustrative rather than a guarantee for your workload:
Cost per 1M agent tokens: from roughly $3.00 to $15.00 down to $0.14 to $0.50.
Average cost per user run: from about $0.42 to $0.05.
Gross margin: from around 30% to 85%.
The lesson is not 'use this specific model.' Prices and model quality move every month. The lesson is that the gap between providers is now wide enough to flip a business from unprofitable to healthy, and most teams never run the math.
How do you model the switch before you ship it?
Do it on paper, or in a simulator, before you change code:
1Measure your real token mix per task: average input tokens and output tokens for a typical user action.
2Multiply by each provider's input and output price to get a blended cost per task.
3Multiply by tasks per active user per month to get cost per user.
4Subtract from your price per user. That is your true gross margin per seat.
Run that for two or three candidate models. The cheapest headline price rarely wins once output-heavy agent loops are included. This is exactly the kind of side-by-side you can build in Calcaas to compare providers and stress-test margins before committing.
What about lock-in and reliability?
A single-provider stack is also a single point of failure. Routing heavy backend work to a cost-efficient model while keeping a premium model for the cases that need it gives you both better margins and a fallback if one provider has an outage or a price change. Model-agnostic architecture is becoming the default for cost-conscious builders, and the cost modeling above is what tells you which work belongs where.
Takeaway: Do not pick a model on its input price. Model your blended cost per active user, then choose: you can simulate the whole comparison in Calcaas before you write a line of code.
Frequently asked questions
Why are output tokens more expensive than input tokens?
Generating tokens is more compute-intensive than reading them, so providers price output higher, often 3x to 6x the input rate. In agent loops that produce long reasoning and tool calls, output dominates the bill, which is why blended cost matters more than the headline input price.
How do I calculate cost per user for an AI feature?
Measure average input and output tokens per task, multiply by the provider's per-token prices to get a blended cost per task, then multiply by how many tasks an active user runs per month. Compare that to your price per user to see your real gross margin.
Is switching to a cheaper LLM worth the quality risk?
Often yes for backend work like parsing, classification, and bulk processing, where a cheaper model performs comparably. Keep a premium model for the user-facing steps that need it. Modeling cost per user for each option tells you where the trade is safe.
Can I really hit 85% gross margin on an AI product?
It is possible, and one founder reported moving from about 30% to 85% by shifting heavy agent loops to a cheaper model. Your result depends on your token mix and pricing, so treat any single figure as illustrative and run your own numbers. Place this JSON-LD in a `<script type="application/ld+json">` tag in the page head.