gemini-3.1-flash-lite-image
Official docs: https://ai.google.dev/gemini-api/docs/image-generation — Gemini 3.1 Flash-Lite Image (Nano Banana 2 Lite) text-to-image, image-to-image, video-to-image, and image editing.
/v1beta/models/gemini-3.1-flash-lite-image:generateContentBody Parametersapplication/json
Conversation content list, required. At least 1 user message must be included when creating a graph; inlineData or fileData must be attached to parts when creating a graph/editing; historical messages must be appended in chronological order during multiple rounds of editing. Upstream constraints: The total input tokens do not exceed 65536; the single file input does not exceed 500MB.
itemsGenerate configuration. In raw image scenarios, responseModalities must contain IMAGE; imageConfig controls the aspect ratio and output format; thinkingConfig is optional.
propertiesNumber of candidate results. This model is fixed to 1, other values passed in may be ignored or an error will be reported.
Image generation configuration. This model only supports 1K output; 512px / 2K / 4K is not supported.
The maximum number of output tokens. The model output is capped at 4096. Image output is charged at 1120 tokens/image.
Output modal list. IMAGE must be included when generating a picture; if text description is also required, ["IMAGE", "TEXT"] can be passed. No image will be returned when only TEXT is passed.
Sampling temperature. The higher the value, the more diverse the results. The upstream default is 1.0.
Thinking mode configuration, optional. Do internal reasoning before using it in complex compositions. MINIMAL is suitable for low latency; HIGH is suitable for complex prompts. Think tokens count towards output billing.
Kernel sampling threshold. Upstream default value 0.95.
Fill in the url and return the url, if not fill in the default base64
Security settings, optional. Control the filtering thresholds for various types of harmful content.
itemsSystem command, optional. Used to constrain the output style, language, format, etc. When generating pictures, it is required to "output only descriptions related to pictures" or translation scenarios limit the output content.
propertiesList of content parts; may include text, inline_data / inlineData, etc.
Responses
Model candidate replies
Response creation time
Actual model version used
Unique ID for this response
Token usage metadata
