Skip to navigation

Formulaic pricing

A pricing formula is any charge your pricing page writes as arithmetic: tokens × a rate per model × 0.5 for batch, or pages × a rate per document type, plus 10% for support. In Paid you don’t write the formula as code. You split it into parts, and each part is set on the Paid object built for it: a meter measures the quantity, a rate card chooses the rate, modifiers multiply it, and prices add fees on top. Your events carry facts, never amounts, so changing the formula is configuration, not a deploy.

Use this page to:

The objects on this page are in private beta: send Paid-Beta with meters=v1, prices=v1 and rate_cards=v1, as each object’s page describes.

The five parts of a formula

Every formula Paid bills splits into the same five parts, applied in this order:

PartAnswersSet by
1. QuantityHow much was used?A meter: an aggregation such as sum or uniqueCount, or a workflow meter’s composite, divideBy and round
2. RateWhat does one unit cost, given its dimensions?A price for one rate, or a rate card that matches each dimension, such as payload.model
3. ModifiersWhat multiplies the rate?Rate card modifiers for every customer, and negotiated pricing for one order
4. ShapeHow does a quantity become an amount?pricing on the price or rate: perUnit with per, graduated or volume tiers, tierScope
5. CompositionHow does the charge relate to other charges?Percent-of and cost-plus prices, commits and credits

Read a formula left to right and give each term to its part. Trey Research’ token pricing is:

tokens × rate for the model × 0.5 if batch × 2 if the prompt is over 200,000 tokens
TermPartIn Paid
tokensQuantityA meter per token type that sums the tokens, with groupBy on payload.model and payload.serviceTier
rate for the modelRateA rate per model family on the api_list_prices rate card, matched by prefix
× 0.5 if batchModifierA batch modifier on payload.serviceTier, × 0.5
× 2 if over 200,000 tokensModifierA long-context modifier on the request’s input token fields, × 2

Paid keeps every step exact and rounds once, half-up, to the currency’s minor unit on each invoice line. A formula’s result never drifts from its arithmetic because of rounding along the way.

Common formulas

FormulaBuild it from
Units × a rate per dimension (model, region, document type)A meter with groupBy, priced by a rate card
× a discount or premium for some usage (batch, priority, region)A rate card modifier
× a premium for large requests (long context, high resolution)A rate card modifier on the request’s fields
× a negotiated rate for one customerNegotiated pricing on the customer’s order: a contracted price, a discount or a surcharge
A fee per call + a rate per tokenTwo meters on the same events, count and sum, each with its own price or rate
Cheaper per unit at volumegraduated or volume tiers, which reset each billing period
One rate for the first N units of each job, another aftertierScope: "event" on a usage price or a rate card’s rate
At least a set amount per requestvolume tiers with a flatAmount, and tierScope: "event", as in a minimum per request
Effort from several fields, such as tokens ÷ 1,000 + review minutes ÷ 10A workflow meter with a composite quantity
What it cost you × a marginA cost-plus price on the events’ cost lines
A percentage of other charges, with a floor or capA percent-of price with minimum and maximum
At least a set amount per yearAn invoiced minimum commit
Usage drawn from prepaid creditsPrices or rate cards in a credit currency

Build a formula

Clausebase reviews contracts for law firms. Instead of one tiered rate per page, it charges by document type, with a premium for rush jobs and a priority support fee on top:

pages × (8¢ for an NDA, 15¢ for an MSA, 12¢ for anything else)
× 1.5 for rush turnaround
+ 10% of review charges for priority support, at least $500.00 a month
TermPartObject
pagesQuantityThe pages_by_type meter, grouped by document type and turnaround
8¢, 15¢, 12¢RateThree rates on the review_rates rate card
× 1.5 for rushModifierA rush modifier on the same card
+ 10%, at least $500.00CompositionA percentOf price on the order’s usage charges, with a minimum

Each review sends one review.completed event with pages, documentType and turnaround in its payload. Amounts on rates are decimal strings in cents. The percent-of minimum is Money: an integer in cents with its currency.

Create a meter that sums the pages and splits them by the two dimensions the formula reads:

POST /v1/meters
{
"key": "pages_by_type",
"name": "Pages by document type",
"eventNames": ["review.completed"],
"measure": {
"type": "events",
"events": {
"aggregation": { "type": "sum", "sum": { "path": "payload.pages" } },
"unit": "page",
"groupBy": ["payload.documentType", "payload.turnaround"]
}
}
}

Set up a rate card, review_rates, with a rate per document type, a fallback for every other type, and the rush premium. The rate card API is in preview; Rate cards explains how a rate card’s versions, rates and modifiers price a meter.

RateMatchesAmount
NDApayload.documentType is nda8¢ a page
MSApayload.documentType is msa15¢ a page
Fallbackeverything else12¢ a page

A rush modifier multiplies the rate by 1.5 when payload.turnaround is rush.

Create a price for priority support at 10% of the order’s usage charges, with a $500.00 monthly minimum:

POST /v1/prices
{
"product": "doc_review",
"name": "Priority support",
"currency": "usd",
"type": "percentOf",
"percentOf": {
"percent": "10",
"of": { "type": "chargeTypes", "chargeTypes": ["usage"] },
"minimum": { "amount": 50000, "currency": "usd" }
}
}

Put the rate card and the price on Halberd LLP’s order. The formula now runs on every review.completed event Clausebase sends.

How it bills

In November, Clausebase reviews 41,000 pages for Halberd LLP:

UsageRate that matchesCalculationAmount
12,000 NDA pages, standardeq nda: 8¢12,000 × 8¢ = 96,000¢$960.00
20,000 MSA pages, standardeq msa: 15¢20,000 × 15¢ = 300,000¢$3,000.00
4,000 MSA pages, rusheq msa: 15¢4,000 × 15¢ = 60,000¢, × 1.5 rush = 90,000¢$900.00
5,000 other pages, standardfallback []: 12¢5,000 × 12¢ = 60,000¢$600.00
Contract review96,000¢ + 300,000¢ + 90,000¢ + 60,000¢ = 546,000¢$5,460.00
Priority support10% of usage charges546,000¢ × 10% = 54,600¢, above the 50,000¢ minimum$546.00
Total, before tax$5,460.00 + $546.00$6,006.00

The invoice shows a sub-line for each document type and turnaround, with the rush modifier itemised under the MSA rush line, so Halberd can check every term of the formula. In a quiet month with $3,000.00 of reviews, 10% is $300.00 and the support line is the $500.00 minimum.

To change a rate in the formula for every customer, publish a new rate card version and migrate the orders that should use it. To change it for Halberd alone, add negotiated pricing to its order.

Put the formula in the quantity

When a formula combines several fields before applying a rate, compute that combination in the meter, not the price. The price then charges one rate for one quantity, and the invoice still reads as quantity × rate.

A workflow meter combines values with composite (add, min or max), and scales each with divideBy and round. Litware bills support effort as one unit, where 1,000 output tokens or 10 minutes of human review each count as one:

"quantity": {
"type": "composite",
"composite": {
"op": "add",
"values": [
{ "type": "sum", "sum": { "path": "cost.inference.outputTokens" }, "divideBy": "1000" },
{ "type": "sum", "sum": { "path": "payload.reviewMinutes" }, "divideBy": "10" }
]
},
"round": "nearest",
"unit": "effortUnit"
}

A ticket with 4,200 output tokens and 25 review minutes counts as 4.2 + 2.5 = 6.7, rounded to 7 effort units. A usage price on the meter then charges a single rate per effort unit.

A minimum per request

volume tiers charge the whole quantity at the rate of the tier it ends in, and a tier’s flatAmount is charged when the quantity ends in that tier. With tierScope: "event", both apply to each event on its own. Together they charge the larger of a minimum and the metered amount, per request.

Trey Research charges $5.00 per million tokens on its embeddings API, and at least 1¢ a request. At 500¢ per million, 2,000 tokens cost exactly 1¢, so that’s where the first tier ends:

"pricing": {
"type": "volume",
"volume": {
"per": "1000000",
"tierScope": "event",
"tiers": [
{ "upTo": "2000", "unitAmount": "0", "flatAmount": 1 },
{ "upTo": null, "unitAmount": "500" }
]
}
}
RequestEnds inCalculationCharge
800 tokensFirst tierflat 1¢1¢
2,000 tokensFirst tierflat 1¢1¢
10,000 tokensSecond tier10,000 × 500 ÷ 1,000,000 = 5¢5¢

tierScope is set on a usage price or on each rate of a rate card, so the same tiers work for one rate per meter or for a rate per dimension.

Formulas that don’t fit directly

FormulaWhat to do
A rate that depends on total spend across meters, such as 10% off everything above $50,000.00 a monthTiers count one meter’s quantity. Agree the discount as negotiated pricing on the order or a commit instead.
A condition across several events of one requestGroup the events into a workflow and price its outcome or quantity.
Math Paid doesn’t offer, such as a square root or an exponentCompute the billable quantity in your code, send it in payload, and sum it. You’ll need a deploy to change the formula, so keep only that term in code.

Usage that a formula can’t rate is never billed at a guessed amount. A meter counts invalid values in health.invalidValues24h, so a gap in a formula shows up before an invoice is issued.