Stream generate content

Streaming variant of generateContent. Returns Server-Sent Events when called with `?alt=sse` (what the official SDKs use); each event is a partial `GenerateContentResponse` with the incremental text in `candidates[0].content.parts[0].text`. The final event carries `finishReason` and `usageMetadata`. There is no `[DONE]` sentinel; the stream simply ends.

Authentication

AuthorizationBearer

Pass your EmpirioLabs API key as a bearer token. The Anthropic-style x-api-key header is also accepted on every endpoint.

Path parameters

modelstringRequired

An EmpirioLabs chat model id, for example qwen3-7-max.

Query parameters

altenumOptional

Set to sse for Server-Sent Events.

Allowed values:

Request

This endpoint expects an object.
contentslist of objectsRequired

Conversation turns. Roles are user and model.

systemInstructionobjectOptional
generationConfigobjectOptional
toolslist of objectsOptional
toolConfigobjectOptional
safetySettingslist of objectsOptional
Accepted for compatibility.

Response

A stream of partial GenerateContentResponse events (SSE).

Errors

400
Bad Request Error
401
Unauthorized Error
429
Too Many Requests Error