Nano Banana 2.1
Model Overview
Nano Banana 2.1 is an update to Nano Banana 2 (Gemini 3.1 Flash Image) for fast image generation and conversational editing, with improved visual quality, text rendering, multi-turn consistency and Google Search grounding at 1K, 2K and 4K.
API Schema
The text prompt describing the content, style, or composition of the image to be generated.
List of URLs or local Base64 encoded images to edit.
The aspect ratio of the generated image. It is taken from this parameter or from the provided reference image. If the parameter is not set and no reference image is provided, the default value is 16:9.
The resolution of the output image.
1KPossible values: 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.
falseSuccessful response.
curl --request POST \
--url 'https://api.aimlapi.com/v1/images/generations' \
--header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \
--header 'Content-Type: application/json' \
--data '{"model": "google/gemini-nano-banana-2.1", "prompt": "Describe what you want the model to generate."}'Successful response.
{
"data": [
{
"url": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png",
"b64_json": null
}
],
"meta": {
"usage": {
"credits_used": 120000,
"usd_spent": 0.06
}
}
}Code Example
Last updated
Was this helpful?