Skip to main content
POST
Generate or edit an image with Gemini
Use the normalized GENGEN request schema with one of these public model IDs:
  • gemini-3-pro-image
  • gemini-3.1-flash-image
  • gemini-3.1-flash-lite-image

Text-to-image request

Image editing request

Add public or signed HTTPS URLs, or Base64 data URLs, under assets.referenceImages. Raw gs:// URIs are not accepted; use a signed HTTPS URL instead.

Response

Read generated media from outputs.images. Google image responses are URL-only: GENGEN stores each generated image in a dedicated Vercel Blob path and never returns the generated image as Base64. Each URL is retained for 24 hours. The response uses only the normalized top-level fields shown below; duplicate compatibility aliases and provider billing usage are omitted.
Generated image URLs expire after 24 hours. Download or copy every image to storage you control before outputs.expiresAt.

Parameters

GENGEN fixes candidateCount to 1; request multiple alternatives with separate calls. Reference image formats are PNG, JPEG, WebP, HEIC, and HEIF.
Supported sizes vary by model: Nano Banana Pro (Gemini 3 Pro Image) supports 1K, 2K, and 4K; Nano Banana 2 (Gemini 3.1 Flash Image) supports 512, 1K, 2K, and 4K; Nano Banana 2 Lite (Gemini 3.1 Flash-Lite Image) supports 1K.
See the Google model pages for detailed capabilities.

Authorizations

Authorization
string
header
required

A workspace API key beginning with gengen_live_.

Body

application/json
model
enum<string>
required

Google native image model ID.

Available options:
gemini-3-pro-image,
gemini-3.1-flash-image,
gemini-3.1-flash-lite-image
prompt
string
required

Generation or editing instruction.

assets
object
controls
object
providerOptions
object

Response

The generated image URLs and their expiry time.

id
string
required
model
string
required
status
string
required
Allowed value: "succeeded"
outputs
object
required