You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
API for pricing hypothetical usage using OpenMeter’s pricing engine
#5266
We’re designing an AI platform using OpenMeter API v3, with a custom currency called credit. We want OpenMeter to be the source of truth for pricing, subscriptions, and credit accounting.
To enforce strict spending limits, our backend needs to:
Estimate usage before an AI request, including a maximum output token count.
Calculate its cost using the customer’s applicable pricing configuration.
Atomically reserve that amount in our quota service.
Settle the reservation against actual usage after completion.
The missing piece for us is a way to calculate the cost of hypothetical usage using OpenMeter’s existing pricing engine, without ingesting events or creating charges/invoices.
Conceptually, the API would accept:
Estimated usage quantities for the relevant features.
A reference to the applicable subscription item or an exact pricing revision.
Any additional context required for tiered pricing or discounts.
It would return the calculated cost in the configured currency, ideally with a breakdown and the pricing revision used.
Is there an existing or planned v3 API for this? Alternatively, is there a supported way to reuse the pricing engine as a library?
We can handle reservation and concurrency ourselves. Our goal is to avoid duplicating OpenMeter’s rating logic in our backend and risking discrepancies between quota enforcement and billing.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
We’re designing an AI platform using OpenMeter API v3, with a custom currency called
credit. We want OpenMeter to be the source of truth for pricing, subscriptions, and credit accounting.To enforce strict spending limits, our backend needs to:
The missing piece for us is a way to calculate the cost of hypothetical usage using OpenMeter’s existing pricing engine, without ingesting events or creating charges/invoices.
Conceptually, the API would accept:
It would return the calculated cost in the configured currency, ideally with a breakdown and the pricing revision used.
Is there an existing or planned v3 API for this? Alternatively, is there a supported way to reuse the pricing engine as a library?
We can handle reservation and concurrency ourselves. Our goal is to avoid duplicating OpenMeter’s rating logic in our backend and risking discrepancies between quota enforcement and billing.
All reactions