Calculator

AI API margin calculator

Enter your provider token costs and how you bill customers (fixed per request, markup, or per-1M tokens). See profit, margin %, and the price you need to hit your target.

Reseller margin

At or above target margin

85.3%gross after fees

$0.0171 profit / request · GPT-5 mini

You charge$0.02
Before fees
Your cost$0.002365
API + overhead
Charge / req$0.02
Cost / req$0.002365
Profit / req$0.0171
Volume profit$1,705.50

Inputs

Cost vs customer price

Your provider COGS against what you charge end customers.

Insights

Margin heat & price solver

Visual margin band plus the charge needed to hit your target.

Margin heat85.3%
Target 60%25.3 pts above
API COGS / request$0.001365
Overhead / request$0.001
Payment fees / request$0.00058
Net revenue / request$0.0194
Markup on API1365%
Volume revenue$2,000.00
Volume API COGS$136.50
Break-even / request$0.002436

Target-price solver: charge $0.006375 / request to hit 60% margin (you can cut $0.0136 and still hit target).

Compares provider list-price COGS to what you charge end customers. Does not include taxes or unpaid invoices. Updated 2026-07-31. Approximate static list prices for planning only. Always verify against each provider’s official pricing page before production budgeting.

Guide

How to get value from this calculator

Compare what you pay providers for API usage against what you charge customers to see gross margin and minimum viable price. Essential for AI wrappers, agencies reselling API access, and products with usage-based billing. Input and output asymmetry in your COGS should flow through to how you price customer output.

Cost formula

Gross margin % = ((customer price − API COGS) / customer price) × 100; Price floor for target margin = API COGS / (1 − target margin %)

Why it matters

Reselling AI without margin math leads to pricing that looks profitable on average but loses money on output-heavy customer workloads. Explicit COGS-to-price mapping keeps products solvent as usage scales.

How to use it

  1. Enter your API COGS per request or per thousand tokens using model and volume assumptions.
  2. Set the price you charge customers for the equivalent unit.
  3. Review gross margin percentage at current pricing.
  4. Enter a target margin to see the minimum price you should charge.
  5. Stress-test margin when output tokens or provider prices increase 20–50%.
  6. Verify API COGS against recent invoices, not list prices alone if you have discounts.

Planning tips

  • Price customer output generously—your COGS output token rate is often 3–5x input.
  • Add overhead buffer (support, infra, payment fees) above raw API COGS in your price floor.
  • Usage-based pricing aligns revenue with COGS better than flat unlimited plans.
  • Re-price or cap when providers raise list prices—margin erodes silently otherwise.
  • Use the target-price solver to set a floor before sales negotiates discounts.
  • Compare margin across model tiers if you let customers choose model quality.

Frequently asked questions

What COGS should I include beyond API tokens?

At minimum include LLM API cost. Also consider embeddings, storage, support, and infra. This calculator focuses on API token COGS as the primary variable cost.

Are list prices accurate for margin calculation?

CentsPerToken uses approximate list prices for planning. Use your effective negotiated rate for binding pricing decisions when available.

What margin is healthy for AI products?

Varies by market. Many SaaS targets 60–80% gross margin before overhead. Run your power-user scenario—margin on heavy users matters most.

Should I pass through provider price increases?

Contract terms vary. Model a 20% COGS increase scenario here to see whether your current price survives provider rate changes.