Dollars One Request Bills
easyEvery metering question starts with one number: what does a single request cost? The meter prices the two sides separately because they measure differently - prompt tokens are read and cacheable, output tokens are generated one at a time and never cache - so the request bill is prompt_tokens x in_rate + output_tokens x out_rate, all over 1e6 because rates are per 1M tokens. The numbers interviewers check: a chat turn (800 in, 300 out) on the fast tier ($0.80 in, $4.00 out) bills $0.00184 of which $0.0012 is output; the research agent (12,000 in, 4,000 out) on the flagship ($3, $15) bills $0.096, over 50x the chat turn; and the copilot profile on the frontier tier ($15, $75) bills $0.081 - the same copilot that costs $0.00432 on the fast tier, a nearly 19x step for the tier jump. Two sides, one product: before you argue about model choice or caching, you can say what one call actually costs. Implement request_cost(prompt_tokens, output_tokens, in_rate, out_rate): return dollars billed by one request, rounded to 6 decimals.
Run your code to see output