Skip to content
SlashClone

Gross margin by customer

@agentcosts/gross-margin-by-customer

Gross margin per customer for an AI product: revenue minus LLM cost minus allocated hosting and other cost of revenue. Flags negative and below-target customers, names the task driving their cost, and gives the price each one would need to hit your target margin.

SkillFinancev1.0.0 (latest)Tested
Activity
New: be the first to try it
  1. 1# Gross margin by customer
  2. 2
  3. 3Shows the gross margin of every customer of your AI product: revenue minus model costs minus allocated hosting and other cost of revenue. It flags who is negative or under target, which task drives their cost, and what they would need to pay to hit your target.
  4. 4
  5. 5**Who it is for:** founders and finance leads at AI products preparing pricing changes, renewals, or board reviews.
  6. 6
  7. 7## Example
  8. 8
  9. 9Input: `examples/usage.csv` (October LLM usage), `examples/revenue.csv`, `examples/cogs.csv` (hosting, vector database, support tooling, dedicated storage), `examples/prices.csv`.
  10. 11Output (`out/margin.md`):
  11. 13| Customer | Revenue | LLM cost | Other COGS | Gross margin | Status | Biggest cost | Price for 70% |
  12. 14| --- | --- | --- | --- | --- | --- | --- | --- |
  13. 15| cobalt-labs | $60 | $66.22 | $63.53 | -116.3% | **negative** | research_agent (96%) | $433 |
  14. 16| northwind-co | $240 | $73.26 | $69.75 | 40.4% | below target | research_agent (94%) | $477 |
  15. 17| bluepeak | $149 | $3.30 | $7.92 | 92.5% | ok | code_review (99%) | $37 |
  16. 19## What it can access
  17. 21- Runs `node scripts/margin.mjs` (Node built-ins only).
  18. 22- Reads `data/`. Writes `out/margin*`.
  19. 23- No network.
  20. 25## Setup
  21. 27None. If your usage comes from provider exports, run `@agentcosts/llm-usage-normalizer` first. Check the example prices against each provider's current pricing before trusting the numbers.