Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

To batch-generate images, prepare one image-generation request for each prompt, submit the collection to a provider’s asynchronous batch API, save the returned job ID, and retrieve the results when processing finishes. A batch is not one prompt asking for a set of images in one instant call: it is a group of separate requests processed together. For large, non-urgent jobs, batching can reduce cost; for interactive work that needs an image immediately, use ordinary synchronous requests instead.

What an image-generation batch does

A batch groups individual API requests for asynchronous processing. Each input record has its own prompt and generation parameters, and the provider processes the records after you submit the job. You track the job separately and collect its output later; accepting a job is not the same as completing it.

OpenAI’s Batch API guide lists image generations and image edits among its supported endpoints, including /v1/images/generations and /v1/images/edits. Google’s Gemini Batch API accepts inline requests for smaller payloads or JSON Lines input files for larger collections. The request format and job mechanics differ, so use the selected provider’s current documentation rather than assuming that one provider’s JSONL or status workflow transfers to another. OpenAI Batch API documentation and Google Gemini Batch API documentation describe their respective workflows.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When batching is the right choice

Choose a batch for a large, non-urgent run

Batching is useful when you have many prompts to process without waiting for each image before moving to the next one—for example, preparing a catalog of draft illustrations or generating a set of concept images overnight. Both OpenAI and Google describe a 50% cost reduction compared with their synchronous API pricing and a 24-hour processing window or target. Those are provider-published terms, not independent performance measurements or a promise that a job will finish at a particular hour. Check the applicable model’s current price and billing details before estimating your run.

#1 Best Overall
Wacom Intuos Small, Wired Graphic Drawing Tablet with Pen + Software
  • Wacom Intuos Small Graphics Drawing Tablet: Enjoy industry leading tablet performance in superior control and precision with Wacom's EMR, battery free technology that feels like pen on paper
  • Works With All Software: Wacom Intuos tablet can be used in any software program to explore new facets of digital creativity; draw, paint, edit photos/videos, create designs, and mark up documents
  • What the Professionals Use: Wacom's industry leading pen technology and pen to paper feeling makes it the preferred drawing tablet of professional graphic designers
  • Software and Training Included: Only Wacom gives you software with every purchase. Register your Intuos tablet and gain access to some of the best creative software and Wacom's online training
  • Wacom is the Global Leader in Drawing Tablet and Displays: For over 40 years in pen display and tablet market, you can trust that Wacom to help you bring your vision, ideas and creativity to life

Use synchronous requests for interactive work

If a person is waiting for an image in an app, you are iterating on a prompt, or you need to show a result immediately, ordinary requests are usually a better fit. A batch trades immediacy for potential cost savings and throughput. Google says batch completion is often quicker than its 24-hour target, but it remains asynchronous; do not design a user-facing workflow around immediate completion.

Plan inputs so every result can be traced

Make one request record for each image you want generated. Give every record a unique caller-controlled key, such as a product ID or prompt ID. Do not rely on output order to associate images with prompts: use the returned key or request identifier to join output and errors back to your original input.

  • Keep a durable copy of the exact input file and the provider’s batch or job ID.
  • Validate that the selected model supports the endpoint and parameters you plan to send.
  • Check prompt text, dimensions, optional edit/reference-image inputs, and payload size before submission.
  • Decide where outputs and error records will be stored, and how long your system needs to retain them.
  • Check the account’s current limits, model availability, and queued-work quotas immediately before implementation.

OpenAI example: create and collect an image batch

This Python example creates two image requests in JSONL, uploads the file, submits it to OpenAI’s image-generation endpoint, polls the batch status, and saves each successful image as a PNG. Set OPENAI_API_KEY in the environment before running it. The example uses the documented JSONL batch pattern and the image-generation request structure; confirm current model names, supported parameters, and output fields in the image-generation guide and Batch API guide before adapting it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
XPPen Deco 01 V3 10x6 Drawing Tablet, 16K Battery-Free Stylus, 8 Keys
  • Word-first 16K Pressure Levels: The upgraded stylus features 16,384 levels of pressure sensitivity and supports up to 60 degrees of tilt, delivering smoother lines and shading for a natural drawing experience. With no battery or charging needed, it operates like a real pen, making it easy for beginners to create effortlessly. This functionality helps novice artists develop their skills and explore their creativity without the intimidation of complex tools
  • Designed for Beginners: This drawing pad desinged with 8 customizable shortcuts for both right and left-hand users, express keys create a highly ergonomic and convenient work platform
  • Perfectly Adapted for Android: The XPPen Deco 01 V3 art tablet supports connections with Android devices running version 10.0 and above. It is recommended to download the XPPen Tools Android application, which adapts to your smartphone's screen aspect ratio, ensuring accurate mapping. It also supports mapping on Android screens with different aspect ratios in portrait mode
  • Large Drawing Space, Bigger Bold Inspiration: This expansive drawing pad has10 x 6.25-inch helps you break through the limit between shortcut keys and drawing area
  • Easy Connectivity for Beginners: The Deco 01 V3 offers USB-C to USB-C connectivity, plus adapters for USB C. This ensures easy connection to various devices, allowing beginner artists to set up quickly and focus on their creativity without compatibility concerns. Whether using a laptop, tablet, or desktop, the Deco 01 V3 provides a seamless experience, making it an ideal choice for those just starting their digital art journey
import base64
import json
import os
import time
from pathlib import Path

import requests

API_KEY = os.environ["OPENAI_API_KEY"]
BASE = "https://api.openai.com/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

prompts = [
    ("blue-mug", "A blue ceramic mug on a bright kitchen table, product photo"),
    ("red-chair", "A red modern chair in a sunlit reading nook, product photo"),
]

# Keep this file: it is the durable record for mapping results to inputs.
input_path = Path("image_batch.jsonl")
with input_path.open("w", encoding="utf-8") as f:
    for key, prompt in prompts:
        record = {
            "custom_id": key,
            "method": "POST",
            "url": "/v1/images/generations",
            "body": {
                "model": "gpt-image-1",
                "prompt": prompt,
                "size": "1024x1024"
            },
        }
        f.write(json.dumps(record) + "n")

# Upload the JSONL input file for batch processing.
with input_path.open("rb") as f:
    uploaded = requests.post(
        f"{BASE}/files",
        headers=HEADERS,
        data={"purpose": "batch"},
        files={"file": f},
        timeout=90,
    )
uploaded.raise_for_status()
input_file_id = uploaded.json()["id"]

# Submit the asynchronous job; save this ID so the job can be resumed later.
created = requests.post(
    f"{BASE}/batches",
    headers={**HEADERS, "Content-Type": "application/json"},
    json={
        "input_file_id": input_file_id,
        "endpoint": "/v1/images/generations",
        "completion_window": "24h",
    },
    timeout=90,
)
created.raise_for_status()
batch = created.json()
batch_id = batch["id"]
Path("image_batch_id.txt").write_text(batch_id, encoding="utf-8")
print("Submitted batch:", batch_id, "status:", batch["status"])

# Poll the job. In production, use a scheduler or provider-supported completion
# mechanism rather than keeping a short-lived process open indefinitely.
while True:
    response = requests.get(f"{BASE}/batches/{batch_id}", headers=HEADERS, timeout=90)
    response.raise_for_status()
    batch = response.json()
    print("Status:", batch["status"])
    if batch["status"] in {"completed", "failed", "expired", "cancelled"}:
        break
    time.sleep(60)

# Download output records and save successful image payloads by custom_id.
if batch.get("output_file_id"):
    result = requests.get(
        f"{BASE}/files/{batch['output_file_id']}/content",
        headers=HEADERS,
        timeout=90,
    )
    result.raise_for_status()
    Path("image_batch_output.jsonl").write_bytes(result.content)

    for line in result.text.splitlines():
        row = json.loads(line)
        key = row.get("custom_id", "unknown")
        if row.get("error"):
            print("Request failed:", key, row["error"])
            continue
        body = row.get("response", {}).get("body", {})
        data = body.get("data", [])
        if not data or not data[0].get("b64_json"):
            print("No image payload for:", key)
            continue
        image_bytes = base64.b64decode(data[0]["b64_json"])
        Path(f"{key}.png").write_bytes(image_bytes)
        print("Saved", f"{key}.png")

if batch.get("error_file_id"):
    errors = requests.get(
        f"{BASE}/files/{batch['error_file_id']}/content",
        headers=HEADERS,
        timeout=90,
    )
    errors.raise_for_status()
    Path("image_batch_errors.jsonl").write_bytes(errors.content)
    print("Saved error records to image_batch_errors.jsonl")

What to change for your own job

  • Replace the sample prompt list with records from your database or input file, preserving a unique custom_id for every desired image.
  • Use only parameters supported by your chosen model and endpoint. The example requests square 1024-by-1024 images; check the current image-generation guide for available sizes and output behavior.
  • For edits, use the documented image-edit endpoint and its required input fields; do not send generation-only request bodies unchanged.
  • Install the dependency with python -m pip install requests. Keep the API key in an environment variable or secrets manager, not in source control or the JSONL file.

The example waits by polling every 60 seconds, but a production application should persist the batch ID and status so it can resume after a restart. Google’s guide also describes completion webhook notifications; follow its current documentation for setup and event details if using Gemini. The precise status values and retrieval mechanism are provider-specific.

Collect results, reconcile records, and retry selectively

When processing finishes, retrieve both output and error records if the provider exposes them. Match each result to its original prompt using the custom key or request identifier. Validate that an image payload exists and can be decoded before marking the prompt successful. Keep failed inputs separate from successful ones so a retry does not regenerate images that already completed and potentially duplicate work or charges.

  1. Persist the final job status and output/error file identifiers.
  2. Download or read the output records and retain the raw response long enough to diagnose issues.
  3. Join every record to its input key; do not assume returned line order matches input order.
  4. Check for an API error, missing image data, or an invalid encoded image before marking a result complete.
  5. Retry only failures that are appropriate to retry, after correcting the cause where needed.

For OpenAI image-generation failures, the official guide recommends handling errors as other API errors: inspect HTTP status codes or SDK exception types, log request IDs, and consult the provider’s error guidance for authentication, quota, rate-limit, and server failures. Do not log secret keys or sensitive prompt content unnecessarily.

Rank #3
Sale
HUION Inspiroy H640P 6x4 inch Drawing Tablet 8192 Pen Pressure
  • Customize Your Workflow: The 6 customizable press keys on Huion H640P drawing tablet for pc let you assign your most-used commands—like undo, zoom, brush switch, or save—so you can keep your hands on the tablet and your mind on the art. Whether you're a digital painter switching brushes, or a comic artist zooming in and out, these keys keep your workflow smooth and uninterrupted. Plus, the Huion driver lets you save different shortcut profiles for different apps, so you never have to reconfigure when switching software.
  • Professional Pen Performance: Huion H640P drawing pad for computer comes with the battery-free PW100 stylus that's always ready when inspiration strikes. With 8192 levels of pressure sensitivity, every light sketch, or bold stroke responds naturally to your hand—just like a real pen. The 5080 LPI resolution and 233 PPS report rate deliver lag-free, precise strokes, so you can draw confidently without second-guessing your cursor. The pen side buttons help you switch between pen and eraser instantly.
  • Compact and Portable: Huion H640P computer graphics tablet features a compact, ultra-portable design at just 0.3 inches thin and 0.61 lbs light, so it slides easily into your backpack—perfect for sketching in coffee shops, taking notes in class, or editing on the go between home and studio. The 6x4 inch active area offers enough room for natural pen movements while fitting comfortably on crowded desks, or lecture hall seats.
  • Stable Compatibility: Huion H640P graphic drawing tablet works seamlessly with Mac, Windows, Linux PCs, and Android smartphones/tablets (OS version 6.0 or later). Left-handed friendly, and you just need to flip the tablet and adjust the settings in the driver. Please note: H640P does NOT support iPhone/iPad.
  • Move Beyond the Mouse: Huion Inspiroy H640P is a pen tablet that replaces your mouse for more natural, precise control. Freehand draw, take notes, or even play OSU—everything you do with a mouse, you can do better with a pen. The precise tip makes it ideal for detailed photo editing, graphic design, or signing PDF. Meanwhile, the ergonomic pen grip helps you avoid the strain that comes from hours of using a mouse.

Limits, price, and provider choice

Batch limits depend on provider, account, and model. OpenAI’s current Batch API guide documents a maximum of 50,000 requests and 200 MB per batch, along with additional queued-token constraints that vary by model. Google documents separate Gemini batch limits, and its rate-limit documentation explains account-level limits. These figures and eligibility can change, so verify the live documentation for your account before uploading a large job: OpenAI Batch API, Gemini Batch API, and Gemini rate limits.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Decision point OpenAI Batch API Google Gemini Batch API
Processing style Asynchronous job using JSONL input; image generation and image edits are listed as supported endpoints in the current guide. Asynchronous batch; supports inline requests for smaller payloads or JSON Lines input files for larger collections.
Provider-published cost claim 50% discount versus synchronous APIs, as stated in the current Batch API guide. 50% cost reduction versus standard cost, as stated in the Gemini Batch API guide.
Published timing 24-hour completion window; not an instant-response service. 24-hour target; Google says jobs often finish sooner, but it is still asynchronous.
Documented scale detail Up to 50,000 requests and 200 MB per batch, plus model-dependent queued-token constraints. Separate provider limits apply; check current batch and account rate-limit documentation.
Completion operations Use the batch ID and provider-documented status and output retrieval workflow. Use the documented asynchronous workflow; the current guide also mentions webhook notifications for completed events.

The cost claims above are provider statements, not a controlled comparison of image quality, latency, or total project cost. Before choosing, confirm the exact image model and endpoint support, edit/reference-image behavior, output format, account quotas, error format, retry approach, and storage requirements. Data residency and retention terms were not established comparably here; consult each provider’s terms for your account and region.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common batch problems

The input file is rejected

Check that it is valid JSONL with one complete JSON object per line, that each record uses the required request fields, and that the endpoint and body match the provider’s current batch format. Validate the model, prompt parameters, line endings, file size, and any file-upload requirements before resubmitting.

Rank #4
Sale
XPPen Artist 13.3 Pro V2 Drawing Tablet with Screen, 16K, Full-Laminated
  • PLEASE NOTE:XPPen Artist13.3 Pro drawing tablet Need to connect with computer,you need to use it with your computer or laptop, the 3 in 1 cable is included
  • Drawing Tablet with Screen: Tilt Function- XPPen Artist 13.3 Pro supports up to 60 degrees of tilt function, so now you don't need to adjust the brush direction in the software again and again. Simply tilt to add shading to your creation and enjoy smoother and more natural transitions between lines and strokes
  • Graphics Tablets: High Color Gamut- The 13.3 inch fully-laminated FHD Display pairs a superb color accuracy of 88% NTSC (Adobe RGB≧91%,sRGB≧123%) with a 178-degree viewing angle and delivers rich colors, vivid images, and dazzling details in a wider view. Your creative world is now as powerful as it is colorful
  • Drawing Pad: One is enough- The sleek Red Dial on the display is expertly designed with creators in mind, its strategic placement allows for natural drawing postures. With just one wheel, you can effortlessly zoom in and out, adjust brush sizes, and flip the canvas—all tailored to suit the habits of everyday artists. The 8 customizable shortcut keys allow you to personalize your setup, streamlining your workflow and enhancing creative efficiency
  • Universal Compatibility & Software Support:supports Windows 7 (or later), Mac OS X 10.10 (or later), Chrome OS 88 (or later), and Linux systems. Fully compatible with major creative software including Photoshop, Illustrator, SAI, and Blender 3D. Register your device to access additional programs like ArtRage 5 and openCanvas for expanded creative possibilities.

The batch was accepted but has no images yet

Submission only creates the asynchronous job. Keep its ID and query the documented status endpoint or use the provider’s supported completion mechanism. A 24-hour window or target is not an immediate deadline guarantee; do not start another full batch just because a job is still processing.

Some requests fail while others succeed

Treat a batch as a collection of requests that can have individual outcomes. Read both output and error records, use the key to isolate failed prompts, and fix invalid parameters, credentials, quota conditions, or transient service errors before retrying only those records.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An output record cannot be matched to a prompt

Use a unique caller-controlled key on every input record and preserve the original JSONL. If keys are missing or duplicated, stop automated publishing and reconcile from provider request identifiers and logs; output order alone is not a safe join key.

Best Value
Sale
Drawing Tablet XPPen StarG640 Digital Graphic Tablet 6x4 Inch Art Tablet with Battery-Free Stylus Pen Tablet for Mac, Windows and Chromebook (Drawing/E-Learning/Remote-Working)
  • Battery-Free Pen: StarG640 drawing tablet is the perfect replacement for a traditional mouse! The XPPen advanced Battery-free PN01 stylus does not require charging, allowing for constant uninterrupted Draw and Play, making lines flow quicker and smoother, enhancing overall performance
  • Ideal for Online Education: XPPen G640 graphics tablet is designed for digital drawing, painting, sketching, E-signatures, online teaching, remote work, photo editing, it's compatible with Microsoft Office apps like Word, PowerPoint, OneNote, Zoom, Xsplit etc. Works perfect than a mouse, visually present your handwritten notes, signatures precisely
  • Compact and Portable: The G640 art tablet is only 2 mm thick, it's as slim as all primary level graphic tablets, allowing you to carry it with you on the go
  • Chromebook Supported: XPPen G640 digital drawing tablet is ready to work seamlessly with Chromebook devices now, so you can create information-rich content and collaborate with teachers and classmates on Google Jamboard’s whiteboard; Take notes quickly and conveniently with Google Keep, and effortlessly sketch diagrams with the Google Canvas
  • Multipurpose Use: Designed for playing OSU! Game, digital drawing, painting, sketch, sign documents digitally, this writing tablet also compatible with Microsoft Office programs like Word, PowerPoint, OneNote and more. Create mind-maps, draw diagrams or take notes as replacement for mouse

Polling stops unexpectedly

Persist the job ID outside the polling process. On restart, retrieve the existing job’s current state rather than submitting the same input again. Use a bounded polling interval and backoff for transient HTTP errors, and capture status codes and request IDs for diagnosis.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server, not an image-generation batch API; it does not replace the image-generation workflow above. If your project also needs website screenshots—for example, capturing generated pages or web previews—one GET request can capture a URL. The API removes supported cookie banners, newsletter popups, and chat widgets before the shot; bot checks, blank pages, failed loads, and cache hits are not billed. An MCP server lets AI agents use screenshot tools, and the free plan includes 1,000 screenshots a month without a card; paid plans start at $5 for 3,000. See ScreenshotNeo and its API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Sign up for 1,000 free screenshots a month, with no card required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does one batch prompt generate several images in one request?

No. A batch normally groups separate generation requests for asynchronous processing. Use the image model’s own request parameters to control what each individual request generates.

Can I use batch generation for a live image preview?

Batch processing is asynchronous and has a provider-published 24-hour window or target, so use synchronous requests when a user needs an immediate result.

Can I batch image edits as well as new generations?

OpenAI’s Batch API guide lists both image generations and image edits as supported endpoints. Confirm the selected provider’s current endpoint and input requirements before submitting edits.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.