Genie 4 (genie-4) streams a playable 720p world at 24 fps for roughly $0.10 per second, and the one mistake that costs real money is closing a tab instead of calling complete().[2] Google made it available to developers on November 19, 2026 through the Interactions API and Google AI Studio.[1] It needs a paid-tier key, a session tops out at 120 seconds, and Tier 1 allows 2 concurrent sessions and 50 requests per day.[2][4] Below: the four-step setup, the cost arithmetic, a limits table, a three-model decision table, and the billing leak.
What Genie 4 is, and what it is not
Genie 4 generates a continuous, interactive 16:9 world at 24 fps with synchronized 48 kHz stereo audio. Unlike offline clip generation with Gemini Omni 1.2 Flash, it renders frames on the fly in response to live keyboard movement and natural-language events you send mid-stream.[2] You start from a text prompt, a reference image, or both.[1] Every output carries imperceptible SynthID watermarking.[1]
It is a world model with a keyboard, not a chat model. No microphone input, no webcam, no function calling, no Google Search grounding, no structured outputs.[2] Plan the product around that before you plan the code.
Setup that works: four steps
Google documents one lifecycle on v1beta. Install the latest google-genai (Python) or @google/genai (JavaScript and TypeScript) SDK first.[2]
Create the interaction on your server with
interactions.createandmodel: 'genie-4'. For browser clients, mint a single-session ephemeral token withinteractions.authTokens.createso your long-lived key never leaves the backend.Connect a live session with
interactions.connectover WebRTC (browsers) or WebSocket (Python, Node.js or browsers).Send exactly one
world_setupevent, thenuser_actionmovement events orinputtext events.Call
await session.complete()when finished, so server-side generation and billing stop.[2]
Step 1: the backend endpoint
This is Google's Node.js example. It returns only the interaction ID and the ephemeral token to the browser.[2]
import { GoogleGenAI } from '@google/genai';
const serverAi = new GoogleGenAI({
apiKey: process.env.GEMINI_API_KEY,
apiVersion: 'v1beta',
});
export async function createWorldSession() {
const interaction = await serverAi.interactions.create({
model: 'genie-4',
api_version: 'v1beta',
});
const { auth_token } = await serverAi.interactions.authTokens.create(
interaction.id,
{ api_version: 'v1beta' }
);
// Return ONLY { interactionId, authToken } to the browser
return { interactionId: interaction.id, authToken: auth_token };
}
The token matters for another reason. Standard browser WebSocket APIs cannot attach custom x-goog-api-key headers, so passing a raw AIza... key to { transport: 'websocket' } in a browser throws a usage error by design.[2]
Steps 2 and 3: connect, seed, steer
The browser client below is condensed from the quickstart. It connects over WebRTC, seeds the world, forwards key presses, and returns a stop function that calls complete().[2]
async function startWorld(interactionId, authToken, videoElement) {
const clientAi = new GoogleGenAI({ apiKey: authToken, apiVersion: 'v1beta' });
const session = await clientAi.interactions.connect(
interactionId,
{ transport: 'webrtc', api_version: 'v1beta' },
{ timeout_ms: 30000 }
);
// Attach
session.transport.setVideoElement(videoElement);
// Consume server lifecycle and error events in the background
(async () => {
for await (const event of session.receive()) {
if (event.event_type === 'error') {
console.error('Genie 4 stream error:', event.error);
}
}
})();
// Seed the world (initial generation takes ~5-9 seconds before frame 1)
await session.send({
event_type: 'world_setup',
world_prompt: { text: WORLD_PROMPT },
});
window.addEventListener('keydown', (e) => {
if (e.repeat) return;
if (NATIVE_KEY_MAP[e.code]) {
session.send({
event_type: 'user_action',
action: 'key_down',
input: NATIVE_KEY_MAP[e.code],
});
}
});
return {
stop: async () => {
await session.complete();
},
};
}
WORLD_PROMPT and NATIVE_KEY_MAP are defined in Google's full quickstart, where the map pairs KeyW with key_w, the arrow keys with arrow_up and friends. Mid-session text goes in as an input event, and passing a plain string to send() wraps it for you.[2] A text-only seed looks like this:
{
"event_type": "world_setup",
"world_prompt": {
"text": "First-person POV standing in front of an espresso machine. An empty ceramic mug rests on the drip tray beneath the spout. A glowing \"brew\" button is visible on the front panel."
}
}
If you add a starting image, reference_image is a top-level field on the world_setup event, a sibling of world_prompt, not nested inside it.[2]
What the first run feels like
Expect 5 to 9 seconds before frame 1. Arrow keys and WASD take effect in about 0.2 to 0.5 seconds, while text steering takes about 1 to 2 seconds because text goes through world planning.[2] Google's advice for text: sample points fall at step boundaries of 4 frames, so send a one-off action prompt 10 times at 150 ms intervals (about 1.5 seconds), with roughly a 2 second client cooldown before a conflicting prompt.[2]
Pick a transport
| Question | WebRTC | WebSocket |
|---|
| Best for | Interactive browser apps and games | Python, Node.js backends, frame capture, custom pipelines |
| Media delivery | RTP video and Opus audio rendered by a video element | JSON step.delta events with base64 JPEG frames and 48 kHz Int16 stereo PCM |
| Overhead | Lowest latency, UDP with a browser jitter buffer | About 33% base64 expansion, TCP head-of-line blocking under loss |
| Control payload cap | 64 KB SCTP limit, so keep world_setup JPEG seeds under 48 KB | Larger JSON payloads, no SCTP fragmentation limit |
The 48 KB figure exists because base64 adds about 33%: a seed that big lands near the 65,536-byte message ceiling. Resize to 1280x720 or 640x360, compress as JPEG, or switch to WebSocket for a lossless PNG seed.[2]
Cost math, recomputed
Google bills 240 video output tokens per frame, which is 5,760 tokens per second at 24 fps. Video output with audio is $17.50 per 1M tokens. Input is $1.50 per 1M (text or reference image) and text output is $9.00 per 1M.[2][3] Genie 4 has no free tier, no Batch API, no Flex inference and no Priority inference, and no context caching price is listed.[3]
The arithmetic: 24 frames x 240 tokens = 5,760 tokens per second. 5,760 / 1,000,000 x $17.50 = $0.1008 per second, which is the documented "about $0.10".[2] A minute is $6.048. Input tokens (a short prompt plus a JPEG seed) are small next to that, so video output is effectively the whole bill.
| Session length | Video tokens | Cost at $17.50 / 1M |
|---|
| 5-9 s startup, before frame 1 | Not stated on the pricing page | Unconfirmed |
| 30 s | 172,800 | $3.024 |
| 60 s (start of the 60-90 s stability decline) | 345,600 | $6.048 |
| 90 s | 518,400 | $9.072 |
| 120 s (hard cap) | 691,200 | $12.096 |
Now scale it by the account limits. Concurrent sessions and requests per day are Tier 1: 2 and 50, Tier 2: 5 and 250, Tier 3: 10 and 1,000.[4] If every session create counts as one daily request (the page does not spell this out) and every session runs to the 120 second cap, the daily ceiling is:
| Tier | Concurrent sessions | Burn rate at full concurrency | Worst-case daily spend (RPD x $12.096) |
|---|
| Tier 1 | 2 | 2 x $0.1008 = $0.2016 per second ($12.10 per minute) | 50 x $12.096 = $604.80, which is 6,000 s or 100 minutes of world |
| Tier 2 | 5 | $0.504 per second ($30.24 per minute) | 250 x $12.096 = $3,024.00 |
| Tier 3 | 10 | $1.008 per second ($60.48 per minute) | 1,000 x $12.096 = $12,096.00 |
Two useful inversions. A $100 daily budget buys 100 / 0.1008 = 992 seconds, about 16.5 minutes of world, or 8 full-length 120 second sessions. And because control messages do not consume separate RPM or RPD quota, the documented per-frame token rate (not a per-message charge) points to billing that follows seconds of generation, so a heavy keyboard user should cost about the same as an idle one. That second half is our inference from the pricing footnote, not a stated guarantee.[4][3] To price your own mix of models next to this, the AI model cost calculator runs the token math in your browser.
What breaks: limits table
| Limit | What the docs say | Design response |
|---|
| Session length | Visual stability degrades past 60-90 seconds, hard cap 120 seconds[2] | Design 60 second rounds; cost per round is $6.048 |
| Object permanence | Looking away for 8+ seconds or turning 360 degrees can shift or reset landmarks, doors and buttons; it is a rolling horizon, not a persistent 3D scene[2] | Keep interactions in front of the camera |
| Output format | 1280x720, 16:9, 24 fps; no 9:16, no configurable frame rate[2] | Crop or letterbox on the client |
| Inputs | Text, one 16:9 startup image, keyboard and camera events; no live audio or video[2] | Use another model for voice or webcam |
| Resumption | No session resumption[2] | A dropped connection means a new session and a new setup wait |
| Safety filters | Identifiable real people, public figures or brand IP can block startup or end a live stream[2] | Handle a mid-stream termination in your receive() loop |
| Readable text | Signs, gauges and clocks deform; counts drift across pans[2] | Do not build puzzles on exact text or counts |
| Regions | Serves from the United States, Western Europe and Japan; under 150 ms round trip in North America, Western and Central Europe and East Asia[2] | Test WebRTC latency from your target region before shipping reflex-heavy controls |
| Camera cuts | Hard cuts such as "cut to aerial view" destabilize spatial continuity[2] | Describe continuous changes in the current view |
One implementation detail that bites in WebSocket mode: only one active receive() iterator is permitted per connection, and Google's decode example discards any frame whose counter is lower than the latest rendered frame so slow decodes never overwrite newer ones.[2] If your relay retries on rate limits, the exponential backoff calculator shows what the wait schedule looks like before you hard-code it.
Genie 4 vs Gemini Omni 1.2 Flash vs Gemini 3.8 Live
Google's own model-selection table splits the three by job.[2] The prices for the other two models were not confirmed from the pricing page for this post, so the table compares fit, not cost.
| Need | Genie 4 (genie-4) |
Gemini Omni 1.2 Flash | Gemini 3.8 Live |
|---|
| Best for | Steerable worlds, playable prototypes, spatial exploration | Offline clips, editing, extension | Real-time voice agents |
| API surface | Interactions API, interactions.connect over WebRTC or WebSocket | Interactions API, interactions.create | Live API, live.connect |
| Output | Live 24 fps stream, 720p | 3s-15s clips, extension up to 30s, 1080p and 4K upsampling, up to 6 reference images | Bidirectional microphone and camera understanding |
| Tool calling and grounding | None | Not listed in the selection table | Tool calling and Google Search grounding |
| Pick it when | The user holds the controls while frames render | You want a finished clip you can review before delivery | The user talks and the model answers or acts |
The deciding question is who is in the loop. If a person steers during generation, only Genie 4 fits. If you review the output before anyone sees it, Omni's clip model is the safer shape, because a 120 second cap and a rolling horizon are poor foundations for anything you need to be repeatable. For agent behavior, the Live row is the only one with tool calling.[2] For the wider Gemini picture, see the Gemini Omni developer guide, and for pricing and breaking changes on the model line, the Gemini 4 Neon migration guide.
The billing leak: detach vs complete
This is the part to put in a code review checklist. Google's note is blunt: exiting a local block or closing a browser tab detaches the transport without immediately stopping server generation, and you must call complete() to stop billing.[2]
| Call | What it does | Stops billing? |
|---|
| await session.complete() | Sends interaction.complete, stops server-side generation, emits a terminal interaction.completed event | Yes |
| await session.cancel() | Sends interaction.cancel, aborts server-side generation immediately | Yes, per the docs' "always call complete() or cancel()" |
| session.detach() or leaving Python's async with | Sends interaction.disconnect, closes the local socket | No |
Because there is no resumption, a detached session cannot be picked up again either, so any frames generated after the detach are frames nobody can watch. The docs do not say how long an orphaned session keeps generating. If the 120 second hard cap bounds it, an abandoned session that should have cost $2.016 for 20 seconds can cost up to $12.096, a $10.08 leak each. That is an inference from the two documented numbers, not a documented guarantee, so do not rely on it as a safety net.
A defensive pattern, using only the documented methods, is to funnel every exit through one function. The browser side should also hit your backend on pagehide, since a closed tab cannot reliably run an async complete().
// Every exit path calls this. detach() alone never stops billing.
async function endWorld(session) {
try {
await session.complete();
} catch (err) {
await session.cancel();
}
}
That block is a wrapper pattern around the two documented calls, not a Google sample. Whether a backend can call complete() on an interaction it did not connect is not documented, so test that path against a throwaway session before trusting a tab-close handler.
Rollout checklist
Confirm the key is paid tier. Free is not supported.[4]
Mint ephemeral tokens server-side. Never ship the long-lived key.
Resize seed images to JPEG under 48 KB for WebRTC.
Wrap every exit path in
complete().Set a client timer at 60 to 90 seconds, well under the 120 second cap.
Budget with $0.1008 per second times your planned session length times your tier's daily request limit.
Measure latency from your user regions, not from your laptop.
Sources
Genie 4 is now available on the Gemini API, Google blog, November 19, 2026 (accessed 2026-11-22)
Interactive world generation with Genie 4, Gemini API docs, Google AI Studio (accessed 2026-11-22)
Gemini Developer API pricing, Genie 4 section, Google AI Studio (accessed 2026-11-22)
4. Rate limits, Genie 4 rate limits section, Google AI Studio (accessed 2026-11-22)
Originally published at wowhow.cloud
Top comments (0)