Skip to main content

Module cache_cost

Module cache_cost 

Source
Expand description

What prompt caching cost and saved, priced the same way on every provider.

Structs§

CacheCost
A request’s or a run’s input tokens by how they are billed, plus the token-hours its cache resources were stored. Sum the costs of a run’s calls (and of any cache resources beside them) and price the total with CacheCost::usd.
CacheRates
Prices of one model and tier, in USD per 1M tokens (storage: per 1M token-hours). The built-in catalog’s Pricing holds the input, cached-read and cache-write prices of the models it lists, but no storage price. A provider without a separate write price bills writes at input; one without storage leaves storage_per_hour at zero.