Skip to main content

Introduction

Gemini Live API supports low-latency, real-time voice and video interactions with Gemini. It can process continuous audio, video, or text streams to provide instant, natural, and realistic voice responses. Key Features:
  • ✅ High-quality audio: Provides natural, realistic voices in multiple languages
  • ✅ Multi-language support: Supports conversations in 24 languages
  • ✅ Interruption capability: Users can interrupt the model at any time for responsive interactions
  • ✅ Empathetic conversations: Adjusts response style and tone based on the emotional expression of user input
  • ✅ Tool usage: Integrates function calling and Google Search
  • ✅ Audio transcription: Provides text transcription of user input and model output
  • ✅ Proactive audio: Controls when and in which contexts the model responds

API Endpoint

Endpoint: wss://api.leapx-hub.com/v1beta/models/{model}/liveStream Features:
  • Uses Gemini Live API native format
  • Direct passthrough, no protocol conversion
  • Supports all native Gemini features
Example:

Authentication

string
required
Bearer Token, e.g., Bearer sk-xxxxxxxxxx

Supported Models

The following models support Gemini Live API:

Voice and Language Configuration

Voice Configuration

Gemini Live API supports 30 different preset voices, each with unique expression characteristics: Default Voice: Zephyr (Bright)

Language Configuration

Supports 24 languages, specified via BCP-47 language codes: Default Language: Automatically inferred from the language in system instructions

Usage Examples

JavaScript Example

Python Example

Configuration Examples

Example 1: Audio Only Mode

Configuration Notes:
  • responseModalities: Response modality, choose one of the following:
    • ["AUDIO"] - Audio output only
    • ["AUDIO", "TEXT"] - Audio + text transcription (recommended, get both audio and text)
  • voiceName: Voice name, supports 30 preset voices (see voice configuration table above)
  • languageCode: Language code, supports 24 languages (see language configuration table above)
  • googleSearch: Enable Google Search functionality
  • proactiveAudio: Proactive audio, model can choose not to respond to irrelevant audio
  • empatheticMode: Empathetic conversations, adjusts response style based on emotions
  • outputAudioTranscription: Enable output audio-to-text transcription (requires "TEXT" in responseModalities to see transcription text)
  • automaticActivityDetection: Voice activity detection configuration

Message Types

Client Messages

Server Messages

Token Statistics

The system separately tracks:
  • Text Tokens (input/output)
  • Audio Tokens (input/output)
  • Total Token Count
Usage information is returned in usageMetadata messages:

Pricing

Important Note: Model prices may change. Please refer to the latest prices displayed in the model marketplace. Gemini Live API is billed by token, separately tracking text and audio tokens:
  • Text Tokens: Used for input text content and output text transcription
  • Audio Tokens: Used for input audio and output audio content
The system returns detailed usage statistics in usageMetadata messages, including input/output token counts for both text and audio.

Technical Specifications

Audio Format

Input Audio:
  • Format: 16-bit PCM
  • Sample Rate: 16kHz
  • Byte Order: Little-endian
  • Encoding: Base64
Output Audio:
  • Format: 16-bit PCM
  • Sample Rate: 24kHz
  • Byte Order: Little-endian
  • Encoding: Base64

FAQ

Specify the voice name in speechConfig.voiceConfig.prebuiltVoiceConfig.voiceName of the setup message. Supports 30 preset voices. See the Voice Configuration section above for the complete list. Default voice is Zephyr.
Two conditions must be met:
  1. Include "TEXT" in generationConfig.responseModalities (e.g., ["AUDIO", "TEXT"])
  2. Add outputAudioTranscription: {} field in the setup message
Once enabled, the server will return audio text transcription in serverContent.outputTranscription.
Add tools: { googleSearch: {} } field in the setup message. Once enabled, the model can search for the latest web information when answering questions.
Add tool definitions in the setup message:
Sending a new realtimeInput or clientContent message will interrupt the current response.
Yes, Gemini Live API supports video input. Video data (JPEG format, 1 FPS) can be included in clientContent.
The system sends usageMetadata messages during or after response completion, containing detailed usage statistics.
Configure in realtimeInputConfig.automaticActivityDetection of the setup message:

References