openrouter: list every image model from its Image API, and draw them there

iwinux on Discord: the OpenRouter image picker listed only Nano Banana,
GPT-5.4 Image 2, GPT-5 Image and GPT-5 Image Mini, and asked whether the
protocol was the reason. It wasn't. OpenRouter's GET /api/v1/models lists
only models whose output includes text (454 rows on 2026-11-06, 13 of them
with image output), and that was the only list magpie read. The models
that answer in images alone (FLUX, Seedream, Riverflow, Recraft, GPT
Image, Krea, MAI Image, Qwen Image, Grok Imagine, Hunyuan, Muse) are at
its Image API's GET /api/v1/images/models (63 rows, no key needed), and
every one of them is served by POST /api/v1/images, which magpie already
spoke for FLUX/Seedream/GPT Image ids.

- catalog: openrouter.ai's public drawer list is /images/models; each row
  becomes a drawer with its output modalities, release date, name without
  the "Vendor: " prefix, and image input when it takes one.
- gateway: a model that answers in images only goes to /images, so
  Recraft, Riverflow, Krea, MAI, Muse and Hunyuan (ids ImagesAPI doesn't
  know) no longer go to chat completions. A pixel size is sent as
  aspect_ratio plus resolution (2K/4K by the long side), since no
  /images endpoint lists size and Riverflow refuses one: a real request
  with "size":"1024x1024" got 400 "Sourceful V2 does not support explicit
  pixel sizes. Use resolution and aspect_ratio instead." A ratio goes as
  aspect_ratio; anything else (auto) as size.
- Recraft's vector models answer image/svg+xml: saved as .svg in the
  gateway and in the image MCP (its sibling extOf).

Not listed: openrouter/auto (a router that may answer with an image).
krea/k3-edit is listed but only edits. Image prices are not imported
(OpenRouter prices per image per endpoint). Existing users see the new
models after their next model-list fetch.

Run (mote, at this tree):
- go test -count=1 ./internal/provider/ ./internal/catalog/ ./internal/imagemcp/: ok
- go test -count=1 -run 'Draw|Image|OpenRouter|ViaFor|Aspect|Drawer' ./internal/gateway/: ok
- gofmt -l internal: nothing; go vet of the four packages for darwin,
  GOOS=linux and GOOS=windows: ok
- Real: the worktree's binary in a sandbox HOME (magpie-wt/orimg-scratch,
  only the owner's OpenRouter provider copied in), serve on 127.0.0.1:3471,
  magpie sync: "openrouter (405)" and 63 drawers in its live list,
  Riverflow, Recraft, FLUX, Krea, MAI among them. POST
  /v1/images/generations openrouter/sourceful/riverflow-v2-fast at
  1024x1024: a 1024x1024 WebP back (27KB, 4175 output tokens).

Broken by hand: without the /images/models catalog entry,
TestOpenRouterImageModelsComeFromItsImageAPI fails ("/images/models asked
0 times"); sending size as given, TestOpenRouterImageOnlyModelsDrawAtItsImageAPI
fails (size 1024x1024 sent, aspect_ratio missing).

Not tried: a real draw with Recraft vector (SVG), Krea, xAI or MAI
through magpie; the GUI picker itself with the longer list; Windows and
Linux runs of the tests (vet only).

Reported-by: iwinux
This commit is contained in:
yetone
2026-11-06 11:58:35 +08:00
parent 2e58f85e4a
commit f86dd7910a
9 changed files with 1246 additions and 8 deletions
+47 -1
View File
@@ -15,8 +15,15 @@ import (
// the image models the key can use: AIHubMix lists only its Gemini image
// models there, while gpt-image-2 and the rest draw with the same key. Its
// public catalog, by the host of the vendor's base URL, has them.
// OpenRouter's /models lists only the models that answer in text, so of
// its image models only those that chat (Nano Banana, GPT-5 Image) were
// there; FLUX, Seedream, Riverflow, Recraft, GPT Image and the rest, which
// answer with an image alone, are listed by its Image API's own
// /images/models (iwinux on Discord). They draw at its /images, as the
// gateway asks it.
var PublicCatalogs = map[string]string{
"aihubmix.com": "https://aihubmix.com/api/v1/models",
"aihubmix.com": "https://aihubmix.com/api/v1/models",
"openrouter.ai": "https://openrouter.ai/api/v1/images/models",
}
// PublicDrawers are the image models the public catalog for base's host
@@ -55,6 +62,10 @@ func PublicDrawers(ctx context.Context, base string) []Model {
}
var out []Model
for _, raw := range list.Data {
if d, ok := openRouterDrawer(raw); ok {
out = append(out, d)
continue
}
var m struct {
ID string `json:"model_id"`
Name string `json:"model_name"`
@@ -83,6 +94,41 @@ func PublicDrawers(ctx context.Context, base string) []Model {
return out
}
// openRouterDrawer reads a row of OpenRouter's /images/models: {"id",
// "name": "Black Forest Labs: FLUX.2 Pro", "created": <unix seconds>,
// "architecture": {"input_modalities", "output_modalities"}}. Every one it
// lists makes images; one whose output has no image isn't kept. ok is false
// for a row of another shape (AIHubMix's model_id).
func openRouterDrawer(raw json.RawMessage) (Model, bool) {
var m struct {
ID string `json:"id"`
Name string `json:"name"`
Created float64 `json:"created"`
Architecture *struct {
In []string `json:"input_modalities"`
Out []string `json:"output_modalities"`
} `json:"architecture"`
}
if json.Unmarshal(raw, &m) != nil || m.ID == "" || m.Architecture == nil || !slices.Contains(m.Architecture.Out, "image") {
return Model{}, false
}
d := Model{ID: m.ID, Name: m.Name, Draws: true, OutputModalities: Kinds(m.Architecture.Out)}
// the vendor's prefix ("Black Forest Labs: ") is the provider's to say
if _, rest, ok := strings.Cut(d.Name, ": "); ok && rest != "" {
d.Name = rest
}
if d.Name == "" {
d.Name = m.ID
}
if m.Created > 0 {
d.Released = time.Unix(int64(m.Created), 0).UTC().Format("2006-01-02")
}
if slices.Contains(m.Architecture.In, "image") {
d.Images, d.ImageInput = true, imageInputOf(true)
}
return d, true
}
// WithDrawers adds the drawers not already in ms.
func WithDrawers(ms, drawers []Model) []Model {
for _, d := range drawers {
+47 -2
View File
@@ -1129,7 +1129,7 @@ func viaFor(p provider.Provider, model string) drawVia {
case isGoogle(p) && strings.Contains(strings.ToLower(model), "gemini"):
return viaGemini
case isOpenRouter(p):
if catalog.ImagesAPI(model) {
if catalog.ImagesAPI(model) || answersInImages(p, model) {
return viaImages
}
return viaChat
@@ -1139,6 +1139,20 @@ func viaFor(p provider.Provider, model string) drawVia {
return viaChat
}
// answersInImages is whether p's fetched list says model answers with images
// and no text: OpenRouter's Recraft, Riverflow, Krea and MAI Image, whose ids
// name no images API, draw at its /images as FLUX and Seedream do, and only
// its chat image models (Nano Banana, GPT-5 Image) answer in chat.
func answersInImages(p provider.Provider, model string) bool {
// a drawing request's look, once, through the image models alone
for _, m := range catalog.LiveDrawers(p.ID) {
if m.ID == model && slices.Contains(m.OutputModalities, "image") && !slices.Contains(m.OutputModalities, "text") {
return true
}
}
return false
}
// drawOnAccounts is draw on a subscription's accounts in the order its
// text requests go over them (the provider's candidates, without its
// fallback models): one whose plan won't draw (chatgpt.com's 403
@@ -1670,11 +1684,12 @@ func (s *Server) drawOpenRouterImages(ctx context.Context, p provider.Provider,
return drawn{}, http.StatusBadRequest, errors.New("OpenRouter's images API does not support a markup layer")
}
req := map[string]any{"model": model, "prompt": d.Prompt, "n": d.N}
for k, v := range map[string]string{"size": d.Size, "quality": d.Quality, "background": d.Background, "output_format": d.Format} {
for k, v := range map[string]string{"quality": d.Quality, "background": d.Background, "output_format": d.Format} {
if v != "" {
req[k] = v
}
}
openRouterSize(req, d.Size)
if len(d.Images) > 0 {
refs := make([]map[string]any, 0, len(d.Images))
for _, pic := range d.Images {
@@ -1691,6 +1706,33 @@ func (s *Server) drawOpenRouterImages(ctx context.Context, p provider.Provider,
return readImagesAnswer(p, url, b, code)
}
// openRouterSize puts an images API size into req as OpenRouter's Image API
// takes it. Pixels ("1536x1024") go as aspect_ratio, and as resolution
// when they ask for more than 1K: no endpoint of its /images/models lists
// size among what it takes, and Sourceful's Riverflow V2 and xAI's answer
// a pixel size with 400 "does not support explicit pixel sizes. Use
// resolution and aspect_ratio instead." A ratio ("16:9") is an
// aspect_ratio, and a tier ("2K", "auto") goes as the size it is.
func openRouterSize(req map[string]any, size string) {
size = strings.TrimSpace(size)
if size == "" {
return
}
if strings.Contains(size, ":") {
req["aspect_ratio"] = size
return
}
r := aspectAmong(size, []string{"1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", "21:9"})
if r == "" {
req["size"] = size
return
}
req["aspect_ratio"] = r
if t := imageSizeOf(size); t != "" {
req["resolution"] = t
}
}
// readImagesAnswer reads an images API's answer to url: its images, as bytes
// or the URLs the vendor keeps them at, and what they cost.
func readImagesAnswer(p provider.Provider, url string, b []byte, code int) (drawn, int, error) {
@@ -1860,6 +1902,9 @@ func extOf(mimeType string) string {
return ".webp"
case "image/gif":
return ".gif"
case "image/svg+xml":
// Recraft's vector models at OpenRouter
return ".svg"
}
return ".png"
}
+57
View File
@@ -297,6 +297,63 @@ func TestOpenRouterImagesAPIDrawsImageModels(t *testing.T) {
}
}
// An OpenRouter image model whose id names no images API (Riverflow,
// Recraft) draws at its /images when its list says it answers with an
// image alone, as /images/models lists it (iwinux on Discord); a chat image
// model stays on chat completions. A size in pixels goes as aspect_ratio
// and resolution: Riverflow V2 answered "1024x1024" with 400 "does not
// support explicit pixel sizes" on 2026-11-06.
func TestOpenRouterImageOnlyModelsDrawAtItsImageAPI(t *testing.T) {
fresh(t)
if err := provider.Save(provider.Provider{ID: "openrouter", Name: "OpenRouter", Chat: "https://openrouter.ai/api/v1", Key: "key"}); err != nil {
t.Fatal(err)
}
if err := catalog.SaveLive("openrouter", "https://openrouter.ai/api/v1", []catalog.Model{
{ID: "sourceful/riverflow-v2-fast", Draws: true, OutputModalities: []string{"image"}},
{ID: "recraft/recraft-v4-vector", Draws: true, OutputModalities: []string{"image"}},
{ID: "google/gemini-2.5-flash-image", Draws: true, OutputModalities: []string{"image", "text"}},
}); err != nil {
t.Fatal(err)
}
p, _ := provider.Find("openrouter")
for model, want := range map[string]drawVia{
"sourceful/riverflow-v2-fast": viaImages,
"recraft/recraft-v4-vector": viaImages,
"google/gemini-2.5-flash-image": viaChat,
"openai/gpt-5-image": viaChat,
} {
if got := viaFor(*p, model); got != want {
t.Errorf("%s: %s, want %s", model, got, want)
}
}
var path string
var got map[string]any
s := New()
s.client = &http.Client{Transport: countTransport(func(r *http.Request) (*http.Response, error) {
path = r.URL.Path
json.NewDecoder(r.Body).Decode(&got)
response := `{"created":1,"data":[{"b64_json":"` + base64.StdEncoding.EncodeToString(pngBytes) + `","media_type":"image/png"}],"usage":{"prompt_tokens":0,"completion_tokens":1,"total_tokens":1,"cost":0.02}}`
return &http.Response{StatusCode: http.StatusOK, Header: http.Header{"Content-Type": {"application/json"}}, Body: io.NopCloser(strings.NewReader(response))}, nil
})}
for size, want := range map[string]map[string]any{
"1024x1024": {"aspect_ratio": "1:1"},
"1536x1024": {"aspect_ratio": "3:2", "resolution": "2K"},
"16:9": {"aspect_ratio": "16:9"},
"auto": {"size": "auto"},
} {
got, path = nil, ""
code, _, raw := postImages(t, s, "/v1/images/generations", "application/json", `{"model":"openrouter/sourceful/riverflow-v2-fast","prompt":"a magpie","size":"`+size+`"}`)
if code != http.StatusOK || path != "/api/v1/images" {
t.Fatalf("%s: %d at %q: %s", size, code, path, raw)
}
for _, k := range []string{"size", "aspect_ratio", "resolution"} {
if got[k] != want[k] {
t.Errorf("%s: %s = %v, want %v (%v)", size, k, got[k], want[k], got)
}
}
}
}
func TestOpenRouterImagesAPIFailureIsReturnedWithoutChatRetry(t *testing.T) {
fresh(t)
if err := provider.Save(provider.Provider{ID: "openrouter", Name: "OpenRouter", Chat: "https://openrouter.ai/api/v1", Key: "key", Models: []string{"openai/gpt-image-2"}}); err != nil {
+3
View File
@@ -798,6 +798,9 @@ func extOf(mt string) string {
return ".webp"
case "image/gif":
return ".gif"
case "image/svg+xml":
// Recraft's vector models at OpenRouter
return ".svg"
}
return ".png"
}
@@ -25,7 +25,8 @@ const (
)
// fakeOpenRouterLists serves orChatList and orDecisionsList for
// openrouter.ai, and records the path and model of every other request.
// openrouter.ai, and an empty image model list (/images/models), and
// records the path and model of every other request.
func fakeOpenRouterLists(t *testing.T) (asked func() []string) {
t.Helper()
var mu sync.Mutex
@@ -39,6 +40,10 @@ func fakeOpenRouterLists(t *testing.T) (asked func() []string) {
}
return
}
if r.URL.Path == "/api/v1/images/models" {
w.Write([]byte(`{"data":[]}`))
return
}
var q struct{ Model string }
json.NewDecoder(r.Body).Decode(&q)
mu.Lock()
+5 -4
View File
@@ -244,10 +244,11 @@ func TestFetchDoesNotMergeOpenRoutersNamespacedList(t *testing.T) {
if n := asked(); n != 0 {
t.Errorf("asked the Anthropic base %d times, want none", n)
}
// the fetch is one request, where before this it asked the Anthropic
// base as well and merged a page of the catalog this one is
if n := urls(); n != 1 {
t.Errorf("asked %d URLs, want the Chat base's one", n)
// the fetch is the Chat base's list and the image models' list
// (/images/models, catalog.PublicCatalogs), where before this it asked
// the Anthropic base as well and merged a page of the catalog this one is
if n := urls(); n != 2 {
t.Errorf("asked %d URLs, want the Chat base's list and the image models'", n)
}
t.Logf("asked %d URLs, %d of them with the Anthropic header", urls(), asked())
}
@@ -0,0 +1,111 @@
package provider
import (
"context"
"net/http"
"net/http/httptest"
"os"
"slices"
"sync/atomic"
"testing"
"github.com/yetone/magpie/internal/catalog"
)
// OpenRouter's /models lists only the models that answer in text, so its
// image models were Nano Banana and GPT-5 Image alone; FLUX, Seedream,
// Riverflow, Recraft, GPT Image and the rest are listed by its Image API's
// /images/models, which needs no key (iwinux on Discord). The fixtures are
// rows of what openrouter.ai answered both on 2026-11-06, served at its
// own host.
func TestOpenRouterImageModelsComeFromItsImageAPI(t *testing.T) {
oneHome(t)
models, err := os.ReadFile("testdata/openrouter_models_2026-11-06.json")
if err != nil {
t.Fatal(err)
}
images, err := os.ReadFile("testdata/openrouter_images_models_2026-11-06.json")
if err != nil {
t.Fatal(err)
}
var asked atomic.Int32
srv := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case "/api/v1/models":
w.Write(models)
case "/api/v1/images/models":
asked.Add(1)
if r.Header.Get("Authorization") != "" {
t.Errorf("the image model list was sent the key")
}
w.Write(images)
default:
http.NotFound(w, r)
}
}))
t.Cleanup(srv.Close)
routeOpenRouterHost(t, srv.Listener.Addr().String())
if err := Save(Provider{ID: "openrouter", Name: "OpenRouter", Preset: "openrouter", Key: "k",
Chat: "https://openrouter.ai/api/v1", Anthropic: "https://openrouter.ai/api"}); err != nil {
t.Fatal(err)
}
p, err := Find("openrouter")
if err != nil {
t.Fatal(err)
}
chat, err := p.Fetch(context.Background())
if err != nil {
t.Fatal(err)
}
if asked.Load() != 1 {
t.Fatalf("/images/models asked %d times", asked.Load())
}
for _, m := range chat {
if m.ID == "black-forest-labs/flux.2-pro" || m.ID == "recraft/recraft-v4-vector" {
t.Errorf("an image model among the chat models: %s", m.ID)
}
}
got := map[string]catalog.Model{}
for _, m := range catalog.LiveDrawers("openrouter") {
if _, dup := got[m.ID]; dup {
t.Errorf("%s listed twice", m.ID)
}
got[m.ID] = m
}
for _, id := range []string{
// from /models, as before
"google/gemini-2.5-flash-image", "openai/gpt-5-image",
// from /images/models
"black-forest-labs/flux.2-pro", "bytedance-seed/seedream-4.5", "sourceful/riverflow-v2-fast",
"recraft/recraft-v4-vector", "recraft/recraft-v4.1-flash", "openai/gpt-image-2",
"x-ai/grok-imagine-image-2.0", "krea/krea-2-medium", "microsoft/mai-image-2.5",
} {
if _, ok := got[id]; !ok {
t.Errorf("%s isn't among the image models", id)
}
}
if len(got) != 11 {
t.Errorf("%d image models, want 11: %v", len(got), slices.Sorted(func(yield func(string) bool) {
for id := range got {
if !yield(id) {
return
}
}
}))
}
if _, ok := got["openrouter/auto"]; ok {
t.Error("openrouter/auto, a router that may answer with an image, is listed as an image model")
}
flux := got["black-forest-labs/flux.2-pro"]
if flux.Name != "FLUX.2 Pro" {
t.Errorf("flux named %q, want it without the vendor's prefix", flux.Name)
}
if flux.Released == "" || !flux.Images || !slices.Equal(flux.OutputModalities, []string{"image"}) {
t.Errorf("flux kept as %+v", flux)
}
// Recraft's text-only one takes no picture
if rf := got["recraft/recraft-v4.1-flash"]; rf.Images {
t.Errorf("recraft-v4.1-flash said to take images: %+v", rf)
}
}
@@ -0,0 +1,571 @@
{
"data": [
{
"id": "recraft/recraft-v4.1-flash",
"name": "Recraft: Recraft V4.1 Flash",
"description": "Recraft V4.1 Flash is a text-to-image model from Recraft, the speed and cost tier of the V4.1 family. It generates ~1K raster images in about 1.5 seconds end to end,...",
"created": 1790177946,
"architecture": {
"input_modalities": [
"text"
],
"output_modalities": [
"image"
]
},
"supported_parameters": {
"aspect_ratio": {
"type": "enum",
"values": [
"1:1",
"4:3",
"3:4",
"16:9",
"9:16",
"auto"
]
},
"n": {
"type": "range",
"min": 1,
"max": 6
}
},
"supports_streaming": false,
"endpoints": "/api/v1/images/models/recraft/recraft-v4.1-flash/endpoints"
},
{
"id": "x-ai/grok-imagine-image-2.0",
"name": "xAI: Grok Imagine Image 2.0",
"description": "Grok Imagine Image 2.0 is an image generation and editing model from xAI. It is suited for creating images from text prompts and editing images from references, with low and...",
"created": 1786486044,
"architecture": {
"input_modalities": [
"text",
"image"
],
"output_modalities": [
"image"
]
},
"supported_parameters": {
"resolution": {
"type": "enum",
"values": [
"1K",
"2K"
]
},
"aspect_ratio": {
"type": "enum",
"values": [
"1:1",
"3:4",
"4:3",
"9:16",
"16:9",
"2:3",
"3:2",
"9:19.5",
"19.5:9",
"9:20",
"20:9",
"1:2",
"2:1",
"auto"
]
},
"quality": {
"type": "enum",
"values": [
"low",
"medium"
]
},
"n": {
"type": "range",
"min": 1,
"max": 1
},
"input_references": {
"type": "range",
"min": 0,
"max": 3
}
},
"supports_streaming": false,
"endpoints": "/api/v1/images/models/x-ai/grok-imagine-image-2.0/endpoints"
},
{
"id": "krea/krea-2-medium",
"name": "Krea: Krea 2 Medium",
"description": "Krea 2 Medium is Krea's balanced, cost-efficient image generation model and a practical starting point for a broad range of use cases. Its extensive post-training supports stable, consistent generations, with...",
"created": 1784574928,
"architecture": {
"input_modalities": [
"text",
"image"
],
"output_modalities": [
"image"
]
},
"supported_parameters": {
"resolution": {
"type": "enum",
"values": [
"1K"
]
},
"aspect_ratio": {
"type": "enum",
"values": [
"1:1",
"4:3",
"3:2",
"16:9",
"4:5",
"2:3",
"9:16"
]
},
"input_references": {
"type": "range",
"min": 0,
"max": 1
},
"seed": {
"type": "boolean"
}
},
"supports_streaming": false,
"endpoints": "/api/v1/images/models/krea/krea-2-medium/endpoints"
},
{
"id": "openai/gpt-image-2",
"name": "OpenAI: GPT Image 2",
"description": "OpenAI's latest image generation model. Supports high-fidelity image generation and editing via the dedicated Images API.",
"created": 1782264714,
"architecture": {
"input_modalities": [
"text",
"image"
],
"output_modalities": [
"image"
]
},
"supported_parameters": {
"aspect_ratio": {
"type": "enum",
"values": [
"1:1",
"3:2",
"2:3",
"4:3",
"3:4",
"16:9",
"9:16",
"21:9",
"auto"
]
},
"quality": {
"type": "enum",
"values": [
"auto",
"low",
"medium",
"high"
]
},
"background": {
"type": "enum",
"values": [
"auto",
"opaque"
]
},
"n": {
"type": "range",
"min": 1,
"max": 10
},
"input_references": {
"type": "range",
"min": 0,
"max": 16
},
"output_compression": {
"type": "range",
"min": 0,
"max": 100
}
},
"supports_streaming": true,
"endpoints": "/api/v1/images/models/openai/gpt-image-2/endpoints"
},
{
"id": "microsoft/mai-image-2.5",
"name": "Microsoft AI: MAI-Image-2.5",
"description": "Microsoft AI's MAI-Image-2.5 is a high-quality image generation model available via Azure AI Foundry. It produces photorealistic and artistic images from text prompts with support for various aspect ratios.",
"created": 1780424896,
"architecture": {
"input_modalities": [
"text",
"image"
],
"output_modalities": [
"image"
]
},
"supported_parameters": {
"aspect_ratio": {
"type": "enum",
"values": [
"1:1",
"4:3",
"3:4",
"16:9",
"9:16",
"3:2",
"2:3",
"auto"
]
},
"n": {
"type": "range",
"min": 1,
"max": 1
},
"input_references": {
"type": "range",
"min": 0,
"max": 1
}
},
"supports_streaming": false,
"endpoints": "/api/v1/images/models/microsoft/mai-image-2.5/endpoints"
},
{
"id": "recraft/recraft-v4-vector",
"name": "Recraft: Recraft V4 Vector",
"description": "Recraft V4 Vector is the vector (SVG) variant of Recraft V4. It supports text and image inputs and produces vector image output across multiple aspect ratios. Compared to the raster...",
"created": 1778707333,
"architecture": {
"input_modalities": [
"text",
"image"
],
"output_modalities": [
"image"
]
},
"supported_parameters": {
"aspect_ratio": {
"type": "enum",
"values": [
"1:1",
"4:3",
"3:4",
"16:9",
"9:16",
"auto"
]
},
"output_format": {
"type": "enum",
"values": [
"svg"
]
},
"n": {
"type": "range",
"min": 1,
"max": 6
},
"input_references": {
"type": "range",
"min": 0,
"max": 1
}
},
"supports_streaming": false,
"endpoints": "/api/v1/images/models/recraft/recraft-v4-vector/endpoints"
},
{
"id": "sourceful/riverflow-v2-fast",
"name": "Sourceful: Riverflow V2 Fast",
"description": "Riverflow V2 Fast is the fastest variant of Sourceful's Riverflow 2.0 lineup, best for production deployments and latency-critical workflows. The Riverflow 2.0 series represents SOTA performance on image generation and...",
"created": 1770051423,
"architecture": {
"input_modalities": [
"text",
"image"
],
"output_modalities": [
"image"
]
},
"supported_parameters": {
"resolution": {
"type": "enum",
"values": [
"1K",
"2K",
"4K"
]
},
"aspect_ratio": {
"type": "enum",
"values": [
"1:1",
"4:3",
"3:4",
"3:2",
"2:3",
"16:9",
"9:16",
"21:9",
"auto"
]
},
"n": {
"type": "range",
"min": 1,
"max": 1
},
"input_references": {
"type": "range",
"min": 0,
"max": 4
}
},
"supports_streaming": false,
"endpoints": "/api/v1/images/models/sourceful/riverflow-v2-fast/endpoints"
},
{
"id": "bytedance-seed/seedream-4.5",
"name": "ByteDance Seed: Seedream 4.5",
"description": "Seedream 4.5 is the latest in-house image generation model developed by ByteDance. Compared with Seedream 4.0, it delivers comprehensive improvements, especially in editing consistency, including better preservation of subject details,...",
"created": 1766519506,
"architecture": {
"input_modalities": [
"image",
"text"
],
"output_modalities": [
"image"
]
},
"supported_parameters": {
"resolution": {
"type": "enum",
"values": [
"1K",
"2K",
"4K"
]
},
"aspect_ratio": {
"type": "enum",
"values": [
"1:1",
"1:2",
"2:1",
"2:3",
"3:2",
"3:4",
"4:3",
"4:5",
"5:4",
"9:16",
"16:9",
"9:19.5",
"19.5:9",
"9:20",
"20:9",
"9:21",
"21:9",
"auto"
]
},
"n": {
"type": "range",
"min": 1,
"max": 10
},
"input_references": {
"type": "range",
"min": 0,
"max": 14
},
"seed": {
"type": "boolean"
}
},
"supports_streaming": false,
"endpoints": "/api/v1/images/models/bytedance-seed/seedream-4.5/endpoints"
},
{
"id": "black-forest-labs/flux.2-pro",
"name": "Black Forest Labs: FLUX.2 Pro",
"description": "A high-end image generation and editing model focused on frontier-level visual quality and reliability. It delivers strong prompt adherence, stable lighting, sharp textures, and consistent character/style reproduction across multi-reference inputs....",
"created": 1764030274,
"architecture": {
"input_modalities": [
"text",
"image"
],
"output_modalities": [
"image"
]
},
"supported_parameters": {
"aspect_ratio": {
"type": "enum",
"values": [
"1:1",
"4:3",
"3:4",
"3:2",
"2:3",
"16:9",
"9:16",
"21:9",
"auto"
]
},
"output_format": {
"type": "enum",
"values": [
"png",
"jpeg"
]
},
"n": {
"type": "range",
"min": 1,
"max": 1
},
"input_references": {
"type": "range",
"min": 0,
"max": 8
},
"seed": {
"type": "boolean"
}
},
"supports_streaming": false,
"endpoints": "/api/v1/images/models/black-forest-labs/flux.2-pro/endpoints"
},
{
"id": "openai/gpt-5-image",
"name": "OpenAI: GPT-5 Image",
"description": "[GPT-5](https://openrouter.ai/openai/gpt-5) Image combines OpenAI's GPT-5 model with state-of-the-art image generation capabilities. It offers major improvements in reasoning, code quality, and user experience while incorporating GPT Image 1's superior instruction following,...",
"created": 1760447986,
"architecture": {
"input_modalities": [
"image",
"text",
"file"
],
"output_modalities": [
"image",
"text"
]
},
"supported_parameters": {
"aspect_ratio": {
"type": "enum",
"values": [
"1:1",
"3:2",
"2:3",
"auto"
]
},
"quality": {
"type": "enum",
"values": [
"auto",
"low",
"medium",
"high"
]
},
"background": {
"type": "enum",
"values": [
"auto",
"transparent",
"opaque"
]
},
"n": {
"type": "range",
"min": 1,
"max": 10
},
"input_references": {
"type": "range",
"min": 0,
"max": 16
},
"output_compression": {
"type": "range",
"min": 0,
"max": 100
}
},
"supports_streaming": true,
"endpoints": "/api/v1/images/models/openai/gpt-5-image/endpoints"
},
{
"id": "google/gemini-2.5-flash-image",
"name": "Google: Nano Banana (Gemini 2.5 Flash Image)",
"description": "Gemini 2.5 Flash Image, a.k.a. \"Nano Banana,\" is now generally available. It is a state of the art image generation model with contextual understanding. It is capable of image generation,...",
"created": 1759870431,
"architecture": {
"input_modalities": [
"image",
"text"
],
"output_modalities": [
"image",
"text"
]
},
"supported_parameters": {
"aspect_ratio": {
"type": "enum",
"values": [
"1:1",
"2:3",
"3:2",
"3:4",
"4:3",
"4:5",
"5:4",
"9:16",
"16:9",
"21:9"
]
},
"n": {
"type": "range",
"min": 1,
"max": 1
},
"input_references": {
"type": "range",
"min": 0,
"max": 3
}
},
"supports_streaming": false,
"endpoints": "/api/v1/images/models/google/gemini-2.5-flash-image/endpoints"
}
]
}
@@ -0,0 +1,399 @@
{
"data": [
{
"id": "ricursiveai/ripple-65b-preview",
"canonical_slug": "ricursiveai/ripple-65b-preview-20261104",
"hugging_face_id": null,
"name": "ricursiveAI/Ripple-65B-Preview",
"created": 1793818990,
"description": "Ripple-65B-Preview by ricursiveAI, a 65B model with native tool calling, served in BF16.",
"context_length": 1048576,
"architecture": {
"modality": "text->text",
"input_modalities": [
"text"
],
"output_modalities": [
"text"
],
"tokenizer": "Other",
"instruct_type": null
},
"pricing": {
"prompt": "0.0000002",
"completion": "0.0000006",
"input_cache_read": "0.00000005"
},
"top_provider": {
"context_length": 1048576,
"max_completion_tokens": 131072,
"is_moderated": false
},
"per_request_limits": null,
"supported_parameters": [
"logprobs",
"max_tokens",
"response_format",
"seed",
"temperature",
"tool_choice",
"tools",
"top_logprobs",
"top_p"
],
"default_parameters": {},
"supported_voices": null,
"knowledge_cutoff": null,
"expiration_date": null,
"links": {
"details": "/api/v1/models/ricursiveai/ripple-65b-preview-20261104/endpoints"
},
"endpoints": [
"/api/v1/chat/completions",
"/api/v1/completions",
"/api/v1/messages",
"/api/v1/responses"
],
"reasoning": {
"mandatory": false,
"default_enabled": false
}
},
{
"id": "tencent/hy4",
"canonical_slug": "tencent/hy4-20261104",
"hugging_face_id": "tencent/Hy4",
"name": "Tencent: Hy4",
"created": 1793766031,
"description": "The official release of Hy4 delivers comprehensive and substantial improvements over Hy4 Preview, with particularly strong gains in agentic capabilities and performance across a wide range of long-horizon, real-world productivity...",
"context_length": 1048576,
"architecture": {
"modality": "text+image->text",
"input_modalities": [
"text",
"image"
],
"output_modalities": [
"text"
],
"tokenizer": "Other",
"instruct_type": null
},
"pricing": {
"prompt": "0.000000417",
"completion": "0.0000012505",
"input_cache_read": "0.000000021"
},
"top_provider": {
"context_length": 1048576,
"max_completion_tokens": 65536,
"is_moderated": false
},
"per_request_limits": null,
"supported_parameters": [
"include_reasoning",
"max_completion_tokens",
"max_tokens",
"reasoning",
"reasoning_effort",
"response_format",
"stop",
"structured_outputs",
"temperature",
"tool_choice",
"tools"
],
"default_parameters": {},
"supported_voices": null,
"knowledge_cutoff": null,
"expiration_date": null,
"links": {
"details": "/api/v1/models/tencent/hy4-20261104/endpoints"
},
"endpoints": [
"/api/v1/chat/completions",
"/api/v1/completions",
"/api/v1/messages",
"/api/v1/responses"
],
"benchmarks": {
"design_arena": [],
"artificial_analysis": {
"intelligence_index": 34.6,
"coding_index": null,
"agentic_index": null
}
},
"reasoning": {
"mandatory": false,
"default_enabled": true,
"supported_efforts": [
"high",
"low",
"none"
],
"default_effort": "high"
}
},
{
"id": "openai/gpt-5-image",
"canonical_slug": "openai/gpt-5-image",
"hugging_face_id": "",
"name": "OpenAI: GPT-5 Image",
"created": 1760447986,
"description": "[GPT-5](https://openrouter.ai/openai/gpt-5) Image combines OpenAI's GPT-5 model with state-of-the-art image generation capabilities. It offers major improvements in reasoning, code quality, and user experience while incorporating GPT Image 1's superior instruction following,...",
"context_length": 400000,
"architecture": {
"modality": "text+image+file->text+image",
"input_modalities": [
"image",
"text",
"file"
],
"output_modalities": [
"image",
"text"
],
"tokenizer": "GPT",
"instruct_type": null
},
"pricing": {
"prompt": "0.00001",
"completion": "0.00001",
"image_output": "0.00004",
"web_search": "0.01",
"input_cache_read": "0.00000125"
},
"top_provider": {
"context_length": 400000,
"max_completion_tokens": 128000,
"is_moderated": true
},
"per_request_limits": null,
"supported_parameters": [
"include_reasoning",
"logprobs",
"max_tokens",
"reasoning",
"response_format",
"seed",
"structured_outputs",
"temperature",
"top_logprobs",
"top_p",
"verbosity"
],
"default_parameters": {
"temperature": null,
"top_p": null,
"frequency_penalty": null
},
"supported_voices": null,
"knowledge_cutoff": null,
"expiration_date": null,
"links": {
"details": "/api/v1/models/openai/gpt-5-image/endpoints"
},
"endpoints": [
"/api/v1/chat/completions",
"/api/v1/completions",
"/api/v1/messages",
"/api/v1/responses",
"/api/v1/images"
],
"benchmarks": {
"design_arena": [
{
"arena": "models",
"category": "graphicdesign",
"elo": 1172,
"win_rate": 48.9,
"rank": 9
},
{
"arena": "models",
"category": "image",
"elo": 1174,
"win_rate": 53.9,
"rank": 9
},
{
"arena": "models",
"category": "logo",
"elo": 1202,
"win_rate": 52.7,
"rank": 9
}
]
},
"reasoning": {
"mandatory": true
}
},
{
"id": "google/gemini-2.5-flash-image",
"canonical_slug": "google/gemini-2.5-flash-image",
"hugging_face_id": "",
"name": "Google: Nano Banana (Gemini 2.5 Flash Image)",
"created": 1759870431,
"description": "Gemini 2.5 Flash Image, a.k.a. \"Nano Banana,\" is now generally available. It is a state of the art image generation model with contextual understanding. It is capable of image generation,...",
"context_length": 32768,
"architecture": {
"modality": "text+image->text+image",
"input_modalities": [
"image",
"text"
],
"output_modalities": [
"image",
"text"
],
"tokenizer": "Gemini",
"instruct_type": null
},
"pricing": {
"prompt": "0.0000003",
"completion": "0.0000025",
"image": "0.0000003",
"image_output": "0.00003",
"audio": "0.000001",
"input_audio_cache": "0.0000001",
"web_search": "0.014",
"internal_reasoning": "0.0000025",
"input_cache_read": "0.00000003",
"input_cache_write": "0.0000000833333333333333"
},
"top_provider": {
"context_length": 32768,
"max_completion_tokens": 8192,
"is_moderated": false
},
"per_request_limits": null,
"supported_parameters": [
"max_tokens",
"response_format",
"seed",
"stop",
"structured_outputs",
"temperature",
"top_p"
],
"default_parameters": {
"temperature": null,
"top_p": null,
"frequency_penalty": null
},
"supported_voices": null,
"knowledge_cutoff": "2025-01-31",
"expiration_date": null,
"links": {
"details": "/api/v1/models/google/gemini-2.5-flash-image/endpoints"
},
"endpoints": [
"/api/v1/chat/completions",
"/api/v1/completions",
"/api/v1/messages",
"/api/v1/responses",
"/api/v1/images"
],
"benchmarks": {
"design_arena": [
{
"arena": "models",
"category": "graphicdesign",
"elo": 1167,
"win_rate": 56.9,
"rank": 10
},
{
"arena": "models",
"category": "image",
"elo": 1168,
"win_rate": 55.6,
"rank": 10
},
{
"arena": "models",
"category": "logo",
"elo": 1169,
"win_rate": 51.4,
"rank": 11
}
]
}
},
{
"id": "openrouter/auto",
"canonical_slug": "openrouter/auto",
"hugging_face_id": null,
"name": "Auto Router",
"created": 1793885889,
"description": "Auto is OpenRouter’s flagship model router, built for general-purpose usage. It adapts to each request, choosing cost-optimal models and adjusting reasoning effort. It balances task difficulty, benchmark results, live prices,...",
"context_length": 2000000,
"architecture": {
"modality": "text+image+file+audio+video->text+image",
"input_modalities": [
"text",
"image",
"audio",
"file",
"video"
],
"output_modalities": [
"text",
"image"
],
"tokenizer": "Router",
"instruct_type": null
},
"pricing": {
"prompt": "-1",
"completion": "-1"
},
"top_provider": {
"context_length": null,
"max_completion_tokens": null,
"is_moderated": false
},
"per_request_limits": null,
"supported_parameters": [
"frequency_penalty",
"include_reasoning",
"logit_bias",
"logprobs",
"max_tokens",
"min_p",
"prediction",
"presence_penalty",
"reasoning",
"reasoning_effort",
"repetition_penalty",
"response_format",
"seed",
"stop",
"structured_outputs",
"temperature",
"tool_choice",
"tools",
"top_a",
"top_k",
"top_logprobs",
"top_p",
"web_search_options"
],
"default_parameters": {},
"supported_voices": null,
"knowledge_cutoff": null,
"expiration_date": null,
"links": {
"details": "/api/v1/models/openrouter/auto/endpoints"
},
"endpoints": [
"/api/v1/chat/completions",
"/api/v1/completions",
"/api/v1/messages",
"/api/v1/responses"
]
}
]
}