promptdojo_

This estimator uses ONE rate for both input and output tokens. But output is 5× the price of input on most Anthropic models — so this code under-estimates the real bill by ~60% on a typical chat workload.

Real numbers: Claude Sonnet 4.6 is $3/1M input, $15/1M output. Fix the code to track the two rates separately and apply the correct rate to each side.

Expected output:

estimated cost: $0.036
The break is on lines 6, 8 — but read the whole snippet first.

this step needs the editor

on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.

open this same url on a laptop to keep going today.