Skip to main content

calculate_cost

Function calculate_cost 

Source
pub fn calculate_cost(
    model: &str,
    input_tokens: u64,
    output_tokens: u64,
    cache_read_tokens: u64,
    cache_write_tokens: u64,
) -> f64
Expand description

Calculate USD cost from token usage.