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.
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.
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.