Skip to main content

Interface: SpendExceedsOptions

Defined in: packages/core/src/utils/spend.ts:91

Properties​

onExceeded?​

optional onExceeded?: (spentUsd) => void

Defined in: packages/core/src/utils/spend.ts:101

Called once, when the ceiling is first reached, with the spend that reached it.

Parameters​

spentUsd​

number

Returns​

void


price?​

optional price?: PriceStep

Defined in: packages/core/src/utils/spend.ts:93

Price a step (see tokenPricing). Default: provider-reported cost only.


readSpend?​

optional readSpend?: () => number | Promise<number>

Defined in: packages/core/src/utils/spend.ts:99

Spend that counts against this ceiling but happened outside this loop (earlier turns of the same run, sub-agents, auxiliary calls). Read before every check; may be async (e.g. a ledger query).

Returns​

number | Promise<number>