Gross Margin Per Request Calculator
Check margin when you charge per AI request.
With the default inputs, $0.0994 margin per request — 99.4% gross margin. Enter your own numbers below to recompute instantly; the full step-by-step math is shown under the worked example.
Results update automatically as you type.
- Revenue / request
- $0.1000
- AI cost / request
- $0.000585
- Margin / request
- $0.0994
- Gross margin
- 99.4%
Enter what you charge per request and the workload behind it to see your AI cost, margin and gross-margin percentage — and a warning if you're underwater.
How this is calculated
AI cost per request = input tokens × input price + output tokens × output price, at your model's live rates. Gross margin = revenue per request − AI cost per request. Gross-margin % = margin ÷ revenue. If AI cost exceeds revenue, the margin is negative and you lose money on every call — the calculator flags this.
Is this a good result? What to do next
Software businesses typically target 70%+ gross margin, and AI token cost eats directly into that. A per-request margin above ~70% is healthy; between 40–70% is workable but watch it as volume grows; below that, or negative, you need to act. Remember this is model cost only — real gross margin is lower once support and infra are included.
Typical planning ranges
- Healthy gross margin
- ~70%+
- Watch closely
- ~40–70%
- Act now
- < 40% or negative
Ranges are typical planning figures to sanity-check your result, not authoritative benchmarks. Your numbers will vary with use case, volume, and vendor.
How to improve this number
- Raise price per request or move to value-based pricing.
- Use a cheaper model or shorten prompts and cap output tokens.
- Cache repeated context so input tokens aren't re-billed.
Common mistakes
- Treating model cost as total cost — infra and support reduce true margin.
- Optimising the average while a few heavy requests run at a loss.
- Forgetting output tokens cost more than input.
When to use a different approach
To set a resale price from a target markup, use the AI API markup calculator. To view economics per user rather than per request, use the AI cost per user calculator.
Worked example (defaults)
With the default inputs above, here is the result:
- Revenue / request
- $0.1000
- AI cost / request
- $0.000585
- Margin / request
- $0.0994
- Gross margin
- 99.4%
Sources & references
Frequently asked questions
What's a healthy gross margin?+
Software businesses often target 70%+ gross margin. AI costs eat into that, so watch this number closely.
What if margin is negative?+
Raise price, use a cheaper model, shorten prompts/outputs, or cache repeated context.
Related calculators
Answering a real question?
This calculator powers these problem-solving guides: