Skip to main content
POST
/
api
/
v3
/
google
/
{model}
/
text-to-image
gemini-3-pro-image-preview (text to image)
curl --request POST \
  --url https://api.example.com/api/v3/google/{model}/text-to-image
Gemini’s GPTProto format for the text to image API.
curl --location 'https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image' \
--header 'authorization: sk-xx' \
--header 'content-type: application/json' \
--data '{
    "prompt": "a cat",
    "size":"4K",
    "aspect_ratio": "1:1",
    "enable_base64_output": false,
    "enable_sync_mode": false,
    "output_format": "png"
  }'
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}

Parameters

prompt (string, required)
  • Default: a cat
  • A text description of the desired image(s)
size (string, optional)
  • The size of the generated images
  • Options: 1K, 2K, 4K
aspect_ratio (string, optional)
  • Default: 1:1
  • The aspect ratio of the generated image
  • Supported values: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9
n (integer, optional)
  • Default: 1
  • The number of images to generate
  • Must be between 1 and 10
background (string, optional)
  • Default: auto
  • Allows to set transparency for the background of the generated image(s)
  • This parameter is only supported for gpt-image-1
  • Must be one of transparent, opaque or auto
  • When auto is used, the model will automatically determine the best background for the image
enable_base64_output (boolean, optional)
  • Default: false
  • Whether to enable base64 output format
  • Options: false, true
enable_sync_mode (boolean, optional)
  • Default: false
  • Whether to enable synchronous mode
  • Options: false, true
output_format (string, optional)
  • Default: png
  • The output format of the generated image
  • Example: png