19 lines
503 B
Python
19 lines
503 B
Python
from services.extraction.domain.costs import compute_cost_from_usage
|
|
|
|
|
|
def test_gpt_5_6_luna_pricing_includes_cached_tokens() -> None:
|
|
usage = {
|
|
"prompt_tokens": 2_000_000,
|
|
"completion_tokens": 1_000_000,
|
|
"prompt_tokens_details": {"cached_tokens": 1_000_000},
|
|
}
|
|
|
|
cost = compute_cost_from_usage(usage, model="gpt-5.6-luna")
|
|
|
|
assert cost == {
|
|
"input_usd": 0.20,
|
|
"cached_input_usd": 0.02,
|
|
"output_usd": 1.20,
|
|
"total_usd": 1.42,
|
|
}
|