Track credit consumption
Records credit usage directly or settles a prior reservation. Live draws must include unique_id or an Idempotency-Key; reuse the same identity when retrying. Insufficient credit returns 200 with allowed: false.
Retry timeouts and 5xx responses with the same identity. Retries replay the credit decision but may not republish the usage event. A 409 means the key was reused for a different request, or the settlement conflicts with the outcome already recorded for the reservation; it will never succeed as-is, so do not retry it unchanged. A 422 means the request was rejected on its own terms, such as a live draw missing unique_id and Idempotency-Key, or an invalid amount. Back off on 429.
Authorizations
API key authentication. Pass your API key as a Bearer token.
Headers
2026-04-01 A unique string used to ensure the request is processed exactly once. If you retry a request with the same idempotency key within 24 hours, the original response is returned without re-executing the operation.
255"ik_a1b2c3d4e5f6"
Body
Customer account ID or alias; direct-consumption mode
"cust_abc123"
Credits to draw for this call; direct-consumption mode, mutually exclusive with reservation_id/used.
"5"
Usage event name recorded for metering/overflow billing; direct-consumption mode
"api_call"
Feature the credits are consumed against; direct-consumption mode
"llm_tokens"
Event properties used to resolve customer-specific filter groups; direct-consumption mode. Never a billing source of truth.
Reservation token returned by /check, to settle credit coverage; reservation-settlement mode. Mutually exclusive with feature/cost. Reservation settlement does not publish metered usage; send the raw usage event through /events before settling.
"crt_abc123"
Usage event timestamp (RFC3339); required in direct-consumption mode and must remain identical on retries.
"2026-04-01T10:00:00Z"
Stable dedupe identity for the recorded usage event, max 72 characters. Live direct-consumption requests require either this field or the Idempotency-Key header; reuse the same identity on every retry. Hash longer natural keys before sending.
72"evt_abc123"
Credits actually used against the reservation; required in reservation-settlement mode (send "0" explicitly to settle as zero — omitting it is rejected, never treated as zero). Rejected when no matching raw usage stream is visible for the account and reservation window.
"3"
Response
Success
Whether the consumption was covered by available credit
Available credit balance for the account after this call
Credit quantity covered by this call
Quantity not covered by credit that overflows to metered billing
Reservation this call settled or opened. Empty for a direct-consumption draw that opened no block.
"crt_abc123"
True when the referenced reservation had expired and the work was re-resolved as a fresh consume