SaaS COGS: Infrastructure, Personnel, and What Stays Out

Cost of Goods Sold for a SaaS company is every expense directly tied to delivering the running software service to paying customers: production hosting and cloud infrastructure, third-party APIs and data feeds embedded in the product, payment processing fees, the people who keep the production environment operational, and amortization of capitalized software development. Everything else—building what’s next, selling it, and running the company around it—sits in operating expenses. GAAP does not prescribe a specific COGS definition for SaaS, so the line between cost of revenue and OpEx rests on judgment applied consistently.

The reason to get this right is straightforward. Gross margin is the metric investors lean on hardest when valuing a SaaS business, and misclassifying either direction distorts it. Push legitimate delivery costs into OpEx and your margin looks inflated until due diligence catches it. Bury OpEx in COGS and you understate the efficiency of the business.

Infrastructure and Hosting

Cloud spend is usually the largest single COGS line. On AWS, Azure, or Google Cloud, every dollar of compute, storage, and data transfer that supports the production environment is cost of revenue. Development, staging, and QA environments are R&D. If you run your own data centers, the equivalents are rack space, power, cooling, physical security, and depreciation on the servers running the live application. Bandwidth and CDN fees belong here too, because they scale directly with customer usage.

Monitoring and security tools used exclusively for production count as well—application performance monitoring, uptime alerting, and services protecting live customer data. Tools that cover both production and non-production environments need to be allocated proportionally.

Separating Production Spend From Everything Else

The COGS number is only as accurate as your ability to isolate production spending inside the cloud bill. The working approach is separate accounts and mandatory tags: distinct cloud accounts for production and non-production, plus tags like “Environment” and “Cost Center” on every resource. AWS supports this through separate accounts inside an Organization with cost filtering in Cost Explorer; Azure uses resource groups and tags; Google Cloud uses folders in its resource hierarchy.

One detail decides whether this works: cost allocation tags are not retroactive. Untagged resources become unattributable noise. Set the strategy up before you need the data.1Amazon Web Services. Building a Cost Allocation Strategy – Best Practices for Tagging AWS Resources

Third-Party Software, APIs, and Payment Fees

Any third-party software or data feed embedded in the delivered product is a COGS item. The test is simple: if the vendor disappeared tomorrow, would the product degrade or stop working for paying customers? Mapping APIs, communication platforms like Twilio, data enrichment providers, and search infrastructure all pass that test.

AI model APIs get their own attention. Calls to OpenAI, Anthropic, or similar providers that power customer-facing features are COGS. Inference costs are harder to forecast than conventional hosting because they scale with both user count and usage intensity—a single power user running complex queries can burn through more budget than hundreds of light users. If AI features are a meaningful part of the product, track their spend as a distinct COGS sub-category so you can see what they actually cost to deliver. AI-native companies have been running gross margins in the 40% to 60% range rather than the 75%-plus typical of traditional SaaS, and that gap reflects the underlying cost structure rather than a maturity problem.

Payment processing fees from Stripe, Braintree, and similar providers belong in COGS as well. Every subscription charge carries a percentage fee that scales linearly with revenue. Some companies park these in G&A, but the logic runs the other way: stop processing payments and you stop delivering the service.

Personnel

The rule for people costs is clean in principle and contested in practice: if an employee’s primary job is keeping the production service running for current paying customers, their fully loaded compensation belongs in COGS. Fully loaded means base salary plus the employer’s share of payroll taxes, health insurance, retirement contributions, and other benefits. Applying the rule honestly usually requires time tracking.

Roles That Belong in COGS

Site Reliability and DevOps engineers who run production infrastructure, deployments, and incident response are the clearest case. Their function is keeping the live service up. Customer support staff handling technical troubleshooting, bug triage, and platform guidance also fit, because they exist because the product exists and their headcount scales with the customer base.

Implementation and onboarding specialists qualify when the work is technical setup and configuration of the production environment for a new customer. When the same person shifts to training users on features or providing strategic advice, that time crosses into S&M or G&A. Split the cost when the role is genuinely split.

The Customer Success Judgment Call

Customer Success Managers sit in the middle, and how you classify them says a lot about how honestly you’re reporting margin. What decides it is the day-to-day work, not the org chart.

A CSM team focused on retention, satisfaction, engagement, and enablement is functionally part of the product experience; those costs reasonably belong in COGS. A team focused on renewals as a booking event, upsell, cross-sell, and expansion is a sales function and belongs in S&M. When people do both, allocate by time. Sweeping the whole team into one bucket is the most common way SaaS companies quietly inflate or deflate their gross margin.

Who Does Not Belong

Engineers building new features, product managers designing future capabilities, and designers working on unreleased functionality are R&D. Even when an SRE contributes to a feature sprint, that time should be tracked separately and expensed as R&D. The test is whether the work maintains today’s service or creates something new. Mixed roles need time tracking, usually through internal ticketing or monthly allocation surveys.

Amortization of Capitalized Software

When engineering builds software that powers the production service, some development costs get capitalized under GAAP and amortized over the software’s useful life, and that amortization flows through COGS. Under the accounting for internal-use software, capitalization begins once management has authorized and committed to funding the project and it is probable the software will be completed and used as intended.2Financial Accounting Standards Board. ASU 2025-06 Internal-Use Software (Subtopic 350-40)

Eligible costs include external materials and services consumed in development, payroll and benefits for employees directly working on the project proportional to time spent, and related interest costs. Early-stage exploratory work and post-launch maintenance are expensed as incurred.2Financial Accounting Standards Board. ASU 2025-06 Internal-Use Software (Subtopic 350-40)

A company that capitalizes significant development and amortizes it through COGS will show a different margin profile than one expensing everything as R&D. Neither is inherently wrong. Investors will ask about the policy to understand what margin looks like under different assumptions, so year-over-year consistency matters more than the choice itself.

What Stays Out of COGS

Everything that isn’t directly delivering the current production service to paying customers falls into operating expenses, split across the three standard buckets.

Research and Development

R&D covers building new features, developing new product lines, and architectural work beyond what’s required to maintain today’s service. Salaries for engineers, product managers, and designers doing forward-looking work land here. The question that separates R&D from COGS is whether the work is keeping the lights on for current customers or building something new.

A tax-side note that lives next to this rule but does not change GAAP classification: since 2022, the federal tax code has required businesses to capitalize and amortize research and experimental expenditures over five years for domestic work rather than deducting them immediately.3Office of the Law Revision Counsel. 26 USC 174 – Amortization of Research and Experimental Expenditures It affects cash flow planning, not where R&D sits on the income statement.

Sales and Marketing

Sales compensation, commissions, advertising, marketing campaigns, trade shows, and CRM subscriptions are S&M. Account managers whose primary function is driving renewals and expansion revenue belong here too. The through-line is that these costs exist to acquire or grow customer relationships rather than deliver the product.

General and Administrative

G&A is the overhead of running the business: executive compensation, finance, HR, legal, corporate rent, and professional fees for auditors and outside counsel. These costs exist whether you serve ten customers or ten thousand, and keeping them out of COGS is what lets gross margin reflect the actual economics of service delivery.

Report Professional Services Separately

If your company earns meaningful revenue from implementation, consulting, or training alongside subscriptions, report that revenue and its associated costs on a separate line from subscription COGS. Implementation is a fundamentally different business than recurring software delivery, and blending them hides the unit economics of both. Subscription gross margin might be 80% while services margin is 10% or negative; a single blended figure obscures the fact that software revenue is subsidizing services work.

Why the Classification Moves the Number That Matters

The widely cited benchmark for SaaS subscription gross margin is 75% or higher. Companies above 80% have consistently commanded premium valuations; those below 60% trade at steep discounts, roughly half the multiple of the top tier in recent quarters. A few percentage points of misclassification can shift where a company sits on that spectrum and, by extension, how acquirers and investors price it.

The practical move is to write down a COGS policy early, apply it consistently, and be able to walk an investor through every line. Companies that do this don’t just report cleaner numbers; they price better, catch margin erosion earlier, and know their unit economics at a level companies with sloppy classification never see.