Skip to main content
Zero Runtime lets you integrate AI agents with real-time voice interaction into your native iOS app 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).
  • iOS 13.0+, Xcode 13.0+, and Swift 5.0+.
  • 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 final Xcode project structure should look like this:
zrt-agents-quickstart-ios
JoinScreenView.swift
MeetingView.swift
MeetingViewController.swift
RoomsStruct.swift
zrt_agents_quickstart_iosApp.swift
zrt-agents-quickstart-ios.xcodeproj
agent-ios.py
.env
You will be working on the following files:
  • JoinScreenView.swift: Join screen UI.
  • MeetingView.swift: Meeting interface with audio controls.
  • MeetingViewController.swift: Handles meeting logic and events.
  • agent-ios.py: The Python AI agent backend using the Google Gemini Live API.
  • .env: Environment variables for the Python agent’s API keys.

1. iOS Frontend

Step 1: Create the app and install the RTC SDK

Create a new iOS app in Xcode:
  1. Create a new Xcode project.
  2. Choose the App template.
  3. Add a Product Name and save the project.
Install the RTC SDK using Swift Package Manager:
  1. In Xcode, go to File > Add Packages...
  2. Enter the repository URL: https://github.com/videosdk-live/videosdk-rtc-ios-sdk.git
  3. Choose the latest version and click Add Package.
Add microphone and camera permissions to Info.plist:
Info.plist

Step 2: Create models and views

Create the Swift models and views for the meeting interface.
RoomsStruct.swift
JoinScreenView.swift
MeetingView.swift

Step 3: Implement meeting logic

Create the main meeting view controller to handle meeting events.
MeetingViewController.swift

Step 4: Configure the app entry point

Configure the main app entry point.
zrt_agents_quickstart_iosApp.swift

Step 5: Configure environment and credentials

Create a meeting room using the Zero Runtime API:
Copy the roomId from the response and set it as the meetingId in JoinScreenView.swift, and set your token in MeetingViewController.swift (YOUR_ZRT_AUTH_TOKEN).

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

3. Run the Application

Step 1: Run the iOS app

Build and run the app from Xcode on a simulator or physical device.

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. Run the iOS app on a simulator or device.
  2. Join the meeting and allow microphone permissions.
  3. When you join, the Python agent detects your participation and starts speaking.
  4. Talk to the agent in real time and play the number guessing game.

Troubleshooting

  • Ensure the same room_id is set in both the iOS app (JoinScreenView.swift) and the agent’s Room(room_id=...).
  • Verify microphone permissions in iOS Settings > Privacy & Security > Microphone.
  • For simulator issues, ensure you’re using a physical device for microphone testing.
  • Check that microphone permissions were granted when prompted.
  • Ensure your Google API key has Gemini Live API access enabled.
  • Confirm your Zero Runtime token is valid and the 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.