[GH-ISSUE #5750] OpenRouter: route images-API-only models (qwen-image, muse-image, …) to /api/v1/images #3177

Closed
opened 2026-10-21 06:00:16 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Nelathan on GitHub (Sep 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5750

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Several image-only models on OpenRouter are served exclusively through the
/api/v1/images endpoint and reject /chat/completions. Marinara only routes
krea/ and bytedance-seed/seedream- there (usesOpenRouterImagesApi() in
packages/server/src/services/image/image-generation.ts), so the rest fall
through to the chat path and fail.

Repro

Configure an OpenRouter image_generation connection and generate with, e.g.,
qwen/qwen-image-3, meta/muse-image:

OpenRouter image generation failed (404): {"error":{"message":
"qwen/qwen-image-3 is an image generation model and cannot be used with the
chat/completions endpoint. Use the /api/v1/images endpoint instead.","code":404}}

Observed live on 2026-09-02. microsoft/mai-image-2.5, x-ai/grok-imagine-image-2.0,
and black-forest-labs/flux.2-* do work on the chat path, so this is per-model,
not per-vendor.

Scope

Separate from #5747, which fixes the output-modalities list for the chat path.
This issue is only about endpoint selection: deciding which models must use
/api/v1/images (generateOpenRouterImageApi) instead of /chat/completions.

Possible direction

GET /api/v1/models returns architecture.modality / output_modalities per
model; usesOpenRouterImagesApi() could consult a cached copy of that rather
than a hardcoded prefix list. Needs its own design discussion.

AI assisted

https://claude.ai/code/session_01QkQf21yjsdbNhzcAf77XM6

Originally created by @Nelathan on GitHub (Sep 2, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5750 Originally assigned to: @SpicyMarinara on GitHub. ### Summary Several image-only models on OpenRouter are served exclusively through the `/api/v1/images` endpoint and reject `/chat/completions`. Marinara only routes `krea/` and `bytedance-seed/seedream-` there (`usesOpenRouterImagesApi()` in `packages/server/src/services/image/image-generation.ts`), so the rest fall through to the chat path and fail. ### Repro Configure an OpenRouter `image_generation` connection and generate with, e.g., `qwen/qwen-image-3`, `meta/muse-image`: ``` OpenRouter image generation failed (404): {"error":{"message": "qwen/qwen-image-3 is an image generation model and cannot be used with the chat/completions endpoint. Use the /api/v1/images endpoint instead.","code":404}} ``` Observed live on 2026-09-02. `microsoft/mai-image-2.5`, `x-ai/grok-imagine-image-2.0`, and `black-forest-labs/flux.2-*` do work on the chat path, so this is per-model, not per-vendor. ### Scope Separate from #5747, which fixes the output-modalities list for the chat path. This issue is only about endpoint selection: deciding which models must use `/api/v1/images` (`generateOpenRouterImageApi`) instead of `/chat/completions`. ### Possible direction `GET /api/v1/models` returns `architecture.modality` / `output_modalities` per model; `usesOpenRouterImagesApi()` could consult a cached copy of that rather than a hardcoded prefix list. Needs its own design discussion. AI assisted https://claude.ai/code/session_01QkQf21yjsdbNhzcAf77XM6
bsakaguchi 2026-10-21 06:00:16 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 5, 2026):

Owner: @SpicyMarinara, implementation by Codex in Issue Sweep PR #5865. I have read the issue and all current comments. Work will target staging, reuse existing code, and include focused regression proof; unrelated open/draft PRs remain untouched.

<!-- gh-comment-id:5551230264 --> @SpicyMarinara commented on GitHub (Sep 5, 2026): Owner: @SpicyMarinara, implementation by Codex in Issue Sweep PR #5865. I have read the issue and all current comments. Work will target staging, reuse existing code, and include focused regression proof; unrelated open/draft PRs remain untouched.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 5, 2026):

Completed on staging in #5865 (merge 314a71a586).

Routed known images-only OpenRouter models through the existing Images API adapter, with a bounded fallback for explicit wrong-endpoint errors. Mock HTTP routing passes; live provider availability is not claimed.

Focused regression proof and manual verification boundaries are documented in the PR. Required checks and the full final regression matrix passed; CodeRabbit completed review with all threads resolved. Closing as completed on staging, not a main release.

<!-- gh-comment-id:5552144310 --> @SpicyMarinara commented on GitHub (Sep 5, 2026): Completed on staging in #5865 (merge 314a71a5862f120284bb24014e401e226be79866). Routed known images-only OpenRouter models through the existing Images API adapter, with a bounded fallback for explicit wrong-endpoint errors. Mock HTTP routing passes; live provider availability is not claimed. Focused regression proof and manual verification boundaries are documented in the PR. Required checks and the full final regression matrix passed; CodeRabbit completed review with all threads resolved. Closing as completed on staging, not a main release.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3177
No description provided.