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.
You need a Zero Runtime account to generate a token. The agent reaches the Gemini Live API through the Zero Runtime Inference Gateway, so you don’t need a separate Google API key.
Generate a token from the Zero Runtime Dashboard.
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 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
ZERORUNTIME_AUTH_TOKEN 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.
Agent not responding
Agent not responding
- Verify your
ZERORUNTIME_AUTH_TOKENis set in the.envfile and is valid.
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.