Skip to main content
POST
Gemini streamGenerateContent
Use this endpoint for Gemini streaming text generation and incremental event output.
  • The common auth pattern is x-goog-api-key: {API_KEY}, though query-string API keys are also supported
  • The request structure is mostly the same as generateContent, with contents as the core field
  • The response is an event stream rather than one final JSON payload
  • Finish state and safety metadata may only become complete in later chunks

Authorizations

x-goog-api-key
string
header
required

Path Parameters

model
string
required

Gemini model name.

Example:

"gemini-2.5-pro"

Body

application/json
contents
object[]
required
systemInstruction
object
generationConfig
object
safetySettings
object[]
tools
object[]

Response

Successful Gemini streaming response

The response is of type string.