diegosouzapw/OmniRoute · error
ChatGPT Web returns one image per chat turn; requested n=
Error message
ChatGPT Web returns one image per chat turn; requested n=${requestedCount} will run sequentially What it means
Informational notice: ChatGPT Web produces one image per chatgpt.com chat turn (~30s each), and the request asked for n>1 (capped at 4). The handler runs the turns sequentially to fulfill the request, so total latency is roughly n × 30s — a behavior/cost warning, not a failure.
Solutions
- No fix required — sequential turns are automatic
- Keep n within the cap of 4 to avoid executor pinning
- Prefer a native API provider when parallel/faster multi-image generation is needed
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at open-sse/handlers/imageGeneration/providers/chatgptWeb.ts:88 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/8d5b5a2b19f960f7.
Report an issue: GitHub.
Appendix: source
Thrown at open-sse/handlers/imageGeneration/providers/chatgptWeb.ts:88
}
// Each image is one chatgpt.com chat turn (~30s). Cap at 4 (matches OpenAI's
// own limit for GPT Image models) so a stray n=1000 doesn't pin the
// executor for hours before the upstream HTTP timeout fires.
const CHATGPT_WEB_IMAGE_N_MAX = 4;
const rawCount = Number.isInteger(body.n) && (body.n as number) > 0 ? (body.n as number) : 1;
if (rawCount > CHATGPT_WEB_IMAGE_N_MAX) {
return saveImageErrorResult({
provider,
model,
status: 400,
startTime,
error: `ChatGPT Web image generation supports n=1..${CHATGPT_WEB_IMAGE_N_MAX} (got ${rawCount}); each n is a separate ~30s chat turn.`,
});
}
const requestedCount = rawCount;
if (log && requestedCount > 1) {
log.warn(
"IMAGE",
`ChatGPT Web returns one image per chat turn; requested n=${requestedCount} will run sequentially`
);
}
const wantsBase64 = body.response_format === "b64_json";
const images: Array<{ url?: string; b64_json?: string }> = [];
const requestBody = {
model,
prompt: prompt.slice(0, 500),
size: body.size || undefined,
quality: body.quality || undefined,
};
for (let i = 0; i < requestedCount; i++) {
const executor = executorFactory();
const result = await executor.execute({
model,View on GitHub (pinned to a179ffed5b)