mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5749] [Issue]: OpenRouter GPT Image 2 is routed through chat completions with unsupported image,text modalities #3178
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3178
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CDitfort on GitHub (Sep 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5749
Originally assigned to: @Gunterlie on GitHub.
Summary
OpenRouter image generation fails for GPT Image 2 with:
OpenRouter image generation failed (404):
{"error":{"message":"No endpoints found that support the requested output modalities: image, text","code":404}}
The connection is correctly configured as Image Generation → OpenRouter. Marinara routes both gpt-image-2 and the canonical openai/gpt-image-2 through /chat/completions with modalities: ["image", "text"].
OpenRouter exposes GPT Image 2 as openai/gpt-image-2 through its dedicated POST /api/v1/images endpoint, with image-only output. OpenRouter image-generation documentation
(https://openrouter.ai/docs/guides/overview/multimodal/image-generation), GPT Image 2 model page (https://openrouter.ai/openai/gpt-image-2).
Expected behavior
Marinara should:
Actual behavior
usesOpenRouterImagesApi() currently recognizes only:
GPT Image therefore falls through to the chat-completions path. openRouterModalities() defaults that request to:
["image", "text"]
No GPT Image 2 endpoint supports that output combination, resulting in the 404.
Additionally, buildOpenRouterImagesRequest() always sends resolution: "1K". GPT Image 2’s current capability record supports fields such as aspect_ratio and quality, but not resolution. OpenRouter Image Models API
(https://openrouter.ai/api/v1/images/models).
Steps to reproduce
Environment
479dcf7788Recommended fix
Apply provider-specific normalization without changing the shared bare OpenAI model IDs used by direct OpenAI connections:
function normalizeOpenRouterImagesApiModel(model?: string): string | undefined {
const trimmed = model?.trim();
if (!trimmed) return undefined;
return /^gpt-image-/i.test(trimmed)
?
openai/${trimmed.toLowerCase()}: trimmed;
}
export function usesOpenRouterImagesApi(model?: string): boolean {
const lower = normalizeOpenRouterImagesApiModel(model)?.toLowerCase() ?? "";
return (
lower.startsWith("krea/") ||
lower.startsWith("bytedance-seed/seedream-") ||
lower.startsWith("openai/gpt-image-")
);
}
When building the Images API request:
const model =
normalizeOpenRouterImagesApiModel(request.model) ??
"krea/krea-2-medium";
const body: Record<string, unknown> = {
model,
prompt,
};
if (!model.toLowerCase().startsWith("openai/gpt-image-")) {
body.resolution = "1K";
}
Longer term, model routing could use /api/v1/images/models capability metadata instead of maintaining provider-prefix allowlists.
Suggested regression coverage
Additional context
The API key is valid and the OpenRouter model catalog loads successfully. This is a request-routing issue rather than an authentication failure.