gemini-3.1-flash-lite-image
Endpoint: POST https://4zapi.com/v1beta/models/gemini-3.1-flash-lite-image:generateContent
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.
Parameters
Authorization(header, string): Bearer API Key
Request body (application/json)
contents(array<object>, required): 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.generationConfig(object): Generate configuration. In raw image scenarios, responseModalities must contain IMAGE; imageConfig controls the aspect ratio and output format; thinkingConfig is optional.response_format(string): Fill in the url and return the url, if not fill in the default base64safetySettings(array<object>): Security settings, optional. Control the filtering thresholds for various types of harmful content.systemInstruction(object): System 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.
Request example
{
"contents": [
{
"parts": [
{
"text": "A cute cat sitting on a wooden table, watercolor style."
}
],
"role": "user"
}
],
"generationConfig": {
"imageConfig": {
"aspectRatio": "1:1"
},
"responseModalities": [
"IMAGE"
]
},
"response_format": "url"
}