Skip to main content
POST
/
v1
/
ledger
/
reserve
curl -X POST https://api.lavendly.ai/v1/ledger/reserve \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer $LAVENDLY_API_KEY' \
  -d '{ "amount": 10, "label": "video / 5s" }'
{
  "token":     "rsv_lq3z9m_8fa1c0",
  "balance":   742,
  "available": 714
}
The reserve / commit / refund pattern keeps the ledger honest even when generation can fail mid-flight: you reserve before kicking off work, commit on success, refund on failure.

Body

amount
number
required
Credits to hold.
label
string
Human-readable purpose (shown in transactions).
meta
object
Free-form structured metadata.
curl -X POST https://api.lavendly.ai/v1/ledger/reserve \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer $LAVENDLY_API_KEY' \
  -d '{ "amount": 10, "label": "video / 5s" }'
{
  "token":     "rsv_lq3z9m_8fa1c0",
  "balance":   742,
  "available": 714
}
Returns 402 insufficient_credits with { needed, have } if the reserve would drive available below zero.