estimate_rewarm_cost(
context_tokens: int,
model_spec: str,
policy: PromptCachePolicy
) -> RewarmEstimate| Name | Type | Description |
|---|---|---|
context_tokens* | int | |
model_spec* | str | |
policy* | PromptCachePolicy |
Estimate cold input spend and the incremental cost over a cache hit.
Prices are derived by running two synthetic usage payloads through the
ordinary estimate_cost path -- one billed as a full cache read, one as a
cold request -- so the catalog stays the single source of truth. Outputs
are zeroed on both sides so the delta is input-only.
A provider/model prefix is resolved through _effective_model_name, the
same helper resolve_prompt_cache_policy uses, so a spec that resolved a
policy is priced under the name that policy was chosen for. Letting the two
disagree is what makes a warning silently never fire.
Prefix size to price.
provider:model identifier for the invocation.
Resolved policy, which selects the cache-write price bucket.