OpenAI Images API: up to 10 per call—sync burst vs Batch API for Bubble bulk catalogs with BIAIG
`n≤10` means multiple outputs from one prompt—not ten SKU prompts in one HTTP call. Decision matrix for Bubble: when to sync burst, when to run Batch JSONL (~50% off, up to 24h), and how to limit WU on base64, upload, and polling.
Where I got stuck
I was building a bulk catalog in Bubble on the OpenAI Images API and first treated n up to 10 like “ten SKUs in one HTTP call.” Wrong. The sync endpoints POST /v1/images/generations and POST /v1/images/edits on GPT Image models take n from 1–10—multiple images from a single prompt in one request. DALL·E 3 stays at n=1. Catalog scale means many separate requests: many sync calls or a Batch JSONL file where one line = one underlying request. Worth reading next: OpenAI image Batch API (−50%,.
GPT Image models return base64-encoded image data by default, not ephemeral URLs. In my no-code stack, storage and upload in the Image Flow (generate → store) often cost more than inference alone.
Current models (per docs): gpt-image-2.5-flare (fast everyday generation), gpt-image-2.5-sunburst (editing precision), gpt-image-2 remains documented. Batch supports /v1/images/generations and /v1/images/edits. Migrations: gpt-image-1 shuts down 2026-10-23; gpt-image-1-mini, gpt-image-1.5, chatgpt-image-latest on 2026-12-01—replace with Flare or Sunburst. Hard-coded model strings in Bubble plugins or workflows will break on those dates. A closer look: ChatGPT is not bulk-native: where.
NB2→NB2.1 in the brief was not mapped to official model IDs in this research pass—I verify model IDs in actions, not internal nicknames.
BIAIG here is an editorial/internal label for Bubble-side batch + image integration (the public Chakor “OpenAI ChatGPT & GPT-4” plugin lists batch and image actions; Scout found no authoritative doc for the acronym “BIAIG”). Same topic: gpt-image-2 batch discount: unit economics.
Decision matrix (row / SKU)
| Scenario | Mode | Why |
|---|---|---|
| UI preview, “3 more variants of the same prompt”, A/B on one copy | Sync, n 2–10 |
Seconds latency; one prompt → several outputs |
| ≤10 SKUs, distinct prompts, urgent | Sync, n=1 × N calls |
Batch won’t meet latency; watch sync rate limits |
| Hundreds–thousands of spreadsheet catalog rows | Batch JSONL | ~50% lower cost vs sync, separate rate-limit pool; up to 24h completion window (often faster) |
| Per-SKU edits with reference photos | Batch /v1/images/edits or sync |
Mind 200 MB per file; large edit batches favor URLs over embedded base64 in JSONL |
| Flare vs Sunburst | Model choice | Quality/speed/editing tradeoff—not the Batch vs sync switch; one model per batch file |
Rule of thumb: n≤10 = variant burst for one intent; bulk catalog = JSONL + custom_id = your row/SKU id, usually n=1 per line unless you deliberately want multi-variant SKUs.
Batch in numbers (from docs)
- JSONL input, up to 50,000 requests and 200 MB per batch; no streaming.
- Output order not guaranteed—reconcile only via
custom_id. - Expired batches: billed for completed work, remainder dropped—partial catalog risk.
- Operational chunking: ~500 rows per job—easier reruns, smaller blast radius, simpler debugging of one bad prompt.
Bubble: unit economics beyond tokens
OpenAI Batch saves ~50% on inference; in Bubble I treat total cost as WU + runtime:
- Submit batch—one backend/API action (BIAIG or plugin batch action).
- Polling—scheduled backend workflows until terminal status. Each poll consumes WU; I’ve seen scheduled volume blow up without caps, backoff, or max iterations (common forum pattern).
- Download output file + parse JSONL—more WU and runtime.
- Base64 → binary → upload to storage / update Things—often heavier than token cost, especially sync bursts with
n>1.
What I do: sync burst for interactive flows; catalogs via Batch + sparse polling (e.g. every N minutes, not every 10s) and idempotent “already processed batch_id”. On finance: batch discounts may be unclear in token-oriented usage views—I reconcile billed spend, not tokens alone (community anecdote, not official policy).
Pre-flight checklist
- Model strings → Flare / Sunburst /
gpt-image-2, not sunsetgpt-image-1*. - Each JSONL line: endpoint, model,
custom_id= spreadsheet row id,n=1unless multi-variant by design. - Split into ~500-row chunks; separate batch file per model.
- Reconciliation job: output → SKU; alert on missing
custom_id. - Estimate WU: poll interval × expected hours + upload per image.
- Plan B: sync
n=1lane for urgent rows outside batch.
| Check | Requirement | Avoid / exception |
|---|---|---|
| Model strings | Flare, Sunburst, gpt-image-2 |
Sunset gpt-image-1* |
| Each JSONL line | endpoint, model, custom_id = spreadsheet row id, n=1 |
n ≠ 1 unless multi-variant by design |
| Batch split | ~500-row chunks; separate batch file per model | — |
| Reconciliation job | output → SKU | Alert on missing custom_id |
| Estimate WU | poll interval × expected hours + upload per image | — |
| Plan B | Sync n=1 lane for urgent rows outside batch |
— |
Sources (Scout packet)
OpenAI API reference (generate), Image generation guide, Batch guide & FAQ, Pricing, Flare/Sunburst model pages, Deprecations; Bubble plugin listing (Chakor); Forum—scheduled backend polling.
Internal digest article; do not publish externally.