Skip to main content
POST
reserve the maximum permitted usage before work runs

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The authorize request

key
string
required

The budget's key, chosen by you and unique within the project. Up to 128 letters, digits, and : / _ . @ -, starting with a letter or digit.

Pattern: ^[A-Za-z0-9][A-Za-z0-9:/_.@-]{0,127}$
Example:

"customer:acme"

amount
string
required

The maximum permitted usage to reserve against every hard limit. Settle final usage up to this amount, or release after confirming zero usage and no continuing work.

Pattern: ^\d{1,19}(\.\d{1,8})?$
Example:

"0.05"

idempotencyKey
string
required

Up to 256 characters. A retry with the same key and the same request replays the first answer; the same key with a different request returns 409.

Required string length: 1 - 256
Example:

"run_8f2c:step_3"

ttlMs
integer

The execution deadline, in milliseconds. Defaults to the budget's holds.defaultTtlMs and must not exceed holds.maxTtlMs. A hold still open at expiry is settled at its full amount, never released: the capacity stays used until its window resets, and a later settle succeeds only for that amount.

Required range: x > 0
Example:

60000

Response

The hold

allowed
enum<boolean>
required
Available options:
true
holdId
string
required

The hold, as returned by authorize

Pattern: ^h_[1-9][0-9]{0,15}$
Example:

"h_42"

amount
string
required

The amount held

expiresAt
integer
required

The deadline for work, in epoch milliseconds. A hold still open then is settled at its full amount.

replayed
boolean
required

True when this answer replays an earlier request instead of applying it again

balance
object
required