(
*,
input_tokens_uncached: int,
output_tokens: int,
cache_read_input_tokens: int,
cache_write_input_tokens: int,
pricing: ModelPricing,
)
| 429 | |
| 430 | |
| 431 | def estimate_usage_cost( |
| 432 | *, |
| 433 | input_tokens_uncached: int, |
| 434 | output_tokens: int, |
| 435 | cache_read_input_tokens: int, |
| 436 | cache_write_input_tokens: int, |
| 437 | pricing: ModelPricing, |
| 438 | ) -> float: |
| 439 | return estimate_input_cost( |
| 440 | input_tokens_uncached=input_tokens_uncached, |
| 441 | cache_read_input_tokens=cache_read_input_tokens, |
| 442 | cache_write_input_tokens=cache_write_input_tokens, |
| 443 | pricing=pricing, |
| 444 | ) + ((output_tokens / 1_000_000) * pricing.output_price) |
| 445 | |
| 446 | |
| 447 | def _stable_prompt_cache_key( |
no test coverage detected