> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reactor.inc/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To build and serve your own model, start at /deploy/development/quickstart and /deploy/development/overview. Deploying is the default path: reactor init scaffolds a workspace, reactor auth login authenticates, and reactor model deploy registers the model, publishes the release with the weights/ folder, and activates it on Reactor's GPUs, in one command from that workspace. Docker must be running, because the publish step builds the image locally. Bump model.version in reactor.yaml before redeploying a change, because a release that already has an image is reactivated as it is. Deployment access is granted per account, so contact team@reactor.inc if a deploy is refused. Every key in reactor.yaml is documented at /deploy/platform/reactor-yaml. Model code imports reactor_runtime; Python client code imports reactor_sdk. The runtime overview explains the model interface. Running the model on your own machine with reactor run is optional and needs a GPU you attach with --gpus; /deploy/development/local-testing covers that loop and pairs a complete brightness model with a Python client test in a separate brightness-test workspace.
> Reactor hosts multiple models, each with its own connect slug (modelName) and command/event schema. The video model catalog — slug, typed SDK package, and links to its schema — is at /model-api-reference/overview. Robotics policy documentation starts at /robotics/overview; The launch policies are Cosmos Nano DROID (/robotics/cosmos/nano-policy-droid/), DreamZero DROID (/robotics/dreamzero/droid/), and FLUX Action DROID (/robotics/flux-action/droid/), organized by model family and embodiment. Some models expose one slug per experience (e.g. HappyOyster); always take the slug from the model's own pages, never guess it.
> Fastest path to a working app: `npx create-reactor-app my-app --model=<slug>` scaffolds a complete app with secure auth wired up. Typed TypeScript SDKs are published as @reactor-models/<model>; Python uses the base reactor-sdk package.
> Auth: exchange an API key (rk_...) for a JWT via POST https://api.reactor.inc/tokens from your server. Never put the API key in client-side code.
> Append .md to any docs URL for clean Markdown. Search these docs via the MCP server at https://docs.reactor.inc/mcp.

# Genie 4

> Explore a world with video and sound, movement keys, and live instructions.

Genie 4 from Google DeepMind creates a world from a prompt, a reference image, or both. Walk through
it with movement keys, look around with the arrow keys, and hear the world as it runs in real time.
Use live instructions to change the scene or ask a character in it to speak. Each world lasts up to
60 seconds.

This reference has four pages: this overview, the [schema](https://docs.reactor.inc/model-api-reference/genie-4/schema.md), the
[prompt guide](https://docs.reactor.inc/model-api-reference/genie-4/prompt-guide.md), and a
[tutorial](https://docs.reactor.inc/model-api-reference/genie-4/tutorial.md) with a complete browser app.

Use `Genie4Model` from the typed SDK, `@reactor-models/genie-4`, to connect, start worlds, and
receive typed snapshots. The package also provides React hooks and components. See
[Typed Model SDKs](https://docs.reactor.inc/sdk-reference/typed-model-sdk.md).

## At a glance

| Spec | Value |
| - | - |
| **Model name** | `reactor/genie-4` |
| **Pricing** | |
| **Frame rate** | 24 fps |
| **Resolution** | 1280 × 720 |
| **Input** | Prompt, reference image, or both. |
| **Audio** | 48 kHz Mono |

## Key features

> [card] Explore Worlds
>
> Move with WASD and look around with the arrow keys.

> [card] Video and sound
>
> Receive the world through separate video and audio tracks.

> [card] Change the scene
>
> Send plain-language instructions while the world is live, including lines for a character to
> say.

## Quick start

Scaffold the example project with `create-reactor-app`. The
[tutorial](https://docs.reactor.inc/model-api-reference/genie-4/tutorial.md) shows how to build a small app from scratch.

> [tab] npm
>
> ```shell theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
> npx create-reactor-app my-genie-app --model=genie-4
> ```

> [tab] pnpm
>
> ```shell theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
> pnpm create reactor-app my-genie-app --model=genie-4
> ```

The [example app](https://github.com/reactor-team/create-reactor-app/tree/main/templates/genie-4)
uses the typed SDK, `@reactor-models/genie-4`. For your own browser code, install that package and
provide the [token resolver](https://docs.reactor.inc/model-api-reference/genie-4/tutorial.md#authentication). The media
controls let the user start playback if the browser blocks autoplay.

```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
import { Genie4Model, type Genie4SessionStateMessage } from "@reactor-models/genie-4";
import { fetchToken } from "./token";

const video = document.createElement("video");
video.autoplay = true;
video.playsInline = true;
video.muted = true;
video.controls = true;
const audio = document.createElement("audio");
audio.autoplay = true;
audio.controls = true;
const status = document.createElement("p");
document.body.append(video, audio, status);

const genie = new Genie4Model();
genie.on("error", console.error);
genie.onMainVideo((track) => {
  video.srcObject = new MediaStream([track]);
  void video.play().catch(() => console.info("Use the video controls to play."));
});
genie.onMainAudio((track) => {
  audio.srcObject = new MediaStream([track]);
  void audio.play().catch(() => console.info("Use the audio controls to play."));
});
function renderState(state: Genie4SessionStateMessage) {
  status.textContent =
    state.phase === "failed"
      ? (state.last_error?.reason ?? "World failed.")
      : `World: ${state.phase}`;
}
genie.onSessionState(renderState);
genie.on("statusChanged", (connection) => {
  if (connection === "ready") return;
  status.textContent = `Connection: ${connection}`;
  video.srcObject = null;
  audio.srcObject = null;
});

await genie.connect(fetchToken);
const initialState = await genie.getState();
if (!initialState) throw new Error("Could not read the world state.");
renderState(initialState);
await genie.startWorld({
  prompt: "First-person view walking through a mountain village at golden hour.",
});
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
import asyncio
import os
from reactor_sdk import Reactor, ReactorStatus

async def main():
    reactor = Reactor(
        model_name="reactor/genie-4",
        api_key=os.environ["REACTOR_API_KEY"],
    )
    ready = asyncio.Event()

    @reactor.on_status(ReactorStatus.READY)
    async def on_ready(status):
        ready.set()

    await reactor.connect()
    try:
        # Send commands only once the session is ready.
        await asyncio.wait_for(ready.wait(), timeout=30)
        await reactor.send_command("start_world", {
            "prompt": "First-person view in a mountain village at golden hour.",
        })
        # Keep the session open while the world runs.
        await asyncio.sleep(60)
        print(await reactor.send_command("end_world", {}))
    finally:
        await reactor.disconnect()

asyncio.run(main())
```

## How it works

1. Connect a Reactor session and attach both output tracks. Read the initial `getState()` reply.
2. Call `startWorld()` with a prompt, an uploaded image reference, or both.
3. Watch `state.phase` move from `starting` to `live`. A successful start call alone does not mean
   the world is live.
4. Send the complete set of held keys on each change. Use `instruct()` for changes to a live scene.
5. End the world with `endWorld()`, or let its time limit expire. Start a new world with its inputs
   again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.