Prerequisites
Before proceeding, ensure that your development environment meets the following requirements:- A Zero Runtime account (create one from the Zero Runtime Dashboard).
- Node.js and Python 3.11+ installed on your device.
- A Google API key with Gemini Live API access.
You need a Zero Runtime account to generate a token and a Google API key for the Gemini Live API.
Generate a token from the Zero Runtime Dashboard and a Google API key from Google AI Studio.
Project Structure
Your project structure should look like this:root
node_modules
public
src
config.js
App.js
index.js
agent-react.py
.env
App.js: Creates a basic UI for joining the meeting.config.js: Stores the token and room ID.index.js: The entry point of your React application.agent-react.py: The Python AI agent backend using the Google Gemini Live API..env: Environment variables for API keys.
Part 1: React Frontend
Getting started with the code
Create a new React app using the command below.Install the Zero Runtime React SDK. Make sure you are in your React app directory before you run this command.
Configure environment and credentials
Create a meeting room using the Zero Runtime API:Copy the
roomId from the response and configure it in src/config.js:src/config.js
Design the user interface
Create the main App component with audio-only interaction in
src/App.js:src/App.js
Part 2: Python AI Agent
Setup the project
Use Python 3.11 or higher, then install the Zero Runtime Agents SDK. Create and activate a virtual environment, then install
zrt and python-dotenv. Every provider plugin ships with zrt.Configure environment variables
Create a
.env file in your project root to store your keys and token securely for the Python agent:.env
Create the AI agent backend
Create the Python AI agent that joins the same meeting room and interacts with users through voice.
agent-react.py
Part 3: Run the Application
Run the frontend
Once you have completed all the steps above, start your React application:Open
http://localhost:3000 in your web browser.Run the AI agent
Open a new terminal, activate your virtual environment, and run the Python agent. It reads
GOOGLE_API_KEY from the .env file.Connect and interact
-
Join the meeting from the React app:
- Click the Join button in your browser.
- Allow microphone permissions when prompted.
-
Agent connection:
- Once you join, the Python backend detects your participation.
- You should see “Participant joined” in the terminal.
- The AI agent greets you and initiates the game.
-
Start playing:
- The agent guides you through a number guessing game (1–100).
- Use your microphone to interact with the AI host.
- The agent provides hints and encouragement throughout the game.
Troubleshooting
'Waiting for participant...' but no connection
'Waiting for participant...' but no connection
- Ensure both the frontend and backend are running.
- Check that the room ID matches in both
src/config.jsandagent-react.py. - Verify your Zero Runtime token is valid.
Audio not working
Audio not working
- Check browser permissions for microphone access.
- Ensure your Google API key has Gemini Live API access enabled.
Agent not responding
Agent not responding
- Verify your Google API key is correctly set in the environment.
- Check that the Gemini Live API is enabled in your Google Cloud Console.
React build issues
React build issues
- Ensure your Node.js version is compatible.
- Clear the npm cache:
npm cache clean --force. - Delete
node_modulesand reinstall:rm -rf node_modules && npm install.
Next Steps
Quickstart Example
Complete working example with source code.
Build Your First Voice Agent
Learn the Cascade and Realtime pipelines in depth.