Skip to main content
POST
Gemini image generation
Image generation shares the Gemini generateContent endpoint. Replace {model} with an image-capable model ID from the live model page.
Read images from candidates[].content.parts[].inlineData. mimeType identifies the format and data contains Base64. A text part containing a Markdown data URL may appear as a compatibility fallback. Use a client timeout of at least 120 seconds and inspect finish and safety feedback when no image is returned.