Reserve credits
Holds a block of credits up front for an operation whose exact cost is not yet known (for example an LLM call). Returns a reservation token that is settled later via POST /beta/credits/track with the amount actually used. A deny (insufficient available credit) is returned as 200 { allowed: false }, not an HTTP error. Send an Idempotency-Key header to make retries return the same reservation instead of opening a second hold.
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 the credits belong to
"cust_abc123"
Feature (billable metric name) the credits are consumed against
"llm_tokens"
Usage event name, when the check should be resolved against a specific event's pricing context
"api_call"
Event properties used to resolve customer-specific filter groups. Never a billing source of truth.
Amount of credits to hold up front. Omit for a cost-free preflight allow/deny check (no hold is opened).
"100"
Response
Success
Whether the requested amount is covered by available credit
The feature's at-zero policy the caller should apply on a deny: stop (hard deny) or overflow (fall through to metered billing)
"overflow"
Available credit balance for the account (balance − reserved)
Amount of the request covered by available credit
Reservation token to settle later via /track. Empty unless a hold was opened (reserve).
"crt_abc123"
Amount by which the request exceeded available credit (0 when fully covered)
When the opened hold expires. Present only when a reservation was opened.
"2026-04-01T10:05:00Z"