promptdojo_

The 2023-2026 model price war — and why your cost model is already obsolete — step 7 of 8

Write cost_per_user_month(usage) that takes a usage profile dict and returns the projected dollar cost per user per month as a float rounded to 2 decimals.

usage has four fields:

  • messages_per_day: int — how many model calls per day for this user
  • avg_input_tokens: int — average input tokens per call
  • avg_output_tokens: int — average output tokens per call
  • model: str — one of "haiku", "sonnet", "opus"

Use these 2026-real prices per million tokens (input / output):

  • haiku: $1.00 / $5.00
  • sonnet: $3.00 / $15.00
  • opus: $5.00 / $25.00

Treat one month as 30 days.

Two demo users run. Expected output:

power user (haiku):  $1.72/user/mo
pro user (sonnet):   $4.14/user/mo

full-screen editor opens — close anytime to keep reading.