Gemini Live API error - Unsupported language code 'es-ES'

Gemini API for native audio preview model randomly throws this error

Backend error: received 1007 (invalid frame payload data) Unsupported language code ‘es-ES’ for model models/gemini-2.5-flash-native-audio-preview-12-2025; then sent 1007 (invalid frame payload data) Unsupported language code ‘es-ES’ for model models/gemini-2.5-flash-native-audio-preview-12-2025. Please check backend configuration.

I do no changes to my code and keep refreshing and establishing new sessions and the error goes away.

Some code snippets

# Language code mapping for speech configuration

LANGUAGE_TO_CODE = {

“german”: “de-DE”,

“spanish”: “es-ES”,

“french”: “fr-FR”,

“russian”: “ru-RU”,

“finnish”: “fi-FI”,

“english”: “en-US”,

}

            run_config = RunConfig(

                *response_modalities*=\["AUDIO"\],

output_audio_transcription=genai_types.AudioTranscriptionConfig(),

speech_config=genai_types.SpeechConfig(

voice_config=genai_types.VoiceConfig(

prebuilt_voice_config=genai_types.PrebuiltVoiceConfig(

voice_name=“Charon” # Multi-language voice

)

),

language_code=language_code,

)

)

Definitely a transient issue with the model or service.

1 Like

Hi @DataSiens_AI , Could you please provide minimal reproducible code snippet along with the screenshot of relevant error logs and output. This will help us test this issue on our end.

1 Like

My code is very similar to what we have here

except that instead of English I see this error happen with Spanish es-ES

from google.genai import types
from google.adk.agents import Agent
from google.adk.models.google_llm import Gemini
from google.adk.tools import google_search

Create a Gemini instance with custom speech config

custom_llm = Gemini(
model=“gemini-2.5-flash-native-audio-preview-12-2025”,
speech_config=types.SpeechConfig(
voice_config=types.VoiceConfig(
prebuilt_voice_config=types.PrebuiltVoiceConfig(
voice_name=“Charon”
)
),
language_code=“es-ES”
)
)

Pass the Gemini instance to the agent

agent = Agent(
model=custom_llm,
tools=[google_search],
instruction=“You are a helpful assistant.”
)

Note that this error does not occur all the time and instead is a rare phenomenon. So you will have to do regression test to spot this error. The project id and name is similar to what I DM’ed you in the other case.

My observation is that this error happens only with es-Es and not other languages. I switched to es-US now to check if I can replicate the issue. When I was reading the documentation, I found that es-ES* has an asterix next to it.
Languages marked with an asterisk (*) are not available for Native audio.

es-US does not and the output seems to be similar.

Since the error appears randomly, I need to keep it under observation for a few days.