Skip to content
Fossa

Amounts and rounding

Amounts and rounding

Rates { input, cached, output } uses payment atoms per million tokens. Usage { uncached, cached, output } uses token counts. Rates::charge rounds each usage category up separately; Rates::reserve covers maximum uncached input, output, and one rounding atom. These methods return provider amounts before surcharge.

Use with_list_fee(amount, fee_bps) for the total. Read the actual list or booking rate. parse_usdc accepts at most six fractional digits; parse_atomic accepts integer atoms. Keep integers through all accounting.

OfferTerms contains rates, speed_tps, private, active, the retained legacy capacity field, exact checkpoint, input/output modality masks, context_window, max_input, and max_output. The benchmark convention defines the declared speed measurement. A local quote does not guarantee execution.