Skip to main content
POST

Introduction

streamGenerateContent is the streaming version of Gemini native generateContent. Nano Banana maps to Google Gemini’s native image generation capability, including Nano Banana (gemini-2.5-flash-image), Nano Banana 2 (gemini-3.1-flash-image, gemini-3.1-flash-image-preview), and Nano Banana Pro (gemini-3-pro-image). When calling the MixRoute native streaming API, use the endpoint POST /v1/models/<model>:streamGenerateContent?alt=sse and pass a JSON Payload that follows the Gemini native structure. It supports text-to-image, image-to-image, and multi-image fusion. The streaming API returns Server-Sent Events (SSE). Clients should read the data: event content line by line instead of parsing the entire response body as a single JSON object. For complete parameters and multi-model details, see Image generation.

Authentication

Bearer Token, such as Bearer sk-xxxxxxxxxx

Supported Models

Basic Examples

Request Parameters

string
required
The Gemini native (image) model identifier, located in the URL path, such as gemini-3.1-flash-image or gemini-3-pro-image.
string
Streaming response format. When sse is passed, the API returns streaming GenerateContentResponse data as Server-Sent Events.
array
required
Native conversation or image content list.
object
Generation configuration parameters.
For more parameters and model differences, see Image generation.

Response Format

The API returns an SSE stream. Each data: event contains a JSON GenerateContentResponse instance; images may appear in one or more chunks’ candidates as one or more Base64-encoded inlineData entries. Clients should read SSE line by line and parse the JSON after each data: separately.