Google Gemini Live Translate
Updated
Integrate Google Gemini Live Translate with the Conversational AI Engine for real-time speech translation.
Google Gemini Live Translate translates the user's speech into a target language and speaks the translation, without separate ASR, LLM, or TTS components. The model detects the source language automatically. You set only the target language. This page explains how to integrate Gemini Live Translate through the Gemini Developer API.
Preview endpoint
gemini-4-live-translate runs on a preview endpoint. The Agora Agents SDKs send sessions that use this model to the preview endpoint automatically. This requires Python SDK 2.16.0, TypeScript SDK 2.16.1, Go SDK 2.16.0, or later.
If you call the REST API directly, send your Start a conversational AI agent request to the following preview endpoint instead of the standard endpoint, and include the required header:
- URL:
https://us-west-1-preview.ai.agora.io/api/conversational-ai-agent/v2/projects/<APP_ID>/join - Header:
agora-feature: gemini
Send all later requests for this agent to the preview host with the same header.
Sample configuration
To start a translation session, set model to gemini-4-live-translate and set translate_to to the target language code. The following examples translate the user's speech into Spanish:
from agora_agent import Agent
from agora_agent.agentkit.vendors import GeminiLive
# client is your configured Agora client
agent = (
Agent(client)
.with_mllm(GeminiLive(
api_key='your-google-api-key',
model='gemini-4-live-translate',
translate_to='es',
echo_target_language=False,
transcribe_agent=True,
transcribe_user=True,
))
)import { Agent, GeminiLive } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withMllm(new GeminiLive({
apiKey: 'your-google-api-key',
model: 'gemini-4-live-translate',
translateTo: 'es',
echoTargetLanguage: false,
transcribeAgent: true,
transcribeUser: true,
}));import (
Agora "github.com/AgoraIO/agora-agents-go/v2"
"github.com/AgoraIO/agora-agents-go/v2/agentkit"
"github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
)
// client is your configured Agora client
agent := agentkit.NewAgent(client).WithMllm(
vendors.NewGeminiLive(vendors.GeminiLiveOptions{
APIKey: "your-google-api-key",
Model: "gemini-4-live-translate",
TranslateTo: "es",
EchoTargetLanguage: Agora.Bool(false),
TranscribeAgent: Agora.Bool(true),
TranscribeUser: Agora.Bool(true),
}),
)Use the following mllm configuration in your request:
"mllm": {
"enable": true,
"api_key": "<GOOGLE_GEMINI_API_KEY>",
"params": {
"model": "gemini-4-live-translate",
"translate_to": "es",
"echo_target_language": false,
"transcribe_agent": true,
"transcribe_user": true
},
"vendor": "gemini"
}For a complete working example, see the Gemini Live Translate quickstart for Next.js, Python, or Go.
Supported languages
translate_to takes a language code, such as en, es, fr, ja, ko, de, hi, or ar. It also accepts some regional codes, such as pt-BR, pt-PT, zh-Hans, and zh-Hant. For the complete list of supported languages, see Supported languages in the Gemini API documentation.
Translation limitations
- If you set an unsupported language code, the agent starts, but the Gemini Live session closes with an error.
- The model doesn't use a greeting,
instructions,thinking_level, or the tools you configure inmllm.tools.
Key parameters
| Parameter | Description |
|---|---|
enableboolean | Enables the MLLM module. Replaces the deprecated |
api_keystring | The Google Gemini API key used to authenticate requests. You can generate an API key in Google AI Studio. |
paramsobject | Configuration object for the Gemini Live Translate model.
|
vendorstring | The MLLM provider identifier. Set to |
For details on translation behavior and limitations, see Live translation with Gemini Live API.
