An agent run might make a dozen LLM calls before it finishes, each with its own input and output token count, and each possibly billed at a different rate if the agent switched models mid-run (a cheap model for routing, an expensive one for the final answer). "How much did this run cost" only has an answer if every one of those calls is accounted for.
Write compute_run_cost(calls) that takes a list of (input_tokens, output_tokens, input_price_per_1k, output_price_per_1k) tuples and returns a dict with the summed total_input_tokens, total_output_tokens, and total_cost across every call.
No results yet
Run your code to check it against the examples, or submit to run every test.