Reserve credits
Reserves credits for an operation whose final cost is not yet known. Settle the reservation later with POST /beta/credits/track. Send an Idempotency-Key and reuse it when retrying.
Insufficient credit returns 200 with allowed: false. Retry timeouts and 5xx responses with the same key. A 409 means the key was reused for a different request, or the pool already has an open 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 missing 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 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. Zero when a reserve request is allowed without a hold (soft policy admitting a back-pressure failure) — nothing was actually reserved, so the caller's own /track meters the full amount as overflow
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). Equals the full requested amount when covered is zero
When the opened hold expires. Present only when a reservation was opened.
"2026-04-01T10:05:00Z"