Skip to main content
The runtime call depends on what your app needs to decide. Use this rule first:
record tells Unprice what happened. consume decides whether known usage may happen now. runs reserve a budget before a workload starts. access.check asks without changing state.
Use eventSlug for the broad event your app observed, such as completions. Use featureSlug for the specific product feature you are checking or consuming, such as ai-messages, ai-generations, or ai-tools.

Decision table

access.check: ask without changing state

Use access.check when you want to know whether a customer can use a feature, but you do not want to consume usage or reserve credits.
Use it in shadow mode by logging result.allowed beside your current logic.

usage.consume: decide and apply now

Use usage.consume when the request path needs a synchronous commercial decision and the usage amount is known before the work runs.
usage.consume is the enforcing path for a known-cost action. Retry the same logical request with the same idempotencyKey.

usage.record: report for evidence

Use usage.record when the request should not wait for Unprice to decide. It queues the usage event for metering, analytics, and invoice evidence.
usage.record never blocks over-budget work. Do not use it as a spend gate. One async event can carry several measured properties; meters decide which property applies to each feature.

runs: reserve a budget envelope

Use budgeted runs when a paid action unfolds over multiple steps and can spend more than expected. The run labels the workload and reserves a budget before it starts.
Call runs.consume as the workload spends and runs.end when it finishes. Unprice does not own the workload executor; it owns the budget reservation, spend decision, and evidence trail.

Shortcut

Simple request path

Use usage.consume when one request maps to a known usage amount.

Multi-step workload

Use runs.start when the workload needs a budget before it begins.