---
title: "Predict Cache Cost"
method: POST
path: "/cost/predict-cache"
tags: ["Cost Tracking"]
---

# Predict Cache Cost

`POST /cost/predict-cache`

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.

## Request body

- CachePredictionRequest
  - `current_deployment_id` string, required
  - `candidate_deployment_id` string, required
  - `request` object, required

## Response `200`

Successful Response

- CachePredictionResponse
  - `stay` CachePredictionArm, required
    - `deployment_id` string, required
    - `model` string, nullable
    - `cache_state` 'warm' | 'partial' | 'stale' | 'unknown' | 'disabled'
    - `reason` string, nullable
    - `estimate` CacheCostScenario
      - `tokens` CacheTokenBuckets, required
        - `uncached_input_tokens` integer
        - `cache_read_input_tokens` integer
        - `cache_creation_5m_input_tokens` integer
        - `cache_creation_1h_input_tokens` integer
      - `input_cost` number, required
    - `cold` CacheCostScenario
      - `tokens` CacheTokenBuckets, required
        - `uncached_input_tokens` integer
        - `cache_read_input_tokens` integer
        - `cache_creation_5m_input_tokens` integer
        - `cache_creation_1h_input_tokens` integer
      - `input_cost` number, required
    - `warm` CacheCostScenario
      - `tokens` CacheTokenBuckets, required
        - `uncached_input_tokens` integer
        - `cache_read_input_tokens` integer
        - `cache_creation_5m_input_tokens` integer
        - `cache_creation_1h_input_tokens` integer
      - `input_cost` number, required
    - `evidence` CacheEvidence
      - `observed_at` number, required
      - `expires_at` number, required
      - `source` 'provider_usage'
      - `confidence` 'observed'
    - `token_count_source` 'anthropic_count_tokens', nullable
  - `switch` CachePredictionArm, required
    - `deployment_id` string, required
    - `model` string, nullable
    - `cache_state` 'warm' | 'partial' | 'stale' | 'unknown' | 'disabled'
    - `reason` string, nullable
    - `estimate` CacheCostScenario
      - `tokens` CacheTokenBuckets, required
        - `uncached_input_tokens` integer
        - `cache_read_input_tokens` integer
        - `cache_creation_5m_input_tokens` integer
        - `cache_creation_1h_input_tokens` integer
      - `input_cost` number, required
    - `cold` CacheCostScenario
      - `tokens` CacheTokenBuckets, required
        - `uncached_input_tokens` integer
        - `cache_read_input_tokens` integer
        - `cache_creation_5m_input_tokens` integer
        - `cache_creation_1h_input_tokens` integer
      - `input_cost` number, required
    - `warm` CacheCostScenario
      - `tokens` CacheTokenBuckets, required
        - `uncached_input_tokens` integer
        - `cache_read_input_tokens` integer
        - `cache_creation_5m_input_tokens` integer
        - `cache_creation_1h_input_tokens` integer
      - `input_cost` number, required
    - `evidence` CacheEvidence
      - `observed_at` number, required
      - `expires_at` number, required
      - `source` 'provider_usage'
      - `confidence` 'observed'
    - `token_count_source` 'anthropic_count_tokens', nullable
  - `switch_delta` number, nullable, required
  - `cache_rebuild_penalty` number, nullable, required
  - `pricing_basis` 'input_before_discounts_and_margins'
  - `cache_guarantee` false

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-30** `85ac4287140e` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/flock/apis/litellm-api/changes/cost/predict-cache/post.md)

---

[API](https://skmtc.dev/flock/apis/litellm-api.md) · [All operations](https://skmtc.dev/flock/apis/litellm-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flock/apis/litellm-api/revisions/ee3a9ebe33fd?raw)
