Single bidirectional WebSocket channel for the Live API. The first
message sent by the client MUST be BidiGenerateContentSetup, after
which any of the client-to-server messages can be sent and any of
the server-to-client messages can be received.
Client-to-server messages sent over the Live API WebSocket.
subscribe
receiveLiveServerMessage
Server-to-client messages received over the Live API WebSocket.
Messages
BidiGenerateContentSetup
First message the client sends after opening the WebSocket. Tells
the server which model to use and how to configure the session.
Must be sent exactly once before any other client message.
Content-Type: application/json
BidiGenerateContentClientContent
Incremental update of the conversation delivered from the client.
All content here is unconditionally appended to the conversation
history and used as part of the prompt to the model to generate
conte
Content-Type: application/json
BidiGenerateContentRealtimeInput
Real-time user input sent as a stream. Distinct from
ClientContent in that it is sent continuously, can be interrupted
by ActivityStart/ActivityEnd signaling and supports raw audio,
video and text chu
Content-Type: application/json
BidiGenerateContentToolResponse
Response from the client to a BidiGenerateContentToolCall received
from the server. Individual FunctionResponse objects are matched
to their FunctionCall objects by the id field.
Content-Type: application/json
BidiGenerateContentSetupComplete
Sent in response to a BidiGenerateContentSetup message from the
client when setup processing has finished. Has no fields.
Content-Type: application/json
BidiGenerateContentServerContent
Incremental server update generated by the model in response to
client messages. Content is generated as quickly as possible and
not in real time. Clients may choose to buffer and play it out in
real
Content-Type: application/json
BidiGenerateContentToolCall
Request from the server for the client to execute the provided
functionCalls and return the responses with the matching ids.
Content-Type: application/json
BidiGenerateContentToolCallCancellation
Notification for the client that a previously issued
BidiGenerateContentToolCall with the specified ids should not have
been executed and should be cancelled.
Content-Type: application/json
UsageMetadata
Token usage metadata for the current session.
Content-Type: application/json
GoAway
Server notice that the current connection will soon be terminated.
Clients should use this signal to prepare to reconnect or save
state.
Content-Type: application/json
SessionResumptionUpdate
Update of the session resumption state. Only sent when
sessionResumption was configured in the setup message.
Content-Type: application/json
About AsyncAPI
The AsyncAPI specification describes event-driven APIs the way OpenAPI describes request/response APIs. A channel is the named pipe — a webhook URL, a Kafka topic, a WebSocket route, an MQTT subject — that producers and consumers publish or subscribe to. Each channel carries one or more messages with structured payloads, and an operation declares whether a given party sends or receives on that channel.