Skip to main content
POST
Reserve credits

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Headers

Alguna-Version
enum<string>
required
Available options:
2026-04-01
Idempotency-Key
string

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.

Maximum string length: 255
Example:

"ik_a1b2c3d4e5f6"

Body

application/json
account
string
required

Customer account ID or alias the credits belong to

Example:

"cust_abc123"

feature
string
required

Feature (billable metric name) the credits are consumed against

Example:

"llm_tokens"

event_name
string | null

Usage event name, when the check should be resolved against a specific event's pricing context

Example:

"api_call"

properties
object

Event properties used to resolve customer-specific filter groups. Never a billing source of truth.

reserve
string | null

Amount of credits to hold up front. Omit for a cost-free preflight allow/deny check (no hold is opened).

Example:

"100"

Response

Success

allowed
boolean
required

Whether the requested amount is covered by available credit

at_zero_action
string
required

The feature's at-zero policy the caller should apply on a deny: stop (hard deny) or overflow (fall through to metered billing)

Example:

"overflow"

balance
string
required

Available credit balance for the account (balance − reserved)

covered
string
required

Amount of the request covered by available credit

reservation_id
string
required

Reservation token to settle later via /track. Empty unless a hold was opened (reserve).

Example:

"crt_abc123"

shortfall
string
required

Amount by which the request exceeded available credit (0 when fully covered)

expires_at
string<date-time> | null

When the opened hold expires. Present only when a reservation was opened.

Example:

"2026-04-01T10:05:00Z"