Loading...


Updated 8 Oct 2026 • 6 mins read

SaaS cost of goods sold is the direct cost of delivering the service: hosting, embedded third-party software, delivery-side support, payment processing, and increasingly AI inference. This guide defines what belongs in COGS and what does not, gives gross margin benchmarks, works through a US example, and sets out how to reduce it.
Software was supposed to be the business with no cost of goods. Build it once, sell it a million times, and every incremental customer costs almost nothing to serve. That story produced the 80 percent gross margins investors came to expect, and for a while it was roughly true. It is less true now. Cloud infrastructure scales with usage, embedded third-party services bill per call, support scales with customers, and AI inference has reintroduced something software had not seen before: a real marginal cost per unit of product delivered.
This guide is for the finance and engineering leaders who have to manage that. It defines SaaS cost of goods sold line by line, including the edge cases where most companies disagree, gives benchmarks for what COGS and gross margin should look like in 2026 for traditional and AI-native products, works through a US example, and sets out how to reduce it. It builds on our analysis of how AI spend hits SaaS profitability, which covers the AI component in depth. We are not accountants; the classifications below reflect common practice and should be confirmed with yours.
The short answer: SaaS cost of goods sold, usually reported as cost of revenue, is the direct cost of delivering the software service to paying customers. It typically includes production cloud infrastructure, third-party software and APIs embedded in the product, the delivery portion of customer support and success, payment processing fees, professional services and onboarding, and, increasingly, AI model inference consumed by customer-facing features. It excludes research and development, sales and marketing, and general and administrative costs. Investors expect SaaS gross margin (revenue minus COGS, over revenue) of 70 to 80 percent, with best-in-class above 80 percent and AI-native products often at 50 to 65 percent. Cloud is usually the largest COGS line at 6 to 12 percent of revenue for healthy traditional SaaS, and reducing COGS starts with attributing it per customer and per unit of usage.
The principle is direct cost of delivering the service to customers. The table applies it to the lines that appear in nearly every SaaS company, including the ones where practice varies.
| Cost line | COGS? | Notes |
|---|---|---|
| Production cloud infrastructure | Yes | Compute, storage, databases, networking, managed services that serve customers |
| Development, test, and staging environments | Usually no (R&D) | Infrastructure used to build the product, not deliver it; requires allocation by environment |
| Third-party software embedded in the product | Yes | APIs, data feeds, maps, messaging, search, and other services billed per use or per seat |
| AI model inference for customer features | Yes | Tokens, GPU hours, and agent runs consumed delivering the product |
| AI model development and experimentation | No (R&D) | Training, evaluation, and prototyping |
| Customer support (delivery) | Yes | Ticket handling, uptime, and keeping customers using the product |
| Customer success (expansion and renewal) | No (S&M) | Activity aimed at selling more; often split by role or time |
| Payment processing and billing fees | Yes | Card and invoicing fees on customer revenue |
| Professional services and onboarding | Yes (often a separate COGS line) | Implementation delivered to customers; usually reported with its own margin |
| Security, compliance, and monitoring of production | Yes | Tooling and services that keep the delivered service running and compliant |
| Amortization of capitalized software development | Varies | Where development costs are capitalized, their amortization often sits in COGS; confirm with auditors |
| Engineering salaries | No (R&D) | Unless engineers are dedicated to operating production, in which case that portion may be COGS |
Three of these decide most of the variance between companies. Whether development environments are split out of cloud COGS can move gross margin by two to five points. Whether support is split between delivery and expansion can move it by one to three. And whether AI inference is recognized as COGS at all, rather than buried in a technology line, can move it by ten or more for AI-heavy products. Decide each explicitly, document it, and apply it consistently, because investors compare your margin across periods and against peers.
Gross margin is revenue minus COGS, divided by revenue. The figures below are the ranges SaaS investors and operators commonly use in 2026; individual companies vary with business model, stage, and product.
| Profile | Typical gross margin | Cloud as % of revenue | What drives the difference |
|---|---|---|---|
| Best-in-class traditional SaaS | 80% or higher | Under 8% | Mature architecture, high commitment coverage, automated support |
| Healthy traditional SaaS | 70 to 80% | 6 to 12% | Standard cloud discipline; support scales with customers |
| Early-stage or infrastructure-heavy SaaS | 55 to 70% | 12 to 20% | Over-provisioned infrastructure, little commitment coverage, manual onboarding |
| AI-native SaaS | 50 to 65% | 20% or more including inference | Model calls scale with usage; frontier models used by default |
| SaaS with heavy professional services | Blended 60 to 75% | Varies | Services carry 20 to 40% margin and dilute software margin |
Two readings matter. First, the gap between healthy and best-in-class is almost entirely cloud and support discipline, not product; the same product delivered on right-sized, committed infrastructure with automated support sits ten points higher. Second, AI-native margins are not a permanent condition but a reflection of how early most AI products are in managing inference cost; routing, caching, and right-sizing model calls, covered in our LLM cost optimization guide, can move an AI product from the bottom of that table toward the middle. For how these margins feed the metrics boards watch, see our explainer on the Rule of 40.
A SaaS company has $20 million in annual recurring revenue. Its cloud bill is $2.4 million a year (12 percent of revenue), embedded third-party services $600,000, support and success $1.6 million, payment processing $300,000, and a new AI assistant feature consumes $1.2 million in model inference. Reported naively, with all cloud and all support in COGS, cost of revenue is $6.1 million and gross margin is 69.5 percent, at the bottom of the healthy range and below where its investors want it.
Now apply the classification discipline. Cost allocation by environment shows $500,000 of the cloud bill is development and staging, which moves to R&D. Time allocation shows $600,000 of the support and success spend is expansion and renewal activity, which moves to sales and marketing. COGS is now $5.0 million and gross margin 75 percent, a five-and-a-half-point improvement with no operational change, purely from classifying correctly and consistently. The point is not that reclassification is a trick; it is that most companies understate margin by failing to separate costs they could separate if they could see them.
Then reduce the real cost. Right-sizing production and raising commitment coverage from 30 to 70 percent cuts the production cloud line by $500,000. Routing the AI assistant's routine requests to a mid-tier model and caching its system prompt cuts inference from $1.2 million to $450,000 with no change in quality scores. COGS falls to $3.75 million and gross margin reaches 81 percent. The same product, the same customers, and the same revenue, moved from 69.5 to 81 percent gross margin, with roughly half the gain from classification and half from management, both of which required seeing cost per environment, per feature, and per customer first.
Allocate cloud and AI spend to environment, feature, and customer, so you know what production costs, what each feature costs to run, and what each customer costs to serve. This is the step that makes every other step possible, and the one most companies skip. Our guides to cloud cost allocation and AI unit economics cover the method.
Right-size compute to measured utilization, raise commitment coverage on the steady baseline, move cold data to cheaper storage tiers, cut data transfer with CDNs and private endpoints, and shut down non-production outside working hours. For most SaaS companies these move cloud from 12 percent of revenue toward 8, which alone is four points of gross margin.
Send routine requests to the smallest model that meets the quality bar, cache repeated context, batch what can wait, and cap output length. AI features built on a frontier model by default commonly cut inference cost by 60 to 80 percent with these changes and no measurable quality loss.
Third-party APIs priced per call grow with your usage. Review annually, consolidate overlapping providers, negotiate volume tiers, and build in-house where a service has become core and expensive.
Self-service, in-product guidance, and AI-assisted ticket handling keep the delivery portion of support from growing in step with the customer base, which is what separates 80 percent margin businesses from 70 percent ones at scale.
Once cost per customer is known, heavy users who cost more to serve can be priced accordingly, through usage tiers, overage fees, or AI-feature pricing that reflects inference cost. Gross margin improves not only by cutting cost but by aligning revenue with it, a point our analysis of cloud cost elasticity develops.
COGS is a finance metric whose largest lines are engineering decisions: which instances run, which model answers a request, how data is stored, how many environments exist. Finance can classify and report; only engineering can change the number. The companies with the best SaaS gross margins are the ones where engineers see the cost of what they build in the units finance reports it, cost per customer, per feature, per request, and treat it as a quality attribute of the product. That is the shared-accountability model in our guide to what FinOps is, and the view a CFO needs is the subject of our CFO's guide to evaluating cloud spend. Making COGS visible at that level, across cloud and AI, attributed to customers and features, is what Opslyft's cost visibility is built to do.
SaaS cost of goods sold is where the economics of software are decided, and it is no longer small. Cloud, embedded services, support, and now AI inference all scale with customers and usage, and together they determine whether a company sits at 70 percent gross margin or 80. Define what belongs in COGS explicitly, with the hard calls on environments, support, and AI decided once and applied consistently. Benchmark against the right peer group. Attribute cost to customers, features, and environments so you can see where it is. Then reduce the largest lines, cloud and inference, with the levers that are now well understood. The result is a margin that reflects the product you actually built rather than the infrastructure you forgot to manage, and confirm every classification with your own finance team and auditors, because the general practice described here is a starting point, not your books.
SaaS cost of goods sold (COGS), also called cost of revenue, is the direct cost of delivering the software service to paying customers. It typically includes cloud hosting and infrastructure, third-party software and APIs embedded in the product, the portion of customer support and success that keeps customers using the product, payment processing, and professional services or onboarding delivered to customers. It excludes research and development, sales and marketing, and general and administrative costs.
Investors generally expect 70 to 80 percent, with best-in-class pure software companies above 80 percent. Gross margin is revenue minus COGS divided by revenue, so a company at 75 percent spends 25 cents of every revenue dollar delivering the service. AI-heavy products currently run lower, often 50 to 65 percent, because model inference costs scale with usage in a way traditional software did not.
Yes, the portion that serves customers. Production infrastructure, the databases, compute, storage, networking, and managed services that deliver the product, is COGS. Development and test environments, internal tooling, and infrastructure used by engineering to build the product are generally operating expenses under R&D. Separating the two requires cost allocation by environment, which is why tagging and cost attribution matter to the finance team, not only the engineering team.
It depends on what the support does. Support and customer success activity required to deliver the service to existing customers, answering tickets, maintaining uptime, onboarding, is usually classified as COGS. Activity aimed at expansion or renewal selling is sales and marketing. Many companies split the function by role or by time allocation, and the treatment should be consistent year over year and agreed with your auditors.
For healthy traditional SaaS, cloud infrastructure typically runs 6 to 12 percent of revenue, and the best-run companies keep it under 10 percent. For AI-native products the share is often 20 percent or more, because inference costs scale with usage. Cloud is usually the largest single line in SaaS COGS, which is why it is the one most worth managing.
Measure cost per customer and per unit of usage first, since you cannot reduce what you cannot attribute. Then work the largest lines: right-size and commit cloud infrastructure, route AI workloads to cheaper models where quality allows, renegotiate or replace embedded third-party services, automate the support work that scales with customers, and design pricing so heavy users pay for the usage they drive. Gross margin improves when revenue grows faster than delivery cost, which requires knowing the cost per unit.
Yes, when the model calls deliver the product to customers. Tokens consumed by customer-facing features are a direct cost of revenue, exactly like hosting. This is why AI has pressured SaaS gross margins: a feature that costs $0.40 per use in model calls behaves like a manufacturing cost, not like software's traditional near-zero marginal cost. Model development and experimentation costs, by contrast, are R&D.