Skip to content

Gemini Image ​

Gemini image models support text-to-image and chat-based image editing.

Endpoint ​

POST $URL/v1/images/generations

Supported Models ​

ModelPositioning
gemini-3-pro-imageHigh-quality text-to-image
gemini-3-pro-image-previewPreview version
gemini-2.5-flash-imageLightweight and fast
gemini-3.1-flash-imageNew lightweight version

Request Example ​

bash
curl $URL/v1/images/generations \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3-pro-image",
    "prompt": "A cat wearing sunglasses walking down a neon-lit street, cyberpunk style",
    "n": 1,
    "size": "1024x1024"
  }'

Method 2: Gemini Native Format ​

If you need the Gemini native image generation endpoint:

POST $URL/v1/models/{model}:generateContent

Request Body Example ​

json
{
  "contents": [
    {
      "role": "user",
      "parts": [
        { "text": "Generate an image of a cat wearing sunglasses in a cyberpunk city." }
      ]
    }
  ],
  "generationConfig": {
    "responseModalities": ["TEXT", "IMAGE"]
  }
}

cURL Example ​

bash
curl $URL/v1/models/gemini-3-pro-image:generateContent \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [{"text": "Generate an image of a cat wearing sunglasses."}]
      }
    ],
    "generationConfig": {
      "responseModalities": ["TEXT", "IMAGE"]
    }
  }'

Notes ​

  • Gemini Image supports multi-round chat-based image editing, suitable for scenarios requiring repeated refinement.
  • We recommend using the OpenAI-compatible format first to reduce migration cost.

© 2026 Euno AI. All rights reserved.