Skip to main content
POST
/
api
/
v3
/
google
/
gemini-3-pro-image-preview
/
image-edit
gemini-3-pro-image-preview (image edit)
curl --request POST \
  --url https://api.example.com/api/v3/google/gemini-3-pro-image-preview/image-edit
Gemini’s GPTProto format for the image edit API.
curl  --location --request POST 'https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit' \
--header  'Authorization: Bearer ${GPTPROTO_API_KEY}' \
--header  'Content-Type: application/json' \
--data-raw  '{
    "prompt": "Combine two images, making Obama the main character of the poster, and replace the PLuribus text with GPT PROTO.",
    "images": [
        "https://oss.heyoos.com/2025/11/20/e5cd8678ca164470bcbe51a948eb10f0.png",
        "https://oss.heyoos.com/2025/11/27/b9235ffad28040898b3702826c1731f9.jpg"
    ],
    "output_format": "jpeg"
}'
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}
curl --location 'https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit' \
--header 'Authorization: Bearer ${GPTPROTO_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "prompt": "Using the provided image of my cat, please add a small, knitted wizard hat on its head. Make it look like it's sitting comfortably and not falling off.",
  "images": [
    "https://oss.heyoos.com/2025/11/20/e5cd8678ca164470bcbe51a948eb10f0.png"
  ],
  "output_format": "jpeg"
}'
curl --location 'https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit' \
--header 'Authorization: Bearer ${GPTPROTO_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "prompt": "Create a professional e-commerce fashion photo. Take the blue floral dress from the first image and let the woman from the second image wear it. Generate a realistic, full-body shot of the woman wearing the dress, with the lighting and shadows adjusted to match the outdoor environment.",
  "images": [
    "https://oss.heyoos.com/2025/11/20/e5cd8678ca164470bcbe51a948eb10f0.png",
    "https://oss.heyoos.com/2025/11/27/b9235ffad28040898b3702826c1731f9.jpg"
  ],
  "output_format": "jpeg"
}'

Parameters

ParameterTypeRequiredDefaultDescription
promptstring✅ Yes-A text description of the desired image edit. The prompt should be detailed and describe the changes you want to make to the input images.
imagesarray✅ Yes-An array of image URLs that you want to edit or combine. Supported MIME types: image/png, image/jpeg, image/webp
output_formatstring❌ NopngThe format in which the generated images should be returned. Must be one of url or b64_json.

Image Edit

Response

  {
      "created": 1762156444807,
      "data": [
          {
              "b64_json": "image_base64"
          }
      ],
      "output_format": "png",
      "quality": "high",
      "size": "16:9",
      "usage": {
          "input_tokens": 535,
          "input_tokens_details": {
              "image_tokens": 516,
              "text_tokens": 19
          },
          "output_tokens": 1291,
          "total_tokens": 1826
      }
  }

Adding and removing elements

Provide an image and describe your change. The model will match the original image’s style, lighting, and perspective.
InputOutput
InputOutput
A photorealistic picture of a fluffy ginger cat…Using the provided image of my cat, please add a small, knitted wizard hat…

Advanced composition: Combining multiple images

Provide multiple images as context to create a new, composite scene. This is perfect for product mockups or creative collages.
Input1Input2Output
InputInputOutput
A professionally shot photo of a blue floral summer dress…Full-body shot of a woman with her hair in a bun…Create a professional e-commerce fashion photo…

Best Practices

To elevate your results from good to great, incorporate these professional strategies into your workflow.
  • Be Hyper-Specific: The more detail you provide, the more control you have. Instead of “fantasy armor,” describe it: “ornate elven plate armor, etched with silver leaf patterns, with a high collar and pauldrons shaped like falcon wings.”
  • Provide Context and Intent: Explain the purpose of the image. The model’s understanding of context will influence the final output. For example, “Create a logo for a high-end, minimalist skincare brand” will yield better results than just “Create a logo.”
  • Iterate and Refine: Don’t expect a perfect image on the first try. Use the conversational nature of the model to make small changes. Follow up with prompts like, “That’s great, but can you make the lighting a bit warmer?” or “Keep everything the same, but change the character’s expression to be more serious.”
  • Use Step-by-Step Instructions: For complex scenes with many elements, break your prompt into steps. “First, create a background of a serene, misty forest at dawn. Then, in the foreground, add a moss-covered ancient stone altar. Finally, place a single, glowing sword on top of the altar.”
  • Use “Semantic Negative Prompts”: Instead of saying “no cars,” describe the desired scene positively: “an empty, deserted street with no signs of traffic.”
  • Control the Camera: Use photographic and cinematic language to control the composition. Terms like wide-angle shot, macro shot, low-angle perspective.

Limitations

  • For best performance, use the following languages: EN, es-MX, ja-JP, zh-CN, hi-IN.
  • Image generation does not support audio or video inputs.
  • The model won’t always follow the exact number of image outputs that the user explicitly asks for.
  • The model works best with up to 3 images as an input.
  • When generating text for an image, Gemini works best if you first generate the text and then ask for an image with the text.
  • Uploading images of children is not currently supported in EEA, CH, and UK.