promptdojo_

Write cost_for_batch(model, count, options=None) that returns the total batch cost in USD, rounded to 2 decimals.

Use this exact PRICING table (real 2026 per-image rates, provided in the starter):

  • nano-banana: $0.039 (Gemini 2.5 Flash Image)
  • flux-1.1-pro: $0.04 (Black Forest Labs API)
  • flux-pro-ultra: $0.06 (Flux.1.1 Pro Ultra at 4MP)
  • midjourney: $0.10 (per-image equivalent on a Standard plan)
  • dall-e-3: $0.04 (1024x1024 standard quality)
  • ideogram-3: $0.0375 (Default tier)
  • gpt-image-1-mini: $0.005 (Low quality)
  • imagen-4: $0.04 (Google Vertex AI)
  • imagen-4-ultra: $0.06

options may include {"upscale": True} — if so, add $0.06 per image (the Imagen 4 upscale rate) to the base cost.

Return a float, rounded to 2 decimals via round(x, 2).

Four cases run. Expected output:

nano-banana x 100:        $3.90
flux-1.1-pro x 25:        $1.00
midjourney x 100:         $10.00
dall-e-3 x 50 + upscale:  $5.00

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.