This is a collection of websocket-specific examples and quickstarts for using the experimental Gemini 2.0 Flash model.
Python users should build using the Google GenAI SDK to access the Multimodal Live API, but as the underlying API is served over secure websockets, the following examples have been provided to help you understand how the protocol works.
To learn about what’s new in the 2.0 model release and the new Google GenAI SDKs, check out the Gemini 2.0 model page. To start experimenting with the model now, head to Google AI Studio for prompting or to the Multimodal Live API demo to try the new Live capabilities.
Explore Gemini 2.0’s capabilities on your own local machine.
- Live API starter script - A locally runnable Python script using websockets that supports streaming audio in and audio + video out from your machine
- Bash Websocket example - A bash script using
websocat
to interact with the Live API in a shell context
Explore Gemini 2.0’s capabilities through the following notebooks you can run through Google Colab.
- Live API starter - Overview of the Multimodal Live API using websockets
- Live API tool use - Overview of tool use in the Live API with websockets