Skip to content

media-http, gateway, vendors, ui: add Gemini image clients - #43

Merged
lihe07 merged 1 commit into
respanai:mainfrom
lihe07:gemini-images
Oct 22, 2026
Merged

lihe07 merged 1 commit into
respanai:mainfrom
lihe07:gemini-images

Conversation

@lihe07

@lihe07 lihe07 commented Oct 22, 2026

Copy link
Copy Markdown
Member

A client could ask for images only in OpenAI's Images API: a Gemini client calling generateContent with gpt-image-2 was taken for a chat and failed, and an OpenAI Images client could not reach Gemini's image models, as Gemini's OpenAI-compatible images endpoint serves only Imagen, which its API no longer lists. Thus, add the gemini-images format: Gemini's image models through generateContent, of the image kind, to clients and providers, and declare it on the gemini vendor in place of openai-images.

To Gemini, a call is one user turn of the images to edit and the prompt; a size is the nearest aspect ratio Gemini draws, with 2K or 4K above 1K; a mask is refused, as Gemini edits by prompt alone; an answer with no image is refused, saying why. A client of it is one user turn of text and images, its imageConfig read as a size, answered with one candidate of the images and the usage, whole or as a stream. A call is served at gemini-generate's paths: it is an image's if routing sends its model, of the image kind, to a provider that cannot take it as generateContent, else a chat's, so Gemini's own image models are asked as they were, keeping a conversation and its text. A format that claims some of its endpoints' requests is registered before the rest, once the routes are known. Gemini's image models (-image, nano-banana) are listed as image models, and the playground's image tab speaks Gemini Images too.

Checked live through the gateway: an OpenAI Images client generates and edits with gemini-3.1-flash-image; Google's google-genai SDK generates with gpt-image-2, whole and streamed, edits with gpt-image-1-mini, and still asks gemini-3.1-flash-image as a chat; a history to gpt-image-2 is refused, 400.

  • The checks in CONTRIBUTING.md pass
  • Docs updated where behavior changed (a crate's README, docs/, or the vendor tables)
  • For a vendor or tool vendor: the live check was run

A client could ask for images only in OpenAI's Images API: a Gemini
client calling `generateContent` with `gpt-image-2` was taken for a
chat and failed, and an OpenAI Images client could not reach Gemini's
image models, as Gemini's OpenAI-compatible images endpoint serves only
Imagen, which its API no longer lists. Thus, add the `gemini-images`
format, Gemini's image models through `generateContent`, to clients and
providers, and declare it on the `gemini` vendor in place of
`openai-images`. A call is served at `gemini-generate`'s paths: it is
an image's if routing sends its model, of the image kind, to a provider
that cannot take it as `generateContent`, else a chat's.
@github-actions github-actions Bot added A-plugins Area: the first-party plugins (crates/plugins) A-formats Area: a kind over a wire, one spec each (crates/formats) A-vendors Area: the model vendors and their kit (crates/vendors) A-gateway Area: the binary (apps/gateway) A-ui Area: the web UI (apps/ui) A-readme Area: documentation that isn't part of any crate, such as docs/, README.md or CONTRIBUTING.md labels Oct 22, 2026
@lihe07
lihe07 merged commit 5f9b184 into respanai:main Oct 22, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formats Area: a kind over a wire, one spec each (crates/formats) A-gateway Area: the binary (apps/gateway) A-plugins Area: the first-party plugins (crates/plugins) A-readme Area: documentation that isn't part of any crate, such as docs/, README.md or CONTRIBUTING.md A-ui Area: the web UI (apps/ui) A-vendors Area: the model vendors and their kit (crates/vendors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant