Skip to main content
Zero Runtime lets you integrate AI agents with real-time voice interaction into your native Flutter application within minutes. In this quickstart, you’ll create an AI agent that joins a Flutter 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).
  • The Flutter toolchain 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
android
ios
lib
api_call.dart
join_screen.dart
main.dart
meeting_controls.dart
meeting_screen.dart
participant_tile.dart
macos
web
windows
agent-flutter.py
.env
You will be working on the following files:
  • join_screen.dart: Responsible for the user interface to join a meeting.
  • meeting_screen.dart: Displays the meeting interface and handles meeting logic.
  • api_call.dart: Handles API calls for creating meetings.
  • agent-flutter.py: The Python AI agent backend using the Google Gemini Live API.
  • .env: Environment variables for the Python agent’s API keys.

1. Flutter Frontend

Step 1: Create the Flutter app

Create a new Flutter app using the following command:
Install the RTC SDK using the following Flutter command. Make sure you are in your Flutter app directory before you run this command.

Step 2: Configure native platform permissions

Update /android/app/src/main/AndroidManifest.xml for the permissions used to implement the audio and video features.
android/app/src/main/AndroidManifest.xml
If necessary, in build.gradle you will need to increase the minSdkVersion of defaultConfig up to 23 (Flutter’s generator defaults it to 16).

Step 3: Configure environment and credentials

Create a meeting room using the Zero Runtime API:
Copy the roomId from the response and configure it in lib/join_screen.dart and lib/api_call.dart.
lib/api_call.dart
lib/join_screen.dart

Step 4: Design the user interface

Create the main MeetingScreen widget with audio-only interaction in lib/meeting_screen.dart:
lib/meeting_screen.dart
lib/participant_tile.dart
lib/meeting_controls.dart

2. Python AI Agent

Step 1: 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.

Step 2: Configure environment variables

Create a .env file in your project root to store your keys and token securely for the Python agent:
.env

Step 3: Create the AI agent backend

Create the Python AI agent (agent-flutter.py) that joins the same meeting room and interacts with users through voice.
agent-flutter.py

3. Run the Application

Step 1: Run the Flutter app

Once you have completed all the steps above, start your Flutter application:

Step 2: 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.

Step 3: Connect and interact

  1. Join the meeting from the Flutter app:
    • Tap the Join Meeting button.
    • 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 Flutter app and the agent are running.
  • Check that the room ID matches in both lib/join_screen.dart and agent-flutter.py.
  • Verify your Zero Runtime token is valid.
  • Check device 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.
  • Ensure your Flutter version is compatible.
  • Try cleaning the build: flutter clean.
  • Delete pubspec.lock and run flutter pub get.

Next Steps

Quickstart Example

Complete working example with source code.

Build Your First Voice Agent

Learn the Cascade and Realtime pipelines in depth.