Cost Tracking

Predict Cache Cost

Compare the next native Anthropic request on two configured deployment IDs.

Estimates use provider token counting and recent successful cache telemetry for this key. Unknown cache state uses the cold scenario when prices/counts are available. Cache observations do not guarantee retention. v0 supports one message-content breakpoint, text and client tools; system/tool-only breakpoints, thinking, images, nondefault Anthropic versions, beta headers and request transforms are unknown. Each provider count consumes one RPM unit and holds concurrency capacity; a comparison uses up to four counts. The legacy rate limiter returns unknown without contacting the provider. This endpoint does not generate tokens, prewarm caches, choose a model or alter routing.

post/cost/predict-cache

Request body

current_deployment_idstring required
candidate_deployment_idstring required
requestobject required

Response

Successful Response

switch_deltanumber nullable required
cache_rebuild_penaltynumber nullable required
pricing_basis'input_before_discounts_and_margins'
cache_guaranteefalse

Changes

Changed in 1 of the 52 revisions of this API.1