Dynamic (you set the cost)
Bill the exact cost your app computes per event, with an optional markup. Built for AI usage.
Dynamic pricing bills a cost your own app works out. Instead of a rate in yRecurring, you push the exact cost of each event onto the usage record, and yRecurring bills the sum. You can add a markup percentage on top.
This is built for AI and anything else where you already know the precise cost of each request. An app that charges for AI usage knows the cost of a request the moment it happens: the model, the token count, its own margin. Push that number in, and yRecurring bills it without you rebuilding the pricing math here.
Worked example
Over a billing period, your app records the AI cost of a customer's requests. They add up to $4.20. You set a 20% markup:
total = $4.20 x (1 + 20/100)
= $4.20 x 1.2
= $5.04
With no markup set, the customer is billed the raw $4.20, a straight pass-through.
Why the math stays exact
Each event's cost can be a tiny fraction of a cent. The markup is applied to the full-precision total, and the result is rounded to real money exactly once, at the end. Summing thousands of sub-cent costs never drifts, because rounding never happens in the middle.
Settings
| Field | What it does |
|---|---|
| Markup percent | An optional margin added to the cost you push in. Leave it empty for a pure pass-through. |
The cost itself is not a setting. It arrives on each usage event, because it is different every time.
Edge cases
- No cost pushed in, nothing to bill. The amount comes entirely from the events you record.
- The markup is a percentage, never negative. Use it to add margin on top of your cost.
- For a fixed rate per unit, use per unit or tiered pricing. Dynamic is only for when your app already knows the exact cost.
In the API
Markup is optional. An empty config is a pure pass-through:
{
"pricing_model": "dynamic",
"pricing_config": { "markup_pct": "20" },
"currency": "USD"
}