Gemini Live API - Vanilla JS Example
Vanilla JavaScript implementation with audio, video, and text streaming
API Configuration
Connection Settings
Proxy WebSocket URL:
Project ID:
Model ID:
Gemini Behavior
System Instructions:
You are a helpful assistant. Be concise and friendly.
Voice:
Puck (Default)
Charon
Kore
Fenrir
Aoede
Temperature:
1.0
Controls randomness (0.0-2.0]. Higher = more creative/diverse, Lower = more predictable/focused
Enable proactive audio (Gemini will ignore speech based on instructions)
Enable Google grounding (Enabling Google grounding will disable custom tools)
Enable affective dialog (emotion detection and empathetic responses)
Custom Tools
Show Alert Box
(Display browser alerts)
Add CSS Style
(Inject CSS styles into the page)
Transcription Settings
Enable input transcription (your speech)
Enable output transcription (Gemini responses)
Activity Detection Settings
Disable automatic activity detection
Silence duration (ms):
Prefix padding (ms):
End of speech sensitivity:
Default
High (quicker cutoff)
Low (longer wait)
Start of speech sensitivity:
Default
High (quicker detection)
Low (more filtering)
Activity Handling:
Default (Interrupts)
Interrupt (Barge-in)
No Interruption
Connect
Disconnect
Not connected
Setup Message JSON (raw config sent to Gemini API)
Media Streaming
Microphone:
Default Microphone
Camera:
Default Camera
Start Audio
Start Video
Share Screen
Output volume:
80%
Chat
Connect to Gemini to start chatting
Send
Debug Info
Ready to connect...