Persistent 1007 Invalid Frame Error on BidiGenerateContent WSS Endpoint with JSON Payload

I am encountering a persistent and immediate connection closure (Error 1007) when attempting to send the initial request to the BidiGenerateContent WebSocket endpoint using a standard WebSocket client.

The issue seems to be related to the API server not correctly parsing the JSON payload, strongly suggesting a gRPC-Web framing or Protobuf structure requirement that is undocumented for raw JSON payloads on this endpoint.

Hi @Munisekhar_Udavalapa,

Could you please elaborate on the error? Generally, an Error 1007 on the BidiGenerateContent WebSocket endpoint indicates that the payload does not match the strict schema expected by the stream parser or that the connection handshake was not completed with the required configuration. Can you please share your connection code, the exact JSON payload from your initial request, and details about the programming language and WebSocket library you are using?
Thanks.