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

# Nano Banana 2

> As of 2026-04-14, nano-banana-2 should use native Gemini generateContent; /v1/images/generations is no longer recommended

> Last updated: 2026-06-06

# Nano Banana 2

```
Recommended path
POST /v1beta/models/nano-banana-2:generateContent
```

As of `2026-04-14`, the latest Crazyrouter production retest for `nano-banana-2` showed:

* `nano-banana-2` currently maps to `nano-banana-2`
* the recommended route is now native Gemini `generateContent`
* `POST /v1/images/generations` is no longer recommended for `nano-banana-2`
* the same-day production retest on the native path succeeded and billing looked normal

<Warning>
  Do not keep documenting `nano-banana-2` as a stable `/v1/images/generations` model. The recommended entry point is now native Gemini `POST /v1beta/models/nano-banana-2:generateContent`.
</Warning>

## Current Status

| Item                                        | Status           | Notes                                                        |
| ------------------------------------------- | ---------------- | ------------------------------------------------------------ |
| Alias mapping                               | confirmed        | `nano-banana-2 -> nano-banana-2`                             |
| Native Gemini `generateContent`             | recommended      | succeeded in the `2026-04-14` production retest              |
| Native-path billing                         | currently normal | billing and consumption looked aligned in the same-day probe |
| OpenAI Images `POST /v1/images/generations` | not recommended  | failed in both production and local `4000` retests           |

## Current Risks

### 1. The public Images-compatible route is currently unhealthy

When `nano-banana-2` is sent through `POST /v1/images/generations`, the `2026-04-14` production and local `4000` retests both reproduced these failures:

* `Unknown name "imageOutputOptions" at 'generation_config.image_config'`
* `not supported model for image generation`
* `get_channel_failed`

That is why `/v1/images/generations` should no longer be documented as the stable public path for this model alias.

### 2. The native response must still be parsed as Gemini-native output

Even on the recommended route, the client should parse Gemini-native output:

1. Read `candidates[].content.parts[].inlineData` first
2. Do not assume an OpenAI Images-style `data[].url` payload
3. If you later expand to other Gemini image models, also handle `text`-wrapped `data:image/...` payloads or hosted URLs

## Current Recommendation

1. For production use of `nano-banana-2`, switch directly to `nano-banana-2:generateContent`
2. Do not use `POST /v1/images/generations` with `model: "nano-banana-2"`
3. For automation, parse `inlineData` first

## Recommended Request Template

```bash theme={null}
curl "https://api.crazyrouter.com/v1beta/models/nano-banana-2:generateContent?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "Generate an IMAGE of a clean ecommerce hero shot on a white background. Return image output."
          }
        ]
      }
    ],
    "generationConfig": {
      "responseModalities": ["IMAGE"]
    }
  }'
```

## Legacy Route

The following legacy pattern is no longer recommended:

```bash theme={null}
curl -X POST https://api.crazyrouter.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "nano-banana-2",
    "prompt": "..."
  }'
```

This is not a one-off outage. The same failure pattern reproduced in both production and local `4000` retests.

<Note>
  For more details on native Gemini image requests, see [Gemini Image Generation](/en/chat/gemini/image-gen). If you still have older code using the Nano Banana-family Images API, migrate `nano-banana-2` to the native Gemini path documented here.
</Note>
