Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/rulvar / admissionReserveUsd

Function: admissionReserveUsd()

ts
function admissionReserveUsd(options): number;

Defined in: packages/core/dist/index.d.ts

The admission reserve for a spawn: opts.estCost, else profile.estCost, else price(countTokens(input) + one turn's worth of output), else the engine flat default. The output term is caps.maxOutputTokens clamped to limits.maxOutputTokensPerTurn when the spawn carries one, so a host can bound reserves without hand-written estimates. The priced path uses the SAME price function as settlement (priceUsdOf), so long-context tiers apply to estimates too.

Parameters

ParameterType
options{ caps?: ModelCaps; estCost?: number; flatReserveUsd?: number; inputTokens?: number; maxOutputTokensPerTurn?: number; profileEstCost?: number; }
options.caps?ModelCaps
options.estCost?number
options.flatReserveUsd?number
options.inputTokens?number
options.maxOutputTokensPerTurn?number
options.profileEstCost?number

Returns

number