
Building Game NPCs on the Gemini Live API vs Using Neocortex
A Gemini Live NPC can talk for about ten minutes. Then the connection closes.
Google's Gemini Live API streams audio to a model and back over a stateful WebSocket, and for game developers it is tempting: point a microphone at it, give it a persona, and you have a talking NPC. The trouble starts at the edges, with session limits, a Unity path that is still in preview, and everything a game needs on top of a voice. Here is what building NPCs on it involves, and where Neocortex fits.
Session limits you have to design around
Google documents three limits that shape every Gemini Live integration. Players do not care about any of them, which is exactly why your code has to.
15-minute audio sessions
Without context window compression, audio-only sessions are limited to 15 minutes, and sessions with audio and video to 2 minutes. Compression uses a sliding window to extend a session indefinitely, at the cost of the model gradually losing the oldest parts of the conversation. For a companion who should remember the start of the quest, that is a design decision, not a setting.
10-minute connections
Separately, a connection lasts roughly 10 minutes. When it ends, the session ends too, unless you resume it. In a game, that means a reconnect in the middle of a conversation, and the player should never hear the seam.
Resumption handles
To survive a reconnect, you enable session resumption. The server sends handles, and you pass the latest one when reconnecting. Handles stay valid for 2 hours after a session ends. Add ephemeral tokens, which Google recommends for client apps, and you also need a backend that issues short-lived credentials to each player's client.
Unity support through Firebase AI Logic
Google's route into Unity is Firebase AI Logic. Its Live API support is in Preview: no SLA, no deprecation policy, and it "could change in backwards-incompatible ways". The Unity SDK has C# code samples, but its Live API quickstart for Unity is still marked coming soon.
The model list is narrower than the Gemini API's own. Through the Gemini Developer API, Firebase lists Gemini 3.1 Flash Live Preview and Gemini 2.5 native audio previews. Through Google's enterprise Agent Platform (formerly Vertex AI), it lists Gemini 2.5 Live models and no 3.x Live models. Gemini 3.8 Live, the newest Live model on the Gemini API, is not on either list.
So a Unity team chooses between a preview SDK with older models, or its own WebSocket client against the raw API.
What Gemini Live costs
Live models bill per token, with per-minute equivalents published for audio. On the paid tier, audio input is $3.00 per million tokens (about $0.005 per minute) and audio output is $12.00 per million tokens (about $0.018 per minute).
At those rates, sixty minutes of player speech plus sixty minutes of NPC speech cost about $1.38 in audio alone, before text tokens, thinking tokens or tool calls. Real conversations have pauses, so most cost less, but the bill still scales with how much your players enjoy talking.
There is a free tier. Google's pricing page notes that free tier content is used to improve its products, which matters if players say personal things to your characters.
Neocortex plans are monthly, with included credits. The free plan has 2 characters and 200 monthly credits for personal use, Starter is EUR 9 a month for personal and academic projects, and Pro at EUR 29 a month adds commercial use, group chat and 5 custom voices.
Gemini Live vs Neocortex
| DIY on Gemini Live | Neocortex | |
|---|---|---|
| Unity | Firebase AI Logic preview, limited model list | Unity SDK, Unity 6, six sample scenes |
| Other engines | Build your own client | Unreal Engine 5, Godot (beta), Web API |
| Sessions | 15-minute sessions, 10-minute connections, resumption handles | No session cap: each turn is a separate API call |
| Character design | Prompts in code | Visual node editor |
| Voices | Google's prebuilt voices | Voice cloning and voice design |
| Game actions | Wire up function calls | Actions with target IDs and scene objects built in |
| Multiple characters | Build it yourself | Up to six characters in one conversation (Pro and Team) |
| Local AI | No | Local models through Ollama in Unity for text chat prototypes |
Model API or character platform?
These are two different approaches, each with its own trade-offs.
Building on a model API gives you direct access to the newest models and full control over every request. You also inherit every limit above, and you write the engine client, the token backend, the reconnection logic, the character prompts and the game integration. When the model list or API changes, you update all of it.
Using a character platform gives you less control over the raw model and more of what a game needs. In Neocortex, personality, emotion, knowledge, intents and actions are nodes in a visual graph a designer can edit. Each reply comes back with an emotion tag per line and actions such as { "name": "OPEN_DOOR", "targetId": "door_02" }. Conversation Flows report checkpoint keywords (flowState) as the story moves. Microphone input works in Unity WebGL builds.
For most game teams, the second list is the one that ships. See our overview of realtime voice APIs for game NPCs for how the other voice APIs compare on the same points.
Next steps
- Create a free Neocortex account.
- Build one NPC in the editor and give it a cloned or designed voice.
- Talk to it in the browser until it sounds right; this never uses credits.
- Install the Unity SDK, open a sample scene, and hear the character answer inside your game, with no session plumbing to write.
Google details were last checked in October 2026.
Frequently Asked Questions
Does the Gemini Live API work in Unity?
Through Firebase AI Logic, whose Live API support is in Preview with no SLA, and whose Unity quickstart is still marked coming soon. Neocortex has a Unity SDK for Unity 6 with six sample scenes, plus Unreal Engine 5, Godot (beta) and a Web API.
How long can a Gemini Live session last?
Audio-only sessions stop at 15 minutes and connections at about 10 minutes, unless you add context window compression and session resumption. With Neocortex, each turn is a separate API call and the SDK handles it, so there is no session to time out with your character, so there is no resumption logic to write.
Is the Gemini Live API free?
There is a free tier, and Google's pricing page says free tier content is used to improve its products; paid audio output is billed per token. Neocortex has a free plan with 2 characters and 200 monthly credits for personal use, and editor testing never uses credits.
Which Gemini Live models can a Unity game use?
Firebase AI Logic lists Gemini 3.1 Flash Live Preview and Gemini 2.5 native audio models, not the newer Gemini 3.8 Live. Neocortex manages the model for you, so your characters do not depend on which preview your SDK supports.
Written by
Neocortex Team
Date
Oct 17, 2026
Updated
Oct 20, 2026
Read time
5 min






