diegosouzapw/OmniRoute · error
Codex hosted image_generation returns one image per call…
Error message
Codex hosted image_generation returns one image per call; requested n=${requestedCount} will fan out in parallel What it means
Informational notice: the Codex hosted image_generation endpoint produces exactly one image per API call, but the request asked for n>1. The handler transparently fans out n parallel calls to satisfy the request, so latency/cost scale linearly with n — this is a behavior note, not a failure.
Solutions
- No fix required — fan-out is automatic
- Reduce n if cost/latency of parallel calls is a concern
- Batch consciously: n parallel upstream calls consume quota n times
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at open-sse/handlers/imageGeneration.ts:2571 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/0f8cf6b826da4e3f.
Report an issue: GitHub.
Appendix: source
Thrown at open-sse/handlers/imageGeneration.ts:2571
logPath = "/v1/images/generations",
}) {
const startTime = Date.now();
const prompt = typeof body.prompt === "string" ? body.prompt : "";
if (!prompt.trim()) {
return saveImageErrorResult({
provider,
model,
status: 400,
startTime,
error: "Prompt is required for Codex image generation",
path: logPath,
});
}
const requestedCount =
Number.isInteger(body.n) && (body.n as number) > 0 ? (body.n as number) : 1;
if (log && requestedCount > 1) {
log.warn(
"IMAGE",
`Codex hosted image_generation returns one image per call; requested n=${requestedCount} will fan out in parallel`
);
}
const token = credentials?.accessToken || credentials?.apiKey;
if (!token) {
return saveImageErrorResult({
provider,
model,
status: 401,
startTime,
error: "Codex credentials missing accessToken — reconnect the Codex provider",
path: logPath,
});
}
const workspaceId =View on GitHub (pinned to a179ffed5b)