budget-guard

open budget

Open a hard budget for one agent run before it starts: max dollars, tokens, calls and/or wall-clock seconds. Returns a handle. Give the handle to every sub-agent; they all draw from the same ledger, so one runaway loop or fork cannot exceed the run cap.

post/api/v1/budget-guard/open_budget

Request

  • Base URL: https://cloudforbots.com
  • URL: https://cloudforbots.com/api/v1/budget-guard/open_budget
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Makes the call safe to retry; the same key returns the stored reply for 24h.

X-Request-Idstring

Request body

labelstring

What this run is for, e.g. "nightly code cleanup".

max_usdnumber

Dollar cap for the whole run (your own estimates per call).

max_tokensinteger

Token cap (input + output) for the whole run.

max_callsinteger

Cap on model/tool calls for the whole run.

max_secondsinteger

Wall-clock cap in seconds from now.

ttl_hoursinteger

Handle lifetime (free max 24, Pro max 168). Default 24.

mode'shadow' | 'enforce'

shadow = watch only: track spend and flag where the cap WOULD have stopped the run, never block (free). enforce = return allowed=false at the cap (Pro). Default: enforce on Pro, shadow on free.

Response

Tool result (always includes request_id).

object required

Changes

No recorded changes to this operation across all 1 revision of this API.