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

# Gemini Nano Banana 2.1

Gemini Nano Banana 2.1 is Google’s latest efficient image generation and editing model. An upgrade to Gemini 3.1 Flash Image (Nano Banana 2), it costs half as much as Flash while improving visual quality, prompt adherence, character consistency across turns, and text rendering. It offers a lower-cost alternative to Gemini 3 Pro Image (Nano Banana Pro).

### Model capabilities

* **High-resolution output:** Native generation at 1K, 2K, and 4K.
* **Advanced text rendering:** Generate clear, stylized text for infographics, menus, diagrams, and marketing materials.
* **Grounding with Google Search:** Verify facts and generate images based on real-time data such as weather maps, stock quotes, and recent events. Image search is supported.
* **Thinking mode:** The model analyzes complex prompts and generates intermediate “thinking images” to refine the composition before producing the final image. These intermediate images are visible only in the backend and are not billed. You can configure the reasoning level.
* **Multiple reference images:** Combine up to 14 reference images into one final image.

### Model parameters

* Model ID: `gemini-nano-banana-2.1`
* Pricing: Check the [model details page](https://geekai.co/models/gemini-nano-banana-2.1) for current prices.
* Endpoint: `https://geekai.co/api/v1/chat/completions`
* Parameters: See the [Chat API reference](https://docs.geekai.co/en/api/chat/completions.md).
* Authentication: [Get an API key](https://geekai.co/user/api_keys).

Gemini Nano Banana 2.1 supports 1K, 2K, and 4K resolutions at multiple aspect ratios. The table shows the output dimensions for each combination:

![Output dimensions by resolution and aspect ratio for Gemini Nano Banana 2.1](https://static.geekai.co/storage/image-20261007214303767.png)

### Pricing

Gemini Nano Banana 2.1 generates images at 1K, 2K, and 4K. Prices vary by resolution:

| Resolution | Dimensions | Price (CNY/image) |
| - | - | - |
| 1K | 1024x1024 | 0.25 |
| 2K | 2048x2048 | 0.375 |
| 4K | 4096x4096 | 0.85 |

2K costs 1.5 times the 1K base price; 4K costs approximately 3.4 times the base price.

When using a GeekAI [discounted proxy channel](https://docs.geekai.co/en/docs/model_price.md), multiply the listed price by the channel’s discount factor. For example, the high-availability channel has a factor of `0.5`. An image with `size` set to `1K` costs `0.25 x 0.5 = 0.125` CNY. Applying the same calculation, 2K costs `0.375 x 0.5 = 0.1875` CNY and 4K costs `0.85 x 0.5 = 0.425` CNY.

### Image generation

Generate an image from a descriptive prompt:

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/chat/completions' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gemini-nano-banana-2.1",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Create an image of a Nano Banana dish in an upscale restaurant with a Gemini theme."
          }
        ]
      }
    ]
}'
```

### Image editing

Combine an image with a text prompt to edit it, change the composition, or transform its style:

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/chat/completions' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gemini-nano-banana-2.1",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Using the supplied image of my cat, add a small knitted wizard hat to its head. Make the hat sit comfortably and match the soft lighting of the photo."
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://ai.google.dev/static/gemini-api/docs/images/cat.png"
            }
          }
        ]
      }
    ]
}'
```

### Multi-turn image editing

Keep generating and editing images in the same conversation. Multi-turn chat is the best way to refine an image. Start by generating an infographic about photosynthesis:

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/chat/completions' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gemini-nano-banana-2.1",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Create a lively infographic explaining photosynthesis as a plant’s favorite recipe. Show the ‘ingredients’ (sunlight, water, CO₂) and the ‘finished dish’ (sugar/energy). Style it like a page from a colorful children’s cookbook for fourth graders."
          }
        ]
      }
    ]
}'
```

In the same chat, ask the model to change the language in the image to Spanish:

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/chat/completions' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gemini-nano-banana-2.1",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Create a lively infographic explaining photosynthesis as a plant’s favorite recipe. Show the ‘ingredients’ (sunlight, water, CO₂) and the ‘finished dish’ (sugar/energy). Style it like a page from a colorful children’s cookbook for fourth graders."
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://static.geekai.co/image/2026/02/27/bfc778edb67fefcc629e0f92bb1fb137.png"
            }
          },
          {
            "type": "text",
            "text": "Update this infographic to Spanish. Do not change any other element of the image."
          }
        ]
      }
    ]
}'
```

### Combine multiple images

Gemini Nano Banana 2.1 can combine up to 14 reference images, including:

* Up to 10 images of objects to reproduce with high fidelity in the final image.
* Up to 4 images of people to maintain character consistency.

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/chat/completions' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gemini-nano-banana-2.1",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Create an office group photo of these people making funny faces."
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "$IMG1_BASE64"
            }
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "$IMG2_BASE64"
            }
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "$IMG3_BASE64"
            }
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "$IMG4_BASE64"
            }
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "$IMG5_BASE64"
            }
          }
        ]
      }
    ]
}'
```

### Ground images with Google Search

Use the Google Search tool to generate images based on real-time information, such as weather forecasts, stock charts, or recent events.

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/chat/completions' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gemini-nano-banana-2.1",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Visualize the current five-day forecast for San Francisco as a clean, modern weather chart. Include visual suggestions for what to wear each day."
          }
        ]
      }
    ],
    "enable_search": true,
    "image": {
      "aspect_ratio": "5:4"
    }
}'
```

> [!NOTE]
>
> Use `enable_search` to enable the model’s built-in search tool (Google Search for Gemini). Use `image` to configure output resolution (`image_size`) and aspect ratio (`aspect_ratio`). These are currently the only two supported configuration options.

### Generate high-resolution 4K images

Gemini Nano Banana 2.1 generates 1K images by default and also supports 2K and 4K output. To generate higher-resolution assets, specify `image_size` in `image`:

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/chat/completions' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gemini-nano-banana-2.1",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Draw a Leonardo da Vinci-style anatomical study of a monarch butterfly. Render the head, wings, and legs in detail on textured parchment, with annotations in English."
          }
        ]
      }
    ],
    "enable_search": true,
    "image": {
      "aspect_ratio": "1:1",
      "image_size": "4K"
    },
    "background": true
}'
```

> [!NOTE]
>
> Set `background` to `true` to [run long tasks in the background](https://docs.geekai.co/en/docs/chat/background.md), such as high-resolution image generation. The chat endpoint returns a `id` that uniquely identifies the request. Poll `https://geekai.co/api/v1/chat/{id}` for the latest status and retrieve the final image when the conversation completes.


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