Files
magpie/internal/catalog
Ha1baraA11 a75fa9e54a gateway, provider: OpenRouter's image-only models draw on its /images API, not chat (#1116, fixes #1105)
OpenRouter answers a chat request for gpt-image-*, seedream, flux,
qwen-image, grok-imagine and the like with 404 "Use the /api/v1/images
endpoint instead", and viaFor sent every OpenRouter model to chat. Models
catalog.ImagesAPI names now go to OpenRouter's POST /images, with reference
images as input_references (image_url parts) and its media_type and
prompt/completion token usage read back; a 404 there is returned as is
rather than retried on chat. Gemini and gpt-5-image stay on chat. The
provider Test probe asks the same endpoint.

Run: go test -tags nogui ./internal/gateway/ ./internal/provider/
./internal/catalog/, go vet (darwin, linux nogui, windows), gofmt. With
the /images dispatch removed, both new gateway tests go red. The real case
(owner's OpenRouter key, sandbox HOME, a throwaway test not committed):
openai/gpt-image-1-mini at quality low drew one image, 200, usage 12/272,
and with that image as a reference drew again, 200, usage 1035/272. The
request shape matches OpenRouter's openapi.json ImageGenerationRequest.
2026-10-13 16:00:31 +08:00
..