I have built a simple java gemini api live websocket client . When i try to setup connection i and constantly receiving 1007 error code. I have tested different json setup messages and always with the same issue.
11:03:39.427 [boundedElastic-3] INFO i.i.a.c.llm.GeminiLiveApiClient - [ConvID: a2cf1dc9-21ef-4544-b1e7-eb10fa809d6b] GeminiLiveApiClient: Attempting to connect to Gemini Live API: wss://us-central1-aiplatform.googleapis.com/ws/google.cloud.aiplatform.v1beta1.LlmBidiService/BidiGenerateContent
11:03:40.122 [reactor-http-epoll-3] INFO i.i.a.c.llm.GeminiLiveApiClient - [ConvID: a2cf1dc9-21ef-4544-b1e7-eb10fa809d6b] GeminiLiveApiClient: Successfully connected to Gemini API. Session ID: 71a3e359
11:03:40.147 [reactor-http-epoll-3] INFO i.i.a.c.llm.GeminiLiveApiClient - Constructed Gemini
Live setup JSON:
{
“setup” : {
“model” : “models/gemini-2.5-flash-preview-native-audio-dialog”,
“generation_config” : {
“response_modalities” : [ “AUDIO” ]
},
“input_audio_transcription” : { },
“output_audio_transcription” : { },
“system_instruction” : {
“parts” : [ {
“text” : “You are an expert AI assistant …”
} ]
}
}
}
11:03:40.147 [reactor-http-epoll-3] INFO i.i.a.c.llm.GeminiLiveApiClient - [ConvID: a2cf1dc9-21ef-4544-b1e7-eb10fa809d6b] Sending setup message to Gemini: {“setup”:{“model”:“models/gemini-2.5-flash-preview-native-audio-dialog”,“generation_config”:{“response_modalities”:[“AUDIO”]},“input_audio_transcription”:{},“output_audio_transcription”:{},“system_instruction”:{“parts”:[{“text”:“You are an expert AI assistant for a teacher during a live class or session. Your primary function is to provide real-time, accurate transcription of the conversation. Be concise and helpful if asked direct questions.”}]}}}
11:03:40.153 [reactor-http-epoll-3] INFO i.i.a.c.llm.GeminiLiveApiClient - [ConvID: a2cf1dc9-21ef-4544-b1e7-eb10fa809d6b] Outbound audio stream is now waiting for setupComplete signal.
11:03:40.251 [reactor-http-epoll-3] INFO i.c.a.c.o.TeacherLiveConversationOrchestrator - [Flavor: TEACHER_LIVE, Session: 720d0ab7-63e6-62ad-abf0-417583fc3616] Google API session ended for ConvID: a2cf1dc9-21ef-4544-b1e7-eb10fa809d6b
11:03:40.254 [redis-listener-cached-1] DEBUG i.i.a.c.w.WebSocketRedisListener - RedisListener: Received message on channel: ‘ws:event:conversation:a2cf1dc9-21ef-4544-b1e7-eb10fa809d6b’
11:03:40.255 [redis-listener-cached-1] DEBUG i.i.a.c.w.WebSocketRedisListener - RedisListener: Forwarding message from Redis (channel: ‘ws:event:conversation:a2cf1dc9-21ef-4544-b1e7-eb10fa809d6b’) to local WebSocket session 720d0ab7-63e6-62ad-abf0-417583fc3616 from handler EduConversationWebSocketHandler
11:03:40.255 [reactor-http-epoll-3] WARN i.i.a.c.llm.GeminiLiveApiClient - [ConvID: a2cf1dc9-21ef-4544-b1e7-eb10fa809d6b]
This is the error >> Gemini WebSocket session terminated with signal: ON_COMPLETE. Status: 1007 - Invalid resource field value in the request.
I will be pleased by any guidance about this .
Thanks in advance