Skip to main content

Request

string
required
The specific feature or entitlement to consume against, for example ai-messages.
string
The customer ID. This is required when the API key has no default customer binding.
string
required
Logical key used to deduplicate the event.
string
required
The broad event kind configured in Unprice, for example completions.
string
Optional event ID from your system. Unprice creates an internal ID when you omit it.
number
Optional event timestamp in epoch milliseconds. Unprice uses the request time when you omit it.
object
required
Event properties used by meters. For usage.consume, the targeted feature’s meter reads the relevant field from this object.

Response

Returns an allow or deny decision for the targeted feature. state is processed when the event was applied and rejected when Unprice denied it. On a denial, inspect rejectionReason and message. Reuse the same idempotencyKey when you retry the same logical request.