Skip to content

Bulk image generation API

For thousands or hundreds of thousands of images, three things matter: the total cost, the speed, and what a failure costs. Here every image has a fixed price (from $0.012), an image you do not get is free, and a retry can carry an idempotency key.

Checked on 2026-11-19

The cost of 10,000 and 100,000 images

Model (1K)10,000: here10,000: official100,000: here100,000: official
gpt-image-2$80$2,110$800$21,100
gpt-image-2.6$80$530$800$5,300
nano-banana-2.1$120$336$1,200$3,360
nano-banana-pro$200$1,340$2,000$13,400

Here is at the $100 pack rate, which applies to any top-up of $100 or more. The official figure is at high quality, 1K, with prompt input; sources: OpenAI, Google. The price of each model is on the models page.

How fast it runs

  • An account may have 50 requests in progress and send 300 requests a minute. Beyond that the API answers 429.
  • A request can ask for several images: up to 10 at 1K, 4 at 2K and 2 at 4K. So up to 500 1K images can be in the making at once.
  • A 1K image usually takes 20 to 40 seconds; the flare and sunburst versions take 30 to 90 seconds at high quality.
  • For more concurrency, write to support@cheapestimagen.com with your volume.

Failures and retries

  • A failed or timed-out request is not charged; when only some images of a request succeed, only those are charged.
  • Send an Idempotency-Key header when you retry: a request with the same key is never run twice or charged twice.
  • On a 429, wait and try again, doubling the wait each time.
  • Ask for links with response_format: "url". A link works for 72 hours, so copy the files to your own storage.
import asyncio
from openai import AsyncOpenAI, RateLimitError

client = AsyncOpenAI(base_url="https://api.cheapestimagen.com/v1", api_key="YOUR_KEY")
gate = asyncio.Semaphore(50)  # the account limit on requests in progress

async def make(prompt: str, key: str):
    async with gate:
        for attempt in range(5):
            try:
                r = await client.images.generate(
                    model="nano-banana-2.1", prompt=prompt, size="1024x1024", response_format="url",
                    extra_headers={"Idempotency-Key": key},  # a retry never charges twice
                )
                return r.data[0].url
            except RateLimitError:
                await asyncio.sleep(2 ** attempt)

async def main(prompts):
    return await asyncio.gather(*(make(p, f"job-{i}") for i, p in enumerate(prompts)))

The limits are set out in Rate limits and bulk generation and every error code in the errors guide. To run it in n8n, see Use with n8n.

Questions

Is there a volume discount?

From a $100 top-up up, a credit costs $0.001, which is already the lowest rate.

Is there a batch endpoint?

There is no separate endpoint for submitting a batch: call the normal endpoint concurrently, as in the example above. To avoid holding connections open, send each request with async: true and read up to 100 tasks at a time with one call to GET /v1/images/tasks?ids=. See the asynchronous requests guide.

Are images refused by content checks charged?

Not on most models; only the stable channels (ids ending in -1k, -2k, -4k) charge for a refusal. Many refusals in a row pause the account for a while.

Make your first image now

5 free images when you sign up, then from $0.008 an image.

Generate an image

Sign in

New accounts get 5 free images.