For the complete documentation index, see llms.txt. This page is also available as Markdown.

Nano Banana 2 Lite

This documentation is valid for the following list of our models:

  • google/gemini-3-1-flash-lite-image

Model Overview

Nano Banana 2 Lite is a cost-efficient text-to-image model from Google, a lighter and cheaper variant of Nano Banana 2 for high-volume image generation.

How to make the first API call

1️⃣ Required setup (don’t skip this)Create an account: Sign up on the AI/ML API website (if you don’t have one yet). ▪ Generate an API key: In your account dashboard, create an API key and make sure it’s enabled in the UI.

2️ Copy the code example At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project.

3️ Update the snippet for your use caseInsert your API key: replace <YOUR_AIMLAPI_KEY> with your real AI/ML API key. ▪ Select a model: set the model field to the model you want to call. ▪ Provide input: fill in the request input field(s) shown in the example.

4️ (Optional) Tune the request See the API schema below for optional generation settings.

5️ Run your code Run the updated code in your development environment.

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 · enumOptional

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.

Possible values:
resolutionstring · enumOptional

The resolution of the output image.

Default: 1KPossible values:
enable_web_searchbooleanOptional

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.

Default: false
Responses
200

Successful response.

application/json
post/v1/images/generations
200

Successful response.

Code Example

Response

Last updated

Was this helpful?