Generate images with Gemini models via CometAPI — supports 4K, multi-turn editing, up to 14 reference images, and Thinking.
{
"candidates": [
{
"content": {
"role": "<string>",
"parts": [
{
"text": "<string>",
"inlineData": {
"mimeType": "<string>",
"data": "<string>"
}
}
]
},
"finishReason": "STOP",
"index": 123,
"safetyRatings": [
{
"category": "<string>",
"probability": "<string>"
}
]
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"totalTokenCount": 123,
"thoughtsTokenCount": 123
}
}Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
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.Use your CometAPI API key.
The Gemini image model to use. See the Models page for current options.
Conversation turns. Each item has a role ("user" or "model") and parts array containing text and/or image data.
Show child attributes
Controls generation behavior — output modalities, image resolution, thinking, etc.
Show child attributes
Optional tools. Pass [{"google_search": {}}] to enable Google Search grounding for real-time information in generated images.
Show child attributes
{
"candidates": [
{
"content": {
"role": "<string>",
"parts": [
{
"text": "<string>",
"inlineData": {
"mimeType": "<string>",
"data": "<string>"
}
}
]
},
"finishReason": "STOP",
"index": 123,
"safetyRatings": [
{
"category": "<string>",
"probability": "<string>"
}
]
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"totalTokenCount": 123,
"thoughtsTokenCount": 123
}
}