Support for Gemini 3.8 flash TTS

Hi there!

I’d like to know if Gemini 3.8 flash (and flash-lite) TTS is already supported on the most recent version of the Agents Framework (1.8.3), including the custom voices (the ones generated by replication)

Thanks in advance for any information

@Kevin_Quijano The model: GeminiTTSModels tops out at gemini-3.1-flash-tts-preview, plus 2.5 flash, 2.5 flash-lite preview and 2.5 pro. No 3.8 entry, and that’s from main, so it isn’t in 1.8.3 either.

But the signature is model_name: NotGivenOr[GeminiTTSModels | str], so the literal is autocomplete only and a plain string passes through to Google:

google.TTS(model_name="gemini-3.8-flash-tts") # whatever the exact id is

Nothing in the plugin gates it. Whether it works is down to the Google TTS API accepting that id, not your Agents version.

The cloned voices are a harder no. The plugin states it directly: “only chirp 3 model can support voice cloning”. Passing voice_cloning_key forces model_name = “chirp_3”, and voice_params.model_name is deliberately skipped on that path. So a replicated voice can’t be paired with a Gemini TTS model at all, regardless of version.

Hi @Kevin_Quijano we have support for Gemini 3.8 flash TTS in the plugin here:

and that docs page contains some code examples which have been updated to specify the model.

I’m not entirely sure how that works, but when you replicate a voice, do you get a name you can pass to the voice_nameparam? I would expect if the name is in your account, it should be picked up.

@abidullahcs.uk I think you were looking at the separate Google TTS plugin.

Actually when I replicate a voice using the gemini API it returns a voice_id which can be used like shown in the following code block:

import base64
from google import genai
from pathlib import Path

here = Path(__file__).parent

client = genai.Client()

def clone():
    with open(here / "audios" / "source.wav", "rb") as f:
        source_b64 = base64.b64encode(f.read()).decode("utf-8")

    with open(here / "audios" / "consent.wav", "rb") as f:
        consent_b64 = base64.b64encode(f.read()).decode("utf-8")

    # Create a persistent replicated voice (store=True)
    replicated_voice = client.voices.create(
        store=True,
        voice={
            "model": "gemini-3.8-flash-tts",
            "type": "replicated",
            "display_name": "Custom Replicated Speaker",
            "replicated": {
                "source_audio": {
                    "mime_type": "audio/wav",
                    "data": source_b64,
                },
                "consent_audio": {
                    "mime_type": "audio/wav",
                    "data": consent_b64,
                },
            },
        },
    )

    print(f"Created voice ID: {replicated_voice.id}")
    print(f"{replicated_voice=}")

    return replicated_voice.id

def synth(voice_id: str):

    interaction = client.interactions.create(
        model="gemini-3.8-flash-tts",
        input=[{
            "type": "user_input",
            "content": [{
                "type": "text",
                "text": (
                    "Hello world"
                ),
                "annotations": [{
                    "type": "speech_metadata",
                    "style": "warm and conversational",
                }],
            }],
        }],
        response_format={"type": "audio"},
        generation_config={
            "speech_config": [
                {"voice": voice_id},
            ]
        },
    )

    with open(here / "38-flash.wav", "wb") as f:
        f.write(base64.b64decode(interaction.output_audio.data))

if __name__ == "__main__":
    voice_id = clone()
    synth(voice_id)

But when I try to pass the replicated voice id to the Gemini TTS plugin (in the parameter voice_name), I get the following error

livekit.agents ._exceptions.APIStatusError: message='gemini tts: client error', status_code=400, retryable=False, body={
    "error": { 
        "code": 400, 
        "message": "No matching speaker voice found for name: <replicated_voice_id> and language: " 
        "status": "INVALID_ARGUMENT" 
    }
}

I also tried with the voice name used (in this case “Custom Replicated Speaker”) and its returning the same error

Here’s the official documentation about replication: https://ai.google.dev/gemini-api/docs/voice-replication#audio_and_consent_requirements

Thanks for all that information. It looks like this is not supported in the Gemini plugin. I got a suggested update from Claude to modify agents/livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/gemini_tts.py at main · livekit/agents · GitHub per the attached file as the voice needs to be sent in a specific field.

gemini_tts.py (19.6 KB)

That seemed very sensible, but I obviously wanted to try this before telling you this was the solution. Unfortunately however it looks like replicated voices are unavailable in my region (UK)

Can I please ask you to try modifying the plugin per the attached and see if it works for you? I would expect you to just provide the voice ID in the voice name after this change.

It’s working now, thank you very much

Can I ask you, how soon will this feature be available in the plugin?

@Kevin_Quijano It’s good to know that you could make voice replication (custom voices) work with Gemini, this is gonna be massive. Submit a PR to see what the LK team think of it.

@darryncampbell As someone who mainly uses Gemini RealtimeModel() specifically gemini-3.8-live, it would be nice if we could have a custom voice when running the Realtime model.

I’m aware the Gemini RealtimeModel() supports usage with a separate TTS. Instead of using a separate TTS, I’m curious to see if the voice can be saved/created in Gemini & then used in Livekit

I’d echo that please - I don’t see this request from anyone else and it’s not on the agent’s team backlog so this would be the quickest route.

I would raise the PR myself but I wouldn’t be comfortable doing that without being able to test the feature. I did find from Google’s official blog on the subject: “Voice replication through AI Studio is not available in Illinois, Texas, EEA, UK, Switzerland, and India.”. That’s hidden in the fine print at the bottom. I did also try through the API but I get the same issue.

@Kamal_Moha I found the following at https://ai.google.dev/gemini-api/docs/speech-generation “The TTS capability differs from speech generation provided through the Live API, which is designed for interactive, unstructured audio, and multimodal inputs and outputs.” which I think would be the official word that it wouldn’t be possible for you (though I agree it would be cool if it were possible)

@darryncampbell Thanks for looking into this. I see the limitation is on Google’s side & we will see when they start offering voice replication for the Live API.