COGS for SaaS: What Counts as Cost of Goods Sold?

Which costs belong in SaaS COGS, a per-customer breakdown, and how it affects your margins.

February 25, 20264 min read724 words

one-line definition

COGS is the direct cost of delivering your product to customers — for SaaS, this means hosting, third-party APIs, payment processing fees, and customer support.

formula: COGS = Hosting + Third-party API costs + Payment processing fees + Customer support costs + Any per-unit delivery cost. Gross Margin = (Revenue − COGS) ÷ Revenue × 100.

tl;dr

Most solo founders ignore COGS because they think "my only cost is $20/month hosting." Then they add an AI feature with OpenAI calls, start paying Stripe 2.9%, and suddenly 35% of revenue goes to delivery costs. Know your COGS before you set your price.

Simple definition

COGS (Cost of Goods Sold) represents every dollar you spend to actually deliver your product to a paying customer. For a physical product, it is materials and manufacturing. For SaaS, it is everything that scales with customers: server costs, third-party API calls, payment processing, and the customer support time needed to keep them running. COGS matters because it determines your gross margin — the money left over to pay for marketing, development, and your salary. A product with 80% gross margin has room to grow. A product with 50% gross margin needs to be very careful about how it acquires customers.

Why this matters

COGS is a critical metric for bootstrapped founders because it represents the truth about your business. Before product-market fit, this metric may feel abstract. But once you have paying customers and recurring revenue, ignoring this metric becomes dangerous to your growth trajectory.

Most solo founders make the mistake of focusing on the wrong metric at the wrong time. Before $1k MRR, the best metrics are activation and product-market fit. Between $1k-$10k MRR, cogs becomes highly relevant. Beyond $10k MRR, it becomes one of your top three growth levers.

The reason solo founders rarely fail due to lack of brilliant ideas. They fail because they don't systematically measure metrics that matter and don't iterate on improvements.

Common mistakes

1. Calculating too early. If you have 5 customers, this metric is noise, not signal. Wait until you have at least 50 customers and 2-3 months of data before drawing conclusions. Too early and you'll see random variance, not real patterns.

2. Ignoring variations by segment. Your customers acquired via blog may behave differently than those acquired via paid ads. Your enterprise customers may function differently than your small-biz customers. Always segment your metrics to see the true signal.

3. Optimizing without context. Improving this metric by 10% means 10% more revenue? Not necessarily. Understand upstream and downstream impact before optimizing. Focus on the change that will have the biggest impact on revenue.

4. Forgetting causality flows both directions. A low metric may indicate a product issue, a positioning issue, or that you're attracting the wrong customers. Before optimizing, understand why it's low.

How to act on this

Calculate this metric for your last 30 customers right now. Do you have the data? If yes, establish a baseline and write it down. That's your first step toward improvement.

Identify your highest-value customer segment. Is it a specific monthly cohort? An acquisition channel? A customer type? Focus on that segment and try to improve this metric for them.

Run one small experiment to improve this metric by 5-10%. Measure, learn, iterate. The compounding of these small improvements over 12 months creates a huge difference.

How to calculate it

COGS = Hosting + Third-party APIs + Payment fees + Support costs

Then: Gross Margin = (Revenue − COGS) ÷ Revenue × 100

Break it down per customer to understand unit economics:

Cost itemMonthly amountPer-customer (100 customers)
Hosting (Vercel/Railway)$25$0.25
OpenAI API calls$180$1.80
Stripe fees (2.9% + $0.30 on $29 plan)$114$1.14
Email delivery (Resend)$20$0.20
Total COGS$339$3.39

Revenue: $2,900. COGS: $339. Gross margin: 88.3%. Healthy. But watch what happens if users start making 3x more AI calls.

Example

You build an AI writing assistant at $29/month. At launch, each user averages 200 OpenAI API calls per month, costing you $0.80 in inference. Total COGS per customer: $0.80 (AI) + $0.25 (hosting share) + $1.14 (Stripe) = $2.19. Gross margin: 92.4%. Excellent. Six months later, you add a more powerful model and usage doubles. AI cost per user jumps to $3.20. Total COGS: $4.59. Gross margin drops to 84.2%. Still fine. But your heaviest 10% of users cost you $12 in AI calls alone — their COGS exceeds the subscription price. You add a usage cap at the $29 tier and create a $59 tier with higher limits. Problem solved before it ate your margins.

Related terms

  • Gross Margin
  • Contribution Margin
  • Unit Economics

FAQ

What counts as COGS for a SaaS product?+

Hosting and infrastructure, third-party API costs (OpenAI, Twilio, email delivery), payment processing fees (Stripe's 2.9% + $0.30), and direct customer support. Developer salaries are NOT COGS — they are operating expenses. The rule: if the cost scales with the number of customers or usage, it is probably COGS.

What is a healthy COGS percentage for indie SaaS?+

Keep COGS under 20-25% of revenue, giving you 75-80% gross margin. If you're spending more than 30% on delivery costs, you either have a pricing problem or an architecture problem. AI-heavy products often have higher COGS (30-50%) due to inference costs — price accordingly.

previous

Contribution Margin: What Each Customer Really Costs You

How to calculate contribution margin for SaaS and why API-heavy products need to watch it.

next

Churn Rate: The Silent SaaS Killer

How to calculate churn rate, what benchmarks look like, and why even small churn compounds into a crisis.

Put the concept to work

Move from definitions to decisions with guides, comparisons, and calculators built for founders.

Explore the blog

Related terms

newsletter

Weekly builds, experiments, and growth playbooks

No fluff. Just things that actually shipped.

COGS for SaaS: What Counts as Cost of Goods Sold? | fromscratch