AI Startup Gross Margins vs Inference Costs: What Startups Do, Lever by Lever, and When a Model Pays
Most of the gap between a 45% AI margin and SaaS levels closes with caching, token limits, batch and routing. Pricing keeps it closed. Owning a model is a later, separate decision, and "own model" means two different things.
AI startups whose inference bill is eating gross margin are mostly fixing it in the same order: cache the repeated part of every prompt, cap the tokens the model writes, push anything not urgent to half-price batch endpoints, and route easy requests to a model that costs a fraction as much. Then they change pricing so their heaviest users stop being their least profitable ones, as Cursor, Replit and GitHub Copilot all did in 2025. On today's list prices, those four engineering levers alone take the illustrative support product modelled below from a 45% gross margin to about 83%, provided quality holds on the cheaper paths. Owning a model comes last, and it splits into two decisions with very different thresholds.
Where AI gross margins sit, and how much to trust the examples
The benchmark investors use is still SaaS. CRV, in a July 16, 2026 guide for founders, says investors have "recalibrated their expectations from the 70 to 90 percent SaaS benchmark," and that "a 50 to 60 percent gross margin is defensible today" if a company can show a path to expansion through "model routing, distillation or changes to the pricing structure." Bain Capital Ventures puts best-in-class SaaS at "80%+" and estimates that compute for AI apps runs "~1-3x software hosting costs." The reason is simple accounting: inference is cost of goods sold, and it scales with every request a customer makes.
The company examples are rougher. TechCrunch reported in August 2025 that Windsurf's gross margins were "very negative," according to one person close to the company, and quoted Mocha founder Nicholas Charriere saying margins on "code gen" products "are either neutral or negative." The same report said people believed Cursor, Replit and Lovable faced similar pressure, without numbers. The specific figures founders pass around, such as Replit swinging from negative to positive margins within 2025 or Cursor paying its model provider more than it earned, trace to paywalled reporting (The Information ran "Replit's Margins Illustrate the High Costs of Coding Agents") and to secondary summaries of it. None of these companies has published audited margins. Read them as evidence that the problem is common, not as benchmarks.
What the companies have published is what they did about it, and that is the more useful record.
Why the bill grows faster than revenue
Two mechanics explain most runaway bills. The first is that output is expensive. On Anthropic's price list, Claude Sonnet 5.5 costs $2 per million input tokens and $10 per million output tokens, and the ratio is similar across providers. CRV goes as far as saying "your product's output-to-input ratio determines more about your inference bill than which model you choose."
The second is that agents resend their history. CRV notes that in agentic workflows "the number of input tokens grows with each conversation turn," so "turn 30 of a multi-step agent costs more than turn one for the same user-visible task." A flat subscription price collides with both: the customers who use the product most generate the longest contexts and the most output.
Cursor's explanation of its June 2025 pricing change said the same thing in its own words: "New models can spend more tokens per request on longer-horizon tasks."
The levers, in the order startups pull them
Prompt caching. Providers charge far less for a prompt prefix they have seen recently. Anthropic bills a cache hit at 0.1x the base input price on most models and 0.05x on Sonnet 5.5 and Opus 5.5; writing to the five-minute cache costs 1.25x, so it pays off after a single reuse. OpenAI's cached input for gpt-6-luna is $0.01 per million against $0.10 standard. The catch is ordering: CRV warns that putting dynamic content before static blocks "breaks cache reuse entirely." System prompt, tool definitions and shared documents go first; the user's turn goes last. It is a code change, and it helps most when every request carries a long fixed preamble.
Output and context control. Capping response length, trimming conversation history and summarising agent context attack the two mechanics above directly. The saving depends entirely on how verbose the product is today, which is why the first step is to measure cost per feature and per customer before cutting anything.
Batch endpoints. Anthropic's Batch API takes 50% off input and output, and its pricing page says the caching discount stacks with it. OpenAI's Batch and Flex rates are half of Standard, and for its GPT-6 family it now lists a third option: eligible background requests run 30% below Standard with a two-hour window and 40% below with eight hours. Overnight summaries, evaluations and document processing belong here.
Routing. Most traffic in most products is easy. CRV's example sends "what are your pricing plans" to a $0.10 model and "why is my integration throwing errors" to a $3.00 one. Bain Capital Ventures makes the same point: "The total cost of inference comes down when models of varying cost are blended within the product," and names MagicSchool as an app that uses different models for different prompts. The price gap that routing exploits is now very wide. Claude Haiku 5.5 lists at $0.10 input and $0.50 output for prompts under 100,000 tokens, a twentieth of Sonnet 5.5. Routing costs more engineering than the first three levers because someone has to decide, and test, which requests the cheap model can handle.
Pricing. This lever changes revenue rather than cost. Cursor moved its Pro plan in June 2025 "from request-based pricing to $20 of included usage," valued at API prices, with "unlimited" applying only to its Auto mode; it later refunded surprise charges incurred between June 16 and July 4. Replit replaced a flat $0.25 per Agent checkpoint with effort-based pricing in which complex tasks "may cost more than $0.25," saying the price now "aligns better with the actual work the Agent performs." Its Core plan is $20 a month with $20 of credits for more powerful models. GitHub started billing Copilot premium requests on June 18, 2025: 300 a month on Pro, 1,500 on Pro+, $0.04 for each one beyond that. The shared pattern is a subscription that includes a usage allowance priced near cost, with metered usage above it.
Revenue that does not run through a model. Hosting, marketplaces and services carry their own margins and raise the blended figure even when the AI feature stays expensive. It is a business-model choice, not an engineering one, and it only helps if customers want the adjacent product.
| Lever | What it cuts | Effort | Time to impact |
|---|---|---|---|
| Prompt caching | Repeated input, to 0.1x or 0.05x | Prompt reordering | Days |
| Output and context caps | Output and resent history | Product and prompt changes | Days to weeks |
| Batch or background | 30% to 50% on non-urgent calls | Job queue | Weeks |
| Routing | Easy requests to a model ~20x cheaper | Classifier plus evaluation | Weeks to a quarter |
| Usage-based pricing | Losses on heavy users | Pricing, billing, comms | A quarter |
The discount figures come from Anthropic's and OpenAI's price lists; how much of a given product's traffic each lever reaches is specific to that product and has to be measured.
A worked margin model
Take a business-to-business support agent with $100,000 in monthly revenue and three million requests a month. Each request sends 6,000 input tokens, of which 4,000 are a fixed system prompt, tool definitions and help-centre excerpts, and 2,000 are the customer's conversation. Each returns 500 output tokens. Everything runs on Claude Sonnet 5.5 at list price. Hosting, vector search and other non-inference cost of goods add $4,000 a month. These are assumptions chosen to be typical of the pattern, not data from a real company.
At baseline a request costs $0.017: $0.012 of input and $0.005 of output. That is $51,000 a month, total cost of goods is $55,000, and gross margin is 45%.
- Cache the 4,000-token prefix. Assume 95% of requests hit the cache at $0.10 per million and 5% write it at $2.50. The prefix falls from $0.008 to $0.00088 per request, and a request now costs $0.00988. Inference is $29,640; margin rises to 66.4%.
- Cap output at 350 tokens. Output falls from $0.005 to $0.0035. A request costs $0.00838, inference is $25,140, and margin is 70.9%.
- Batch the 10% of requests that are not real time (ticket summaries, tagging) at half price. Inference is $23,883; margin is 72.1%.
- Route half of the remaining real-time requests to Haiku 5.5, with the same caching and output cap. Those requests cost $0.000438 each. Inference is $13,161; margin is 82.8%.
Caching does the most work here because the fixed prefix is two thirds of every prompt; a product with short prompts would gain less from step 1 and relatively more from step 4. The routing step assumes Haiku 5.5 answers half the traffic as well as Sonnet 5.5 does, and that has not been measured for this or any named workload. Two other caveats matter. Anthropic says its models from Claude 4.7 on use a tokenizer that produces about 30% more tokens for the same text, so token counts carried over from an older model will understate the bill. And usage pricing does not appear in the model at all, because what it protects against is the tail of heavy users, which an average hides.
What "own model" actually means
Most founder guides treat a custom model as the last lever, reserved for companies at Cursor's scale. That conflates two different things.
Self-hosting on your own GPUs is an infrastructure decision. CRV calculates that, against managed open-weight providers such as Together, self-hosting breaks even only at "well over a billion tokens per month on a single H100," using Runpod GPU prices and counting compute alone. It leaves out what it calls "a team of two to five engineers burning cycles on GPU infrastructure management." The example product above sends about 19.5 billion tokens a month, so it clears the volume bar easily. But volume is not the binding constraint: the open model has to match quality on the hard requests, and the team has to run the cluster. For reference, Together rents a dedicated H100 at $5.49 an hour, about $3,950 for a 30-day month; how many the example workload would need has not been measured.
A specialised model trained on your own traffic is a model decision, and it does not require owning hardware. Training a small open model is cheap: Together charges $0.34 per million tokens for supervised fine-tuning on models up to 16 billion parameters, with a $4 minimum. The expensive parts are building the dataset and evaluation from production traffic and keeping the model current. Cursor's version is at the far end. Its Composer model, announced October 29, 2025, is a mixture-of-experts model "specialized for software engineering through reinforcement learning," trained across "hundreds of thousands of concurrent sandboxed coding environments" on thousands of GPUs. Cursor's own footnote says GPT-5 and Sonnet 4.5 still outperform it on Cursor's internal benchmark; its claim is speed, four times faster than similar models. Character.AI, which serves around 20,000 queries a second, said in June 2024 that it had cut serving costs "by at least 33X" since 2022, crediting work on its KV cache and what it calls "inter-turn caching." Neither is a template for a seed-stage company.
Managed services now sell the middle path. Parsec, a small language model lab, post-trains compact models on a customer's production traffic and serves them on a shared cluster, sending requests its model is unsure of to a closed frontier model. It says customers have "nothing to procure, tune, or babysit" and that they own and can download the weights. Its comparison page claims 60% savings "on real workloads" against the smaller savings it attributes to typical routers, but it defines no workload or baseline, and it publishes no price for the service. Separately, for agent workloads where context grows every turn, Parsec sells a context layer for coding agents, free to start according to its site, and publishes its own benchmark of it: on 100 SWE-bench Verified tasks with Claude Sonnet 4.6 and only the compression layer changed, total cost was about 39% lower. That is Parsec's benchmark, not an independent one; the repository can be re-run, and no independent re-run has been published.
No like-for-like measurement of routing against a specialised model on the same traffic, with a stated method, has been published. Until one exists, the practical test is your own: hold out a sample of real requests, score the cheap path against the current one, and decide on the numbers.
What to do, by stage
This week: measure cost per feature and per customer, reorder prompts so the fixed parts are cached, and cap output length. Caching changes nothing the user sees; check output caps against a sample of real answers before shipping them.
This quarter: move non-urgent work to batch or background endpoints, build a router with an evaluation set behind it, and replace any "unlimited" plan with included usage plus metered overage. CRV's advice on what investors want is a few points of improvement per quarter and a written plan, more than a particular number.
When a repeated workload dominates the bill and routing has stalled: test a specialised model on that workload, managed or self-trained. Consider your own GPUs only once volume is well past the billion-token mark, the open model has passed your evaluation, and you have people to run it.
Bain Capital Ventures adds a counterweight worth keeping in mind: falling prices fix some of this without any work. When Mixtral-8x7B's price fell from $2 to $0.24 per million tokens within days of its December 2023 launch, BCV calculated that was "the equivalent of increasing gross margin from 60% to 78%." CRV records OpenAI cutting o3's input price by 80% in one announcement. Those gains go to companies whose stack can switch models quickly, which is another argument for routing.
Bottom line
If your margin is under 50% and you have not cached your prompts or capped output, do that first; it is the largest and cheapest gain for most products. If you sell flat-rate or unlimited plans, move to included usage with metered overage this quarter, as Cursor, Replit and GitHub did. If much of your traffic is easy, route it, but only behind an evaluation set. Treat a specialised model as the next step when one repeated workload dominates spend and routing has run out, and treat your own GPUs as a separate, later decision that needs both billion-token volume and an infrastructure team.
Sources
- CRV, LLM Inference: What AI Founders Should Know About Costs: https://www.crv.com/content/llm-inference
- Bain Capital Ventures, Gross Margin is a BS Metric: https://baincapitalventures.com/insight/gross-margin-is-a-bs-metric/
- TechCrunch, The high costs and thin margins threatening AI coding startups: https://techcrunch.com/2025/08/07/the-high-costs-and-thin-margins-threatening-ai-coding-startups/
- The Information, Replit's Margins Illustrate the High Costs of Coding Agents: https://www.theinformation.com/articles/replits-margins-illustrate-high-costs-coding-agents
- Anthropic, Pricing: https://platform.claude.com/docs/en/about-claude/pricing
- OpenAI, API pricing: https://developers.openai.com/api/docs/pricing
- Cursor, June 2025 pricing update: https://cursor.com/blog/june-2025-pricing
- Cursor, Composer: https://cursor.com/blog/composer
- Replit, Effort-based pricing: https://replit.com/blog/effort-based-pricing
- Replit, Pricing: https://replit.com/pricing
- GitHub Docs, Copilot requests: https://docs.github.com/en/copilot/concepts/billing/copilot-requests
- Character.AI, Optimizing AI inference at Character.AI: https://blog.character.ai/optimizing-ai-inference-at-character-ai/
- Together, Pricing: https://www.together.ai/pricing
- Parsec vs routers: https://parseclab.ai/compare/routers/
- Parsec vs your own GPUs: https://parseclab.ai/compare/own-gpus/
- Parsec, Inference: https://parseclab.ai/inference/
- Parsec, coding-agent context layer: https://getparsec.ai/
- Parsec's public benchmark (code-compression-bench): https://github.com/daseinlabs/code-compression-bench