Skip to main content
Zero Runtime lets you integrate AI agents with real-time voice interaction into your JavaScript application within minutes. In this quickstart, you’ll create an AI agent that joins a meeting room and interacts with users through voice using the Google Gemini Live API.

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

First, create an empty project using mkdir folder_name in your preferred location for the JavaScript frontend. Your final project structure should look like this:
root
index.html
config.js
index.js
agent-js.py
.env
You will be working on the following files:
  • index.html: Creates a basic UI for joining the meeting.
  • config.js: Stores the token and room ID for the JavaScript frontend.
  • index.js: Renders the meeting view and handles audio functionality.
  • agent-js.py: The Python AI agent backend using the Google Gemini Live API.
  • .env: Environment variables for the Python agent’s API keys.

Part 1: JavaScript Frontend

Install Zero Runtime

Import Zero Runtime using the <script> tag or install it using npm/yarn.

Design the user interface

Create an index.html file containing a join-screen and a grid-screen for audio-only interaction.
index.html

Configure environment and credentials

Create a meeting room using the Zero Runtime API:
Copy the roomId from the response and configure it in config.js:
config.js

Implement meeting logic

In index.js, retrieve DOM elements, declare variables, and add the core meeting functionality.
index.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.
New to uv? See the uv install guide.

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 (agent-js.py) that joins the same meeting room and interacts with users through voice.
agent-js.py

Part 3: Run the Application

Start the frontend

Once you have completed all the steps above, serve your frontend files:
Open http://localhost:8000 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

  1. Join the meeting from the frontend:
    • Click the Join Agent Meeting button in your browser.
    • Allow microphone permissions when prompted.
  2. Agent connection:
    • Once you join, the Python agent detects your participation.
    • You should see “Participant joined” in the terminal.
    • The AI agent greets you and initiates the game.
  3. Start playing:
    • The agent guides you through a number guessing game (1–100).
    • Use your microphone to interact with the AI host.

Troubleshooting

  • Ensure both the frontend and the agent are running.
  • Check that the ROOM_ID matches in config.js and agent-js.py.
  • Verify your Zero Runtime token is valid.
  • Check browser permissions for microphone access.
  • Ensure your Google API key has Gemini Live API access enabled.
  • Verify your GOOGLE_API_KEY is set in the .env file.
  • Check that the Gemini Live API is enabled in your Google Cloud Console.

Next Steps

Quickstart Example

Complete working example with source code.

Build Your First Voice Agent

Learn the Cascade and Realtime pipelines in depth.