Rate this page:

LiveAPIClientParameters

Gemini.LiveAPIClient parameters. Can be passed as arguments to the Gemini.createLiveAPIClient method.

Props

apiKey

Optional
Copy URL
apiKey: 

string

|

undefined

Optional. Gemini API key. Required for [Backend.GEMINI_API]. Get a Gemini API key here.

backend

Optional
Copy URL
backend: 

Backend

Optional. Backend is the GenAI backend to use for the client. The default value is [Backend.GEMINI_API].

connectConfig

Optional
Copy URL
connectConfig: 

Object

Optional. Session config for the API connection.

credentials

Optional
Copy URL
credentials: 

string

|

undefined

Optional. Google credential file content.

httpOptions

Optional
Copy URL
httpOptions: 

Object

Optional. HTTP options to override. NOTE: the 'baseUrl' parameter will be ignored.

location

Optional
Copy URL
location: 

string

|

undefined

Optional. GCP Location/Region for Vertex AI. Required for [Backend.VERTEX_AI]. Generative AI locations.

model

Optional
Copy URL
model: 

string

|

undefined

Optional. The model to use for Gemini Live API processing. The default value is gemini-2.0-flash-exp.

onWebSocketClose

Optional
Copy URL
onWebSocketClose: 

(event: WebSocketEvents.CLOSE) => void

|

undefined

Optional. A callback function that is called when the WebSocket connection is closed.

project

Optional
Copy URL
project: 

string

|

undefined

Optional. GCP Project ID for Vertex AI. Required for [Backend.VERTEX_AI]. Find your Project ID here.

statistics

Optional
Copy URL
statistics: 

false

|

undefined

|

true

Optional. Enables statistics functionality.

trace

Optional
Copy URL
trace: 

false

|

undefined

|

true

Optional. Whether to enable the tracing functionality. If tracing is enabled, an URL to the trace file appears in the websocket.created message. The file contains all sent and received WebSocket messages in the plain text format. The file is uploaded to the S3 storage.

Note: Enable this only for diagnostic purposes. You can provide the trace file to our support team to help investigating issues.