> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dreamto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini 3.1 Flash Lite Image

> Nano Banana 2 Lite: Google's fastest, most cost-efficient Gemini image model, for rapid ideation and high-volume generation.

`gemini-3.1-flash-lite-image` (Nano Banana 2 Lite) is Google's fastest, most cost-efficient Gemini image model, built for rapid ideation and high-throughput, low-latency pipelines while keeping prompt adherence, character consistency and legible in-image text. It suits high-volume text-to-image and simple local edits (colors, backgrounds, stickers) and outputs 1K images only; Google notes it is not optimized for multiple reference images or multi-turn sequential editing, for which [Gemini 3.1 Flash Image](https://docs.dreamto.ai/en/image/models/gemini-3-1-flash-image.md) is the better choice.

## Setup

| | Google | DreamTo |
| - | - | - |
| Base URL | `https://generativelanguage.googleapis.com` | `https://api.dreamto.ai` |
| API Key | Google AI Studio key | API Key from the DreamTo console, in the `x-goog-api-key` or `Authorization: Bearer` header |

## Endpoints

| Endpoint | Purpose |
| - | - |
| [`POST /v1beta/models/gemini-3.1-flash-lite-image:generateContent`](https://docs.dreamto.ai/en/api-reference/gemini-3-1-flash-lite-image/generate-content) | Generate content |

## Parameters

| Field | Values |
| - | - |
| `contents[].parts[].text` | The prompt: what to generate or change |
| `contents[].parts[].inlineData.data` | Reference image as Base64 (`mimeType` `image/png` / `image/jpeg` / `image/webp` / `image/heic` / `image/heif`) |
| `contents[].parts[].fileData.fileUri` | Reference image as a public `https` link |
| `generationConfig.imageConfig.aspectRatio` | `1:1` (default) / `2:3` / `3:2` / `3:4` / `4:3` / `4:5` / `5:4` / `9:16` / `16:9` / `21:9` |

### Official parameters not supported yet

They return 400; the model is not called and nothing is charged.

| Parameter | Note |
| - | - |
| `systemInstruction` | System instructions are not supported yet; put them in the prompt |
| `safetySettings` | Custom safety thresholds are not supported yet; the defaults apply |

## Pricing

Billed at the model price shown in the console. Invalid requests and failed generations are not charged.

## Quick start

`$DREAMTO_API_KEY` is your API Key.

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/v1beta/models/gemini-3.1-flash-lite-image:generateContent" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "An elegant dessert in a fancy banana-themed restaurant, soft lighting, food photography"
          }
        ]
      }
    ],
    "generationConfig": {
      "imageConfig": {
        "aspectRatio": "16:9"
      }
    }
  }'
```

```python Python theme={null}
import base64
import os

import requests

URL = "https://api.dreamto.ai/v1beta/models/gemini-3.1-flash-lite-image:generateContent"
HEADERS = {"x-goog-api-key": os.environ["DREAMTO_API_KEY"]}

payload = {
    "contents": [
        {
            "role": "user",
            "parts": [
                {
                    "text": "An elegant dessert in a fancy banana-themed restaurant, soft lighting, food photography"
                }
            ]
        }
    ],
    "generationConfig": {
        "imageConfig": {
            "aspectRatio": "16:9"
        }
    }
}

response = requests.post(URL, headers=HEADERS, json=payload, timeout=300).json()
for part in response["candidates"][0]["content"]["parts"]:
    if "inlineData" in part:
        with open("output.png", "wb") as f:
            f.write(base64.b64decode(part["inlineData"]["data"]))
    elif "text" in part:
        print(part["text"])
```

## Notes

* This page covers `generateContent` only; the Batch API and `files/...` references from Files API uploads are not supported yet.
* Send reference images as Base64 in `inlineData`, or as a public `https` link in `fileData.fileUri`.
* Errors use the DreamTo error envelope (see the error examples) rather than Google's `status` envelope.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.