Spend

Caps on what one
account can spend

Reserve credits before an expensive call, then commit what it actually cost.

Decision trace

Example · 100-credit daily account capOver budget
  1. InputReserve 20 credits for user_42. Reserved and committed today: 90.
  2. Reason idsaccount_budget
  3. Decisionallowed: false on a budget cap
  4. Remaining10 credits · no reservation issued

How it works

  1. Set the caps

    Account, device, network and API-key budgets in your own units: credits, cents or tokens.

  2. Reserve first

    Call reserve before inference. Start the call only when allowed is true.

  3. Commit or release

    Send the actual cost, or release the hold. Reservations expire after five minutes.

API

One endpoint, three operations. Keep the secret server-side.

POST https://nolgard.com/v1/spend
Content-Type: application/json

{
  "secret": "SITE_SECRET",
  "op": "reserve",
  "accountId": "user_42",
  "cost": 20
}

// Example response
{
  "allowed": false,
  "remaining": { "account": 10 },
  "reason": "account_budget"
}

Limits