Skip to main content
POST
/
v1
/
images
/
generations
gemini-3-pro-image-preview (text to image)
curl --request POST \
  --url https://api.example.com/v1/images/generations
Gemini’s OpenAI-compatible format for the text to image API.
curl --location 'https://gptproto.com/v1/images/generations' \
--header 'Authorization: sk-***********' \
--header 'Content-Type: application/json' \
--data '{
    "model": "gemini-3-pro-image-preview",
    "prompt": "A cute puppy playing in the park",
    "n": 1,
    "size": "1024x1024"
}'
{
  "error": {
    "message": "Invalid request: The prompt contains unsafe content",
    "type": "400"
  }
}

Path Parameters

Parameters

ParameterTypeRequiredDefaultDescription
modelstring✅ Yes-The model to use for generating images (e.g., “gemini-3-pro-image-preview”).
promptstring✅ Yes-The text prompt to generate images from.
ninteger❌ No1The number of images to generate.
sizestring❌ No1024x1024The size of the generated images (e.g., “256x256”, “512x512”, “1024x1024”).
qualitystring❌ NostandardThe quality of the generated images (“standard” or “hd”).
response_formatstring❌ NourlThe format of the response (“url” or “b64_json”).
stylestring❌ NovividThe style of the generated images (“vivid” or “natural”).