promptdojo_

The cost math — when AI video is viable and when it bankrupts you — step 5 of 6

Write cost_per_minute(model, retake_rate) that takes:

  • model (str): one of the keys in the PRICES dict below.
  • retake_rate (float): the retake multiplier (1.0 = no retakes, 10.0 = generate 10x the final length).

Return a float — dollars per minute of FINISHED video. The formula is:

cost_per_minute = price_per_sec × 60 × retake_rate

If the model name is not in the PRICES dict, raise ValueError("unknown model: {model}").

Round the returned float to 2 decimal places using round(x, 2).

Five rows run. Expected output:

Hailuo 02 (768p) @ 2.5x       = $  6.75/min
Sora 2 (720p) @ 4.0x          = $ 24.00/min
Sora 2 Pro (1024p) @ 4.0x     = $120.00/min
Veo 3 (with audio) @ 1.5x     = $ 36.00/min
Kling 3.0 standard @ 3.0x     = $ 15.12/min

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