Skip to main content
POST
https://console.mixroute.io
/
v1
/
images
/
generations
curl --request POST \
  --url https://console.mixroute.io/v1/images/generations \
  --header 'Authorization: Bearer sk-xxxxxxxxxx' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gemini-2.5-flash-image",
    "prompt": "A cute orange kitten sitting in a garden",
    "size": "16:9",
    "quality": "high",
    "n": 1,
    "response_format": "b64_json",
    "image_size": "2K"
  }'
{
  "created": 1709459123,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
    }
  ]
}

Introduction

Nano Banana corresponds to Google Gemini image generation models, including Nano Banana (gemini-2.5-flash-image) and Nano Banana Pro (gemini-3-pro-image-preview). It is called through the unified image generation endpoint POST /v1/images/generations, supporting text-to-image, image-to-image, and multi-image fusion capabilities. For complete parameters and multi-model documentation, please refer to Image Generation.

Authentication

Bearer Token, e.g., Bearer sk-xxxxxxxxxx

Supported Models

Model IDDescription
gemini-2.5-flash-imageNano Banana, cost-effective text-to-image/image-to-image
gemini-3-pro-image-previewNano Banana Pro, higher quality and controllability

Request Examples

curl -X POST "https://console.mixroute.io/v1/images/generations" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash-image",
    "prompt": "A cute orange kitten sitting in a garden, sunny day, high quality photography",
    "size": "16:9",
    "quality": "high",
    "n": 1,
    "response_format": "b64_json",
    "image_size": "2K",
    "mime_type": "image/png",
    "response_modalities": "image"
  }'

Common Parameters

  • prompt: Text-to-image prompt
  • size: Aspect ratio, e.g., 16:9, 1:1
  • quality: Quality level, e.g., high
  • image_size: Output resolution level, e.g., 1K, 2K, 3K
  • response_format: Gemini series only supports b64_json, returns base64 image
  • contents: Used for image-to-image or multi-turn conversations, see Image Generation for format
For more parameters and model differences, please refer to Image Generation.
curl --request POST \
  --url https://console.mixroute.io/v1/images/generations \
  --header 'Authorization: Bearer sk-xxxxxxxxxx' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gemini-2.5-flash-image",
    "prompt": "A cute orange kitten sitting in a garden",
    "size": "16:9",
    "quality": "high",
    "n": 1,
    "response_format": "b64_json",
    "image_size": "2K"
  }'
{
  "created": 1709459123,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
    }
  ]
}