Nano Banana 2 (Gemini 3.1 Flash Image)
Model Overview
Setup your API Key
API Schema
post
Body
modelstring · enumRequiredPossible values:
promptstringRequired
The text prompt describing the content, style, or composition of the image to be generated.
image_urlsstring · uri[] · max: 5Optional
List of URLs or local Base64 encoded images to edit.
aspect_ratiostring · enumOptionalDefault:
The aspect ratio of the generated image.
1:1Possible values: resolutionstring · enumOptionalDefault:
The resolution of the output image.
1KPossible values: enable_web_searchbooleanOptionalDefault:
Enable web search for the image generation task. This will allow the model to use the latest information from the web to generate the image.
falseResponses
200Success
application/json
post
/v1/images/generations200Success
Quick Example #1: Prompt Only

"A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses."Quick Example #2: Reference Images
Reference Images
Generated Image


"Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect."

"aspect_ratio": "16:9", "resolution": "2K"Last updated
Was this helpful?