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": "一隻可愛的橙色小貓坐在花園裡",
    "size": "16:9",
    "quality": "high",
    "n": 1,
    "response_format": "b64_json",
    "image_size": "2K"
  }'
{
  "created": 1709459123,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
    }
  ]
}

簡介

Nano Banana 對應 Google Gemini 圖像生成模型,包括 Nano Banana(gemini-2.5-flash-image)與 Nano Banana Pro(gemini-3-pro-image-preview)。通過統一的圖片生成接口 POST /v1/images/generations 調用,支持文生圖、圖生圖及多圖融合等能力。 完整參數與多模型說明請參見 圖片生成

認證

Bearer Token,如 Bearer sk-xxxxxxxxxx

支持的模型

模型 ID說明
gemini-2.5-flash-imageNano Banana,高性價比文生圖/圖生圖
gemini-3-pro-image-previewNano Banana Pro,更高畫質與可控性

請求示例

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": "一隻可愛的橙色小貓坐在花園裡,陽光明媚,高質量攝影",
    "size": "16:9",
    "quality": "high",
    "n": 1,
    "response_format": "b64_json",
    "image_size": "2K",
    "mime_type": "image/png",
    "response_modalities": "image"
  }'

常用參數

  • prompt:文生圖提示詞
  • size:寬高比,如 16:91:1
  • quality:質量檔位,如 high
  • image_size:輸出尺寸檔位,如 1K2K3K
  • response_format:Gemini 系列僅支持 b64_json,返回 base64 圖片
  • contents:圖生圖或多輪對話時使用,格式見 圖片生成
更多參數與各模型差異請參見 圖片生成
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": "一隻可愛的橙色小貓坐在花園裡",
    "size": "16:9",
    "quality": "high",
    "n": 1,
    "response_format": "b64_json",
    "image_size": "2K"
  }'
{
  "created": 1709459123,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
    }
  ]
}