Skip to main content
Gemini Native (Image, Streaming)
Stream Gemini image-generation responses using the native streamGenerateContent endpoint. Request fields are the same as generateContent. POST https://api.mixroute.ai/v1/models/{model}:streamGenerateContent?alt=sse

Models

The request body uses the same fields and model restrictions as Gemini image generation. Use alt=sse in the query string; do not add a body stream parameter.

Examples

Use your MixRoute key in the MIXROUTE_API_KEY environment variable. Requests use Authorization: Bearer .... Replace source-image placeholders with accessible images or local files before editing.

Python

Response

Read text and image parts from candidates[].content.parts[]. Images normally use inlineData with mimeType and Base64 data; preserve thoughtSignature when reusing model turns. Check promptFeedback and finishReason when an image is absent. usageMetadata contains token usage, not image-generation settings. Gemini synchronous image requests