Skip to main content
POST
Text Generator (Streaming)

Authorizations

X-API-ID
string
header
required

API ID, from your settings page.

X-API-KEY
string
header
required

API Key, from your settings page.

Body

application/json
model_name
string
required

Name of the Gemini model (e.g. gemini-2.5-flash).

Maximum string length: 255
messages
object[]
required

List of messages with 'role' (user/model) and 'content'.

system_instruction
string
default:""

Optional system instruction for the model.

config
object

Generation config parameters.

tools
object[]

List of tools (function declarations) the model may call.

tool_config
object

Controls how the model uses the provided tools.

webhook_url
string<uri>

Webhook URL for async status updates.

sync
boolean
default:false

If true, the request blocks until generation completes and returns the result directly. Default is false (async).

Response

SSE stream of Gemini response chunks. Content-Type: text/event-stream.

The response is of type string.