Create Nano Banana Image

POST/v1beta/models/{model}:{GenerateContentType}
Create an image through the Gemini-compatible Nano Banana format.

Path Parameters

model:requiredstring

Model identifier used for this request.

Examplegemini-3.1-flash-lite-image
GenerateContentType:requiredstring

Gemini-compatible generation action.

AllowedgenerateContentstreamGenerateContent
ExamplegenerateContent

Header Parameters

x-goog-api-key:optionalstring

Optional request parameter.

Example{{key}}

Request Body

application/json
generationConfig:requiredobject

Generation settings for the request.

Example{"imageConfig":{"aspectRatio":"16:9","image_size":"1K"}}
contents:requiredobject

Gemini-compatible content payload.

Example[{"parts":[{"text":"A kawaii-style sticker of a happy red panda wearing a tiny bamboo hat. It'smunching on a green bamboo leaf. The design features bold, clean outlines,simple cel-shading, and a vibrant color palette. The background must be white."}]}]

Response

200

A successful request returns a JSON response. The complete example is shown in the code panel.