Gemini Live API enables low-latency, real-time voice and vision interactions with Gemini. It processes continuous streams of audio, images, and text to deliver immediate, human-like spoken responses over a stateful, bidirectional WebSocket connection — a very different model from a one-shot generateContent call.
In this codelab you'll wire Gemini Live API into a Flutter app through Firebase AI Logic and the firebase_ai package — the official Firebase AI Logic plugin for Flutter, built and maintained by the Flutter team with community contributions. Rather than hand-writing every line, you'll also see how to brief an AI coding agent to generate the feature for you, then review and harden what it produces.
A Google Account with access to Google Cloud Console and Firebase.
The Flutter SDK installed and configured on your PATH.
(Optional) Google Cloud credit — new accounts get $300 in free credit, useful if you plan to use the Agent Platform Gemini API.
(Optional) An AI coding IDE/agent such as Antigravity for Step 8.
---
This codelab walks through ten steps, from an empty Flutter project to a reviewed, working Live Mode feature:
For local development, you can temporarily unenforce App Check so your API calls aren't blocked while you're still wiring things up:
In the Firebase Console, go to Security → App Check.
Select the APIs tab, then choose Firebase AI Logic.
Click Show Details → Setup, then choose Unenforce.
Select App tab, select the Web app, click Register
Select 3 vertical dots button on the Web App, select Manage Debug Token
Enter a fixed UUID token here, then save
---
Act as a senior Flutter developer with expertise in both Flutter and Firebase integration.
Your task is to add a new Live Mode screen into this project. Use package flutter_chat_ui to create the simple chat UI. Use package firebase_ai as the main AI package, select GoogleAI as our main AI option, and use LiveGenerativeModel to handle the chat.
The UI should have message input field for user to enter the text, the chat UI components to display messages from user and model. When the app launches, create a new LiveSession to start the chat. When user enter the chat in the message box then hit Send, send the real-time text to model immediately, then display the response from model as Model Message on the chat screen.
AppCheck is compulsory, use package firebase_app_check to activate AppCheck for this project.
Swap GoogleAI for agentPlatform in the prompt if you enabled the Agent Platform Gemini API instead, in Step 6.
---
Before you run what the agent generated, verify the key configurations, API mappings, and package selections it chose:
Model name — check the docs for the correct model name; at the time of writing, gemini-3.8-live is suggested.
AI Logic API selection:
Gemini Developer API → use FirebaseAI.googleAI()
Agent Platform Gemini API → use FirebaseAI.agentPlatform()
Audio input — to enable audio-to-audio chat, add voice input and voice output functionality and handle the audio streaming from server. Suggest to use record package for audio input.
Audio output — consider using flutter_soloud for streaming audio output.
Output modality — must always be set to audio.
Text output — include the output transcript in your config to receive text output alongside audio.
Sending content — always send with turnComplete: true.
App Check token - Set debugToken using the previous UUID Token
---
A quick troubleshooting checklist for the issues most teams hit first when wiring up Live API:
Wrong FirebaseAI API — make sure you're calling the API that's actually enabled in your Firebase project (see Step 9).
No text content output - Use text from outputTranscription, remember to set outputAudioTranscription in LiveGenerationConfig when initialise liveGenerativeModel.
Retrieve input transcript - When voice chat with model, you can request input transcipt by setting inputAudioTranscription in LiveGenerationConfig when initialise liveGenerativeModel.
Output modality - Audio output only, but it's up to you to use the audio or only use the text from outputTranscript
Voice echo (model replies to itself) — set your audio source and audio manager mode to communication mode.
Background noise — set the noise suppression config with noiseSuppress: true and autoGain: true.
Language selection — set your preferred language on connect, in BCP-47 format (e.g. vi-VN, ja-JP, en-US).
Voice selection — choose a voice from the Gemini Live API docs and update the voice name in SpeechConfig.
---
You've now walked through the full path from an empty Flutter project to a working Live Mode screen powered by Gemini Live API via Firebase AI Logic: setting up Firebase, wiring in firebase_ai, briefing an AI coding agent with a focused prompt, and reviewing its output against a concrete checklist before shipping.
From here, try extending the Live Mode screen with video input, or tune the SpeechConfig and noise-suppression settings for your target environment and language.