Tiered pricing calculator
Price of a quantity under graduated or volume tiers, with optional flat fees, exactly as Stripe bills tiered prices.
- Version 1
- Checked against 7 published values
- Free, no sign-up
Result: Stripe example, graduated: 20 units on 1–5 at $7, 6–10 at $6.50, 11+ at $6
| Total The price of the quantity, rounded once. |
127.50 exact |
|---|---|
| Tier The tier the quantity lands in (volume) or the highest tier it reaches (graduated). |
3 |
Tiers
| Tier | Above | Up to | Units | Unit price | Flat fee | Amount |
|---|---|---|---|---|---|---|
| 1 | 0 | 5 | 5 | 7 | 0 | 35.00 |
| 2 | 5 | 10 | 5 | 6.5 | 0 | 32.50 |
| 3 | 10 | inf | 10 | 6 | 0 | 60.00 |
Rounding: Half up, 2 decimal places. Calculator billing/tiered-price@1.
How it is calculated
graduated: Σ over tiers reached (min(q, up_to_k) − up_to_(k−1)) × price_k + fee_k; volume: q × price_k + fee_k for the first tier with q ≤ up_to_kPrices a quantity (seats, API calls, gigabytes) on a tiered price list. With graduated tiers, each unit is charged at the price of the tier it falls in, so 12 units on tiers of 5 are charged 5 at the first price, 5 at the second and 2 at the third. With volume tiers, every unit is charged at the price of the tier the whole quantity lands in. A tier can also have a flat fee: graduated pricing charges the flat fee of every tier it reaches, volume pricing only that of the tier it lands in. The tiers table shows how the total is made up.
- Tier limits are inclusive, as in Stripe: with tier_up_to [5, 10], 5 units are in the first tier and 6 units reach the second.
- A quantity of 0 is in the first tier, so its flat fee is charged, as Stripe does. To charge nothing for no usage, give the first tier a limit of 1, a unit price equal to the flat fee and no flat fee.
- For stairstep pricing (one fixed price per band), use volume pricing with unit prices of 0 and the band prices as flat fees.
- The total is the exact price rounded once. Each tier's amount is rounded on its own for the table; if those rounded amounts do not add up to the total, a TIER_AMOUNTS_ROUNDED warning gives both.
- Amounts are rounded to the cent (2 decimals) half up by default, the usual commercial rule and the one Stripe Tax uses. Set options.decimals for currencies with other minor units (0 for JPY, 3 for KWD) and options.rounding for another rule.
References
- Stripe: Set up tiered pricing (volume and graduated tiers, flat amounts, quantity 0)
- Stripe API: Price tiers (up_to, unit_amount_decimal, flat_amount)
Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.
Use it from your code
curl https://api.curatedapi.com/v1/calc/billing/tiered-price \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"quantity": "20",
"pricing_model": "graduated",
"tier_up_to": ["5", "10"],
"tier_unit_price": ["7", "6.5", "6"]
}'
The same call in Python
import os
import requests
payload = {
"quantity": "20",
"pricing_model": "graduated",
"tier_up_to": ["5", "10"],
"tier_unit_price": ["7", "6.5", "6"],
}
response = requests.post(
"https://api.curatedapi.com/v1/calc/billing/tiered-price",
headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
json=payload,
timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
"quantity": "20",
"pricing_model": "graduated",
"tier_up_to": ["5", "10"],
"tier_unit_price": ["7", "6.5", "6"],
};
const response = await fetch("https://api.curatedapi.com/v1/calc/billing/tiered-price", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CURATEDAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log((await response.json()).result);
MCP tool calc_billing_tiered_price at https://mcp.curatedapi.com.
Inputs, outputs and errors in the API reference.
Put it on your website
<div data-curatedapi-widget="billing/tiered-price" data-key="capi_public_…"></div>
<script src="https://widgets.curatedapi.com/v1/widget.js" async></script>
Use a public key registered for your site. Calculations are billed like API calls. How widgets work.
Related calculators
Preview and check subscription charges
Show customers the exact charge before they change plan, or check an invoice before it goes out. Proration, tiers and stacked coupons follow the rules Stripe uses, to the cent.
Free for up to 1,000 charges priced a month. 50,000 charges priced a month cost $9.00 on the Starter plan.