# Classify SaaS costs into COGS and calculate gross margin

A defensible split of hosting, support, and services costs into cost of revenue, with a gross margin view investors will accept.

- Topic: Finance & Accounting
- Framework: Few-Shot
- Level: Standard
- Tags: Finance, Fill-in Template
- Source: https://www.thinkwithprompt.com/prompts/classify-saas-costs-into-cogs-and-calculate-gross-margin

## Prompt

```text
Help me classify my SaaS costs between cost of revenue (COGS) and operating expenses, and calculate gross margin.

**Cost lines:** [PASTE my expense list with amounts - hosting, third-party APIs and AI model costs, monitoring tools, support team, customer success, implementation team, payment processing, DevOps salaries, etc.]
**Revenue split:** [subscription revenue vs professional services revenue]
**Team allocation:** [e.g. "DevOps spends 60% on production uptime, 40% on new features"]
**How we classify today:** [CURRENT approach, or "everything is in opex"]

Return:
1. A table: cost line | amount | COGS or opex | allocation % | reasoning. Cover the usual SaaS judgment calls: production hosting vs development environments, support vs customer success (retention vs expansion work), DevOps and SRE time, payment processing fees, amortized capitalized software, and AI inference costs.
2. Subscription gross margin and services gross margin calculated separately, then blended. Show the math.
3. How my margin compares to commonly cited SaaS ranges, labeled as rough rules of thumb.
4. The top 3 drivers of margin and ideas to improve each (e.g. hosting efficiency, support deflection, pricing of AI-heavy features, services packaging).
5. A short policy note to keep classification consistent month to month, with the allocation method documented.
6. Red flags investors look for, such as moving support costs to opex to flatter margin.

Use only the figures I give; mark assumptions as [ASSUMPTION]. This is general information - confirm the classification with my accountant.
```

## What to fill in

- subscription revenue vs professional services revenue
- CURRENT approach, or "everything is in opex"
- ASSUMPTION

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
