Skip to content

Gemini 3 Pro Image(Nano Banana Pro)

POST/v1beta/models/gemini-3-pro-image:generateContent

Generate or edit images with Nano Banana Pro through the native Google Gemini protocol. SandBase preserves the provider request and response payload instead of converting it to Chat Completions.

Request body

Send a native Gemini GenerateContent body. Provider-defined fields are passed through for this model.

arraycontentsrequired

Gemini Content objects containing the prompt and optional input images.

array<string>generationConfig.responseModalitiesrequired

Requested output modalities. Include IMAGE; include TEXT when you also want a text part.

Optional<object>generationConfig.imageConfig

Image options such as aspectRatio, when supported by the provider.

Edit an image ​

Add the source image as an inlineData part next to the text instruction. Use the MIME type of the bytes you send:

json
{
  "contents": [{
    "role": "user",
    "parts": [
      {"text": "Replace the background with a warm sunset gradient."},
      {"inlineData": {"mimeType": "image/jpeg", "data": "<base64-input-image>"}}
    ]
  }],
  "generationConfig": {"responseModalities": ["IMAGE"]}
}

Response handling ​

Read generated media from the returned candidate parts. Because this model uses native passthrough, provider-defined field casing and MIME metadata are returned as received. Decode the base64 payload and verify the actual media bytes before choosing a file extension.

Official Google resources ​