Gemini 3 Pro Image Preview (Stream)
Generate images using Gemini 3 Pro Image Preview in streaming mode via SSE. The endpoint returns newline-delimited Server-Sent Events. Thinking chunks (thought=true) arrive first, followed by the image chunk containing inlineData, and finally a usage metadata chunk.
Documentation Index
Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt
Use this file to discover all available pages before exploring further.
Query Parameters
API Key
Set to sse for explicit Server-Sent Events mode (optional, streaming is the default behaviour of this endpoint)
sse Body
Array of conversation turns. Each turn has a role and parts. A part can be a text prompt, or an inline_data image (base64). To use a reference image, include both a text part and an inline_data part in the same parts array.
[
{
"role": "user",
"parts": [
{
"text": "Generate an image of a sunset over mountains"
}
]
}
]Response
Streaming SSE response. Each line starts with "data:" followed by a JSON chunk. Three chunk types are delivered in order: (1) Thinking chunks — parts[0].thought is true; (2) Image chunk — parts[0].inlineData contains mimeType and base64 data (camelCase); (3) Final usage chunk — top-level usageMetadata with thoughtsTokenCount.
A single SSE chunk. Three variants are possible: thinking chunk (parts[].thought=true), image chunk (parts[].inlineData), or usage chunk (no candidates).
Present in thinking and image chunks; absent in the final usage chunk.
Token usage. Final chunk contains full details including thoughtsTokenCount.
"gemini-3-pro-image-preview"
"2025-01-01T00:00:00Z"
"abc123"