AI Startup Gross Margin and LLM Inference Costs: Where an $18k/Month OpenAI Bill Really Goes
Most of the fix for a large OpenAI bill is accounting and ordering. Split production from R&D, tag every call, then pull caching, Flex, routing and trimming in that order. Worked through on one $18,000 bill.
Start by splitting the bill, not cutting it. Put production calls in their own OpenAI project so only they count as cost of goods sold, tag every call by feature and customer, and only then pull the cost levers in order of effort: prompt caching, Batch and Flex discounts for work that can wait, routing simple tasks to cheaper models, and trimming output. On the worked example below, an $18,000 monthly bill falls to about $10,100, and production inference falls from $13,500 to about $6,850, which lifts gross margin at $30,000 MRR from 40 percent to 77 percent. A specialised model you own is the last lever, not the first, and at this spend it does not yet pay.
Why the number investors see is probably wrong
An OpenAI invoice is one line, but it pays for two different things. Some of it serves customers: the calls your product makes when someone uses it. The rest is the cost of building the product: evaluation runs, staging, developers testing prompts, internal tools. Only the first belongs in cost of goods sold. CRV, in a July 16, 2026 guide for founders on inference costs, tells them to treat "every model call as a line item in your cost of goods sold", meaning every production call. The engineering spend is R&D, the same way a developer's laptop is.
OpenAI's own tooling makes the split straightforward. Its production best-practices guide suggests "separate projects for your staging and production environments" and says you can "set custom rate and spend limits per project." It recommends a project service account for each application rather than an individual developer's key, and its Usage page reports spend by key. A key created before December 20, 2023 does not have usage tracking turned on by default, which is worth checking before you trust any breakdown.
The split does not save a dollar, but it changes the reported margin. In the example used throughout this piece, a quarter of the bill is internal work. Moving it out of COGS takes the inference cost against revenue from $18,000 to $13,500.
Where an $18,000 bill tends to go
There is no published measurement of how a typical startup's OpenAI spend divides across features or customers. Your own tagging is the only reliable source. What follows is an assumed but realistic shape for a 12-person B2B product running on gpt-6.1-sol, which OpenAI's pricing page lists at $2.00 per million input tokens, $0.10 cached and $10.00 output.
| Line | Monthly cost | Share of bill | Accounting |
|---|---|---|---|
| Research agent (customer-facing) | $7,000 | 39% | COGS |
| Document extraction pipeline | $3,500 | 19% | COGS |
| Support chat | $2,000 | 11% | COGS |
| Ticket classification | $1,000 | 6% | COGS |
| Evals, staging, internal tools | $4,500 | 25% | R&D |
The production $13,500 is assumed to be 3 billion input tokens ($6,000) and 750 million output tokens ($7,500). The point of the table is the pattern, not the numbers: one feature usually dominates, and some of the spend is work nobody is waiting on.
Tagging is cheap to add. A gateway such as LiteLLM can attach team and feature metadata to every request, and Langfuse can then slice cost by "the metadata you attached (team, feature, user)", as a February 2026 Pluralsight guide shows. Add the customer ID too. On GPT-5.6 and later, OpenAI's caching guide says the optional prompt_cache_key can keep separate cache accounting per customer, which also tells you which accounts cache well. Cost per customer matters because if a handful of accounts on flat plans drive most of the agent's spend, the fix is a usage tier or cap, not engineering.
How the four cheap levers work, in order
| Lever | Effort | Saving in the example | Main risk |
|---|---|---|---|
| Prompt caching | Hours: reorder prompts | $2,988 (22% of production) | Write charge on low-reuse prefixes |
| Flex or Batch | Days: make jobs asynchronous | $1,363, plus $1,250 of R&D | Slow responses, 429s on Flex |
| Routing by task | Weeks: build evals first | $1,518 | Quality drop on misrouted tasks |
| Output and context trimming | Weeks: product changes | $778 | Shorter answers users notice |
| Specialised model | Months: data, training, serving | Not yet positive at this spend | Engineering time, ops burden |
Each saving applies to what is left after the lever before it, at OpenAI's list prices. Here is how each one works and where the numbers come from.
Prompt caching comes first because it often needs only a reordering of the prompt. OpenAI's caching guide says cached input is "discounted up to 95%." On GPT-5.6 and later the minimum cacheable prompt is 1,024 tokens, and the cache matches the prefix exactly: change anything before a breakpoint and nothing after it is served from cache. So the guide's advice is to "put stable developer instructions and shared reference material first," with timestamps and user-specific data at the end. The newer models also charge for the first write: 1.25 times the normal input rate for the default 30-minute cache, 2.5 times for 12 hours. Reads cost 0.1 times the input rate, or 0.05 times on GPT-6.1 Sol and a few other models. Caching pays only where a long prefix repeats often enough to be read many times per write.
In the example, assume 1.8 billion of the 3 billion monthly input tokens are a stable prefix of system instructions, tool definitions and reference material, and that 90 percent of those are served as reads. Reads cost $162, writes $450 and the uncached 1.2 billion tokens $2,400. Input falls from $6,000 to $3,012, and production from $13,500 to $10,512.
Batch and Flex halve the price of work that can wait. OpenAI's Batch guide offers a "50% cost discount compared to synchronous APIs" in exchange for results "within 24 hours," on a separate rate-limit pool. Flex prices tokens "at Batch API rates" for ordinary requests, "in exchange for slower response times and occasional resource unavailability," and OpenAI does not charge for requests it turns away with a 429. Flex is in beta with limited model availability, and OpenAI names "model evaluations, data enrichment, and asynchronous workloads" as the fit.
On stacking, the documents differ in what they say. The Flex guide says it comes "with additional discounts from prompt caching." The pricing page lists a cached-input rate in its Batch column, but the Batch guide does not mention caching, so check an invoice before counting on both. In the example, the extraction pipeline moves to Flex, saving $1,363, and the eval runs move to Batch, cutting $2,500 of R&D spend to $1,250.
Routing sends each task to the cheapest model that passes your evals. "Model routing sends simple queries to cheap models and escalates to expensive ones only when needed," in CRV's phrasing. The academic evidence is more modest than vendor claims: the RouteLLM paper reports cost reductions of "over 2 times in certain cases" without loss of quality. The discipline is the evals. OpenAI's model optimization guide says to run them "against test inputs like you expect to see in production", which means before and after every routing change. In the example, ticket classification moves to gpt-6-luna, which costs one-twentieth of Sol on every rate ($0.10 in, $0.50 out), and support chat moves to gpt-6.1-terra at half price. Together that saves $1,518.
Trimming output and context goes after the price-table changes because it touches product behaviour. CRV notes that "output tokens cost materially more than input tokens" and that "turn 30 of a multi-step agent costs more than turn one for the same user-visible task." Capping response length, asking for compact structured output and pruning agent history all bite here. Cutting the agent's output tokens by 20 percent saves $778.
These are the savings on this example's assumptions, not a forecast for yours. The only measured range in the sources is RouteLLM's for routing. Combined savings from all four levers on real startup traffic have not been published by an independent party.
What the split and the levers do to gross margin
The figures below count inference as the only cost of goods sold, so real margins will be lower once hosting and support are added. Each is given three ways: with the whole $18,000 in COGS, with only the $13,500 of production calls, and with production after the four levers at about $6,850.
At $30,000 MRR, gross margin moves from 40.0 percent to 55.0 percent with the split alone, and to 77.2 percent after the levers. At $60,000 MRR the same steps give 70.0, 77.5 and 88.6 percent. At $100,000 MRR they give 82.0, 86.5 and 93.1 percent.
For comparison, Bessemer's State of AI report of August 13, 2025 found that its fast-growing "Supernovas" average "only 25% gross margins," often negative, and its steadier "Shooting Stars" about 60 percent. The CRV guide cites 70 to 90 percent for SaaS and calls "a 50 to 60 percent gross margin" defensible "if you can articulate a clear path toward expansion." ICONIQ's public 2025 State of AI page says inference and cloud costs come to dominate spend as products mature, but gives no share of revenue.
The arithmetic says something uncomfortable. At $30,000 MRR this bill is a real problem, and the split alone gets it only to 55 percent. At $100,000 MRR it is close to SaaS-like before any engineering work. The urgency depends on revenue, not on the bill.
When owning a specialised model makes sense
After the four levers, the largest remaining production line is the research agent at about $4,670 a month. A smaller model fine-tuned for one repeated task is the next lever, but the break-even includes people, not just GPUs. One H100 on a Together dedicated endpoint lists at $5.49 an hour, or about $3,950 for a 30-day month, and two for redundancy about $7,900. A quarter of one engineer's time, at an assumed fully loaded cost of $200,000 a year, adds about $4,170 a month. Training itself is cheap by comparison: Together lists supervised fine-tuning of Llama 3.1 8B from $0.34 per million tokens, with a $4.00 minimum per job.
On those numbers a repeated task needs to cost at least $8,000 to $12,000 a month on the API before owning a model pays, and an open-ended agent is the hardest workload to hand to a small model. CRV tells most seed-stage founders to "default to managed APIs" and puts self-hosting breakeven against managed open-weight providers at "well over a billion tokens per month on a single H100." OpenAI is no exit route: its fine-tuning platform "is no longer accessible to new users," and its deprecations page says existing customers lose the ability to create jobs on January 6, 2027.
Managed services sit between the two. Parsec, a small language model lab, offers a service that traces production requests, builds datasets and evaluations the customer approves, post-trains a smaller model and serves it, sending low-confidence requests to a frontier model. Its inference page says "Weights: Yours. Download them," and its routers page claims a first post-trained model in about four weeks, with no baseline given. It publishes no price for the service, its models run on a shared cluster, and its only code sample uses the Anthropic SDK.
What to put on the investor slide
Investors want a trend more than a number. CRV says "directional improvement across margin metrics often carries more weight at early stages than hitting a specific benchmark," and suggests showing "quarter-over-quarter improvement, even by a few points." Four things make that case:
- Gross margin with only production inference in COGS, with the R&D share shown separately.
- Cost per unit of work, such as dollars per completed agent task, month over month.
- The dated plan: caching and Flex this month, routing with evals next month, trimming the month after, with before-and-after figures for each.
- The price trend. OpenAI's pricing page lists
gpt-6.1-solat half the input and output price ofgpt-5.6-sol, and CRV records OpenAI's 80 percent cut to o3 input pricing, from $10.00 to $2.00 per million tokens.
Bottom line
Below about $50,000 MRR, the bill is a pricing and margin problem. Split production from R&D this week, tag by feature and customer, put usage limits on heavy accounts, and pull caching and Flex first. Between $50,000 and $100,000 MRR, the same four levers in order should bring inference COGS into the range investors accept, and the slide should show the trend. Above that, or once one narrow, repeated task costs well over $8,000 a month after the levers, price a specialised model with engineering time included. Until then, stay on the managed API.
Sources
- OpenAI, Prompt caching guide: https://developers.openai.com/api/docs/guides/prompt-caching
- OpenAI, API pricing: https://developers.openai.com/api/docs/pricing
- OpenAI, Batch API guide: https://developers.openai.com/api/docs/guides/batch
- OpenAI, Flex processing guide: https://developers.openai.com/api/docs/guides/flex-processing
- OpenAI, Production best practices: https://developers.openai.com/api/docs/guides/production-best-practices
- OpenAI, Model optimization: https://developers.openai.com/api/docs/guides/model-optimization
- OpenAI, Deprecations: https://developers.openai.com/api/docs/deprecations
- CRV, LLM Inference: What AI Founders Should Know About Costs: https://www.crv.com/content/llm-inference
- Bessemer Venture Partners, The State of AI 2025: https://www.bvp.com/atlas/the-state-of-ai-2025
- ICONIQ, 2025 State of AI: https://www.iconiq.com/growth/reports/2025-state-of-ai
- Ong et al., RouteLLM: Learning to Route LLMs with Preference Data: https://arxiv.org/abs/2406.18665
- Pluralsight, Meter before you manage: https://www.pluralsight.com/resources/blog/ai-and-data/how-cut-llm-costs-with-metering
- Together AI, Pricing: https://www.together.ai/pricing
- Parsec, Inference: https://parseclab.ai/inference/
- Parsec vs routers: https://parseclab.ai/compare/routers/
- Parsec vs your own GPUs: https://parseclab.ai/compare/own-gpus/