promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_

The image pipeline — turning one idea into a hundred shipped assets — step 6 of 7

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 per-image rates as of September 2026, provided in the starter):

  • gemini-3.1-flash-image: $0.067 (Nano Banana 2 at 1K)
  • gemini-3.1-flash-lite-image: $0.0336 (1K only)
  • gemini-3-pro-image: $0.134 (1K/2K)
  • gpt-image-2: $0.053 (square, quality=medium)
  • ideogram-v4: $0.06 (Default tier)
  • flux-2-pro: $0.03 (from $0.03/MP)
  • flux-2-klein: $0.014
  • recraftv4_1: $0.035 (raster)

options may include {"resolution": "4K"}. If the model is gemini-3.1-flash-image, use $0.151 per image. If the model is gemini-3-pro-image, use $0.24 per image. Other models ignore the flag and stay on the table.

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

Four cases run. Expected output:

nb2 1K x 100:              $6.70
lite 1K x 100:             $3.36
flux-2-pro x 25:           $0.75
nb2 4K x 50:               $7.55

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