Gemini
Generate images with Gemini
Generate images with Gemini models via CometAPI — supports 4K, multi-turn editing, up to 14 reference images, and Thinking.
POST
gemini-2.5-flash-image is scheduled for shutdown by the provider on 2026-10-02. For new projects, use gemini-3.1-flash-image-preview or gemini-3-pro-image-preview. See Google’s deprecation schedule for details.Gemini image responses can include intermediate image parts where
thought is true. These are not the final output. When saving generated images, skip thought: true parts and use the last image part where inlineData exists and thought is not true.Authorizations
Use your CometAPI API key.
Path Parameters
The Gemini image model to use. See the Models page for current options.
Body
application/json
Conversation turns. Each item has a role ("user" or "model") and parts array containing text and/or image data.
Controls generation behavior — output modalities, image resolution, thinking, etc.
Optional tools. Pass [{"google_search": {}}] to enable Google Search grounding for real-time information in generated images.