Skip to main content
POST
Gemini image editing
Image editing uses generateContent. Encode the source image as Base64 and send it beside the text instruction in contents[].parts[].
JSON REST requests use camelCase fields such as inlineData and mimeType. SDK objects may display inline_data and mime_type; do not copy SDK naming into JSON. Select the output extension from the returned mimeType rather than assuming PNG.