> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini

> JavaScript API reference for the gemini realtime models plugin.

## GeminiRealtime

Google Gemini realtime (speech-to-speech / live) provider.

### Constructor

```typescript theme={null}
new GeminiRealtime(opts: { apiKey?: string; config?: GeminiLiveConfig | null; [key: string]: any })
```

<ParamField path="apiKey" type="string" />

<ParamField path="config" type="GeminiLiveConfig | null" />

### cleanup

```typescript theme={null}
cleanup(): Promise<void>
```

### close

```typescript theme={null}
close(): Promise<void>
```

### getRuntimeConfig

```typescript theme={null}
getRuntimeConfig(): Record<string, any>
```

<ResponseField name="returns" type="Record<string, any>" />

***

## GeminiLiveConfig

Configuration for the Google Gemini Live (realtime speech-to-speech) provider.

All fields are optional; unset values fall back to the defaults noted on each
field. Pass an instance as the `config` option to GeminiRealtime.

### Fields

<ParamField path="model" type="string" default="gemini-3.1-flash-live-preview">
  Gemini Live model id to use.
</ParamField>

<ParamField path="voice" type="string" default="Puck">
  Prebuilt Gemini voice name for synthesized audio output (e.g. 'Puck',
  'Charon', 'Kore', 'Fenrir', 'Aoede').
</ParamField>

<ParamField path="responseModalities" type="string[]" default="['AUDIO']">
  Output modalities the model should produce. Typically `['AUDIO']` for
  speech-to-speech or `['TEXT']` for text responses.
</ParamField>

<ParamField path="topP" type="number | null" default="null">
  Nucleus sampling probability mass (0..1). Higher values widen token
  selection. `null` leaves it unset (model default).
</ParamField>

<ParamField path="topK" type="number | null" default="null">
  Top-k sampling: restrict sampling to the k most likely tokens. `null`
  leaves it unset (model default).
</ParamField>

<ParamField path="maxOutputTokens" type="number | null" default="null">
  Maximum number of tokens to generate per response. `null` leaves it unset
  (model default).
</ParamField>

<ParamField path="presencePenalty" type="number | null" default="null">
  Presence penalty; positive values discourage reusing tokens already
  present, encouraging new topics. `null` leaves it unset (model default).
</ParamField>

<ParamField path="frequencyPenalty" type="number | null" default="null">
  Frequency penalty; positive values discourage repeating frequent tokens.
  `null` leaves it unset (model default).
</ParamField>

<ParamField path="candidateCount" type="number | null" default="null">
  Number of candidate responses to generate. `null` leaves it unset (model
  default, typically 1).
</ParamField>

<ParamField path="languageCode" type="string | null" default="null">
  BCP-47 language code hint for output (e.g. 'en-US'). `null` lets the model
  auto-detect.
</ParamField>

<ParamField path="thinkingBudget" type="number | null" default="null">
  Token budget allotted to the model's internal "thinking" reasoning. `null`
  leaves it unset (model default).
</ParamField>

<ParamField path="includeThoughts" type="boolean" default="false">
  Whether to include the model's thought summaries in the response.
</ParamField>

<ParamField path="vadStartSensitivity" type="string | null" default="null">
  Voice-activity-detection start sensitivity for detecting speech onset
  (e.g. 'START\_SENSITIVITY\_LOW' / 'START\_SENSITIVITY\_HIGH'). `null` uses the
  model default.
</ParamField>

<ParamField path="vadEndSensitivity" type="string | null" default="null">
  Voice-activity-detection end sensitivity for detecting speech end (e.g.
  'END\_SENSITIVITY\_LOW' / 'END\_SENSITIVITY\_HIGH'). `null` uses the model
  default.
</ParamField>

<ParamField path="vadPrefixPaddingMs" type="number | null" default="null">
  Milliseconds of audio to retain before detected speech starts. `null` uses
  the model default.
</ParamField>

<ParamField path="vadSilenceDurationMs" type="number | null" default="null">
  Milliseconds of trailing silence required before speech is considered
  ended. `null` uses the model default.
</ParamField>

<ParamField path="contextCompressionTriggerTokens" type="number | null" default="null">
  Token count at which context compression is triggered to keep the session
  within the context window. `null` disables/uses the model default.
</ParamField>

<ParamField path="sessionResumptionHandle" type="string | null" default="null">
  Handle from a previous session used to resume that session's state. `null`
  starts a fresh session.
</ParamField>

<ParamField path="enableInputTranscription" type="boolean" default="true">
  Whether to emit transcriptions of the user's input audio.
</ParamField>

<ParamField path="enableOutputTranscription" type="boolean" default="true">
  Whether to emit transcriptions of the model's output audio.
</ParamField>

<ParamField path="vertexai" type="boolean" default="false">
  Use Vertex AI authentication instead of a Gemini API key. When `true`,
  vertexProjectId is required.
</ParamField>

<ParamField path="vertexProjectId" type="string | null" default="null">
  Google Cloud project id for Vertex AI. Required when vertexai is
  `true`.
</ParamField>

<ParamField path="vertexLocation" type="string" default="us-central1">
  Google Cloud region for Vertex AI requests.
</ParamField>

<ParamField path="vertexServiceAccountJson" type="string | Record<string, any> | null" default="null">
  Vertex AI service-account credentials, as a JSON string or parsed object.
  If unset, falls back to vertexServiceAccountPath, then the
  `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
</ParamField>

<ParamField path="vertexServiceAccountPath" type="string | null" default="null">
  Filesystem path to a Vertex AI service-account JSON key file. Used only
  when vertexServiceAccountJson is not provided.
</ParamField>
