pub fn calculate_cost_split(
model: &str,
input_tokens: u64,
output_tokens: u64,
cache_read: u64,
cache_write_5m: u64,
cache_write_1h: u64,
) -> f64Expand description
Calculate the USD cost of a single model turn with the cache-write TTL split made first-class.
Cache pricing relative to input price:
reads cache_read_multiplier (0.10× by default) | 5m write 1.25× |
1h write 2.0×. Haiku 5.5’s tier is chosen from this request’s prompt
(input_tokens + cache_read + cache_write_5m + cache_write_1h).