メインコンテンツへスキップ

Nano Banana 2

Recommended path
POST /v1beta/models/gemini-3.1-flash-image-preview:generateContent
As of 2026-04-14, the latest Crazyrouter production retest for nano-banana-2 showed:
  • nano-banana-2 currently maps to gemini-3.1-flash-image-preview
  • 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
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/gemini-3.1-flash-image-preview:generateContent.

Current Status

ItemStatusNotes
Alias mappingconfirmednano-banana-2 -> gemini-3.1-flash-image-preview
Native Gemini generateContentrecommendedsucceeded in the 2026-04-14 production retest
Native-path billingcurrently normalbilling and consumption looked aligned in the same-day probe
OpenAI Images POST /v1/images/generationsnot recommendedfailed 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 gemini-3.1-flash-image-preview:generateContent
  2. Do not use POST /v1/images/generations with model: "nano-banana-2"
  3. For automation, parse inlineData first
curl "https://crazyrouter.com/v1beta/models/gemini-3.1-flash-image-preview: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:
curl -X POST https://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.
For more details on native Gemini image requests, see Gemini Image Generation. If you still have older code using the Nano Banana-family Images API, migrate nano-banana-2 to the native Gemini path documented here.