Skip to main content
For authentication, see Overview.

What is Nano Banana

Nano Banana is Gemini’s multimodal image generation capability, using the same generateContent endpoint as text models.
ModelModel IDFeatures
Nano Bananagemini-2.5-flash-imageSpeed optimized for high-volume tasks
Nano Banana Progemini-3-pro-image-previewProfessional production, advanced reasoning, high-fidelity text rendering, up to 4K resolution

Endpoints

Same as text models:
TypeEndpoint
Non-StreamingPOST /v1beta/models/{model}:generateContent
StreamingPOST /v1beta/models/{model}:streamGenerateContent

Text to Image

curl -s -X POST \
  "https://api.pipellm.com/v1beta/models/gemini-2.5-flash-image:generateContent" \
  -H "x-goog-api-key: $PIPELLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d @- << 'EOF'
{
  "contents": [{
    "parts": [
      {"text": "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme"}
    ]
  }]
}
EOF

Image to Image (with Reference)

Upload a reference image and generate a new one with text prompts:
IMG_BASE64=$(base64 -w0 /path/to/cat_image.jpeg)

curl -s -X POST \
  "https://api.pipellm.com/v1beta/models/gemini-2.5-flash-image:generateContent" \
  -H "x-goog-api-key: $PIPELLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d @- << EOF
{
  "contents": [{
    "parts": [
      {"text": "Create a picture of my cat eating a nano-banana in a fancy restaurant under the Gemini constellation"},
      {"inline_data": {"mime_type": "image/jpeg", "data": "$IMG_BASE64"}}
    ]
  }]
}
EOF

Response Format

Image generation responses are multimodal, containing text and base64-encoded image data:
{
  "candidates": [{
    "content": {
      "parts": [
        { "text": "Here is your generated image..." },
        {
          "inlineData": {
            "mimeType": "image/png",
            "data": "<BASE64_IMAGE_DATA>"
          }
        }
      ]
    }
  }]
}

More Features

Nano Banana Documentation

Supports multi-turn editing, 4K resolution, multi-image composition, and more