> ## 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. Authenticate with reactor auth login, scaffold with reactor init, then run reactor deploy production from the workspace. Deploy builds remotely by default, creates a missing workspace project and its production environment, and waits for rollout. No local Docker or model.version bump is needed. Projects own images and weight sets; environments select the image, weights, GPU, instance count, and variables. Create staging explicitly with reactor environment create staging before deploying to it. Use reactor scale for capacity and reactor rollback for an earlier revision’s image and weights. See /deploy/platform/projects and /deploy/platform/deploy. Client SDK modelName remains account-qualified and selects production by default. Model code imports reactor_runtime; Python client code imports reactor_sdk. Local testing is optional; /deploy/development/local-testing covers reactor run, which needs Docker.
> 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.

# ABot World Halo schema reference

> ABot World Halo output tracks, session states, commands, refusals, and messages.

ABot World Halo produces video and audio in a Reactor session. Send commands with
`reactor.sendCommand()` or the typed SDK. This page describes the `reactor/abot-world-halo`
contract. See the [overview](https://docs.reactor.inc/model-api-reference/abot-world-halo/overview.md) for a quick start.

## Tracks

| Name | Type | Content |
| - | - | - |
| `main_video` | Video | The game world at 24 fps, 832 × 480. |
| `main_audio` | Audio | 48 kHz mono. |

There are no input tracks. Attach both outputs before `start`. Browsers can block sound until the
user interacts with the page, so give the user a control to start playback.

## Session states

| State | Meaning |
| - | - |
| `idle` | Nothing is generating. Set the inputs, then call `start`. |
| `running` | Video and audio stream, one chunk at a time, with no length limit. |
| `paused` | The session is on hold. Nothing is generated and the picture holds. |

`start` moves `idle` to `running`. `set_paused` moves between `running` and `paused`. `reset` ends
the session from any state and returns to `idle` with every input cleared. A session also ends when
the client leaves.

Commands come in two groups. `capabilities` in every `state_update` lists which group each command
belongs to:

* **Session setup** (`set_first_frame`, `set_references`, `set_seed`, `set_resolution`): set them in
  `idle`. They hold for the session and are refused with `locked_while_running` once it starts.
* **Live controls** (`set_move`, `set_look`, `set_action`, `set_prompt`, `set_paused`): send them in
  any state. During a session, each change applies from the next chunk. The chunk being generated
  never changes.

## Commands

| Command | Description | Valid in |
| - | - | - |
| `set_first_frame` | Set the picture the video starts on. Required before `start`. | `idle` |
| `set_references` | Set up to five pictures of the playable character. | `idle` |
| `set_prompt` | Set the scene description. During a session, change the scene. | Any state |
| `set_seed` | Set the seed. `-1` draws a new one at each `start`. | `idle` |
| `set_resolution` | Choose the output size. | `idle` |
| `set_move` | Walk the character forward, back, left, or right. | Any state |
| `set_look` | Turn the view left, right, up, or down. | Any state |
| `set_action` | Hold an action, a preset or your own text, until changed. | Any state |
| `set_paused` | Hold or resume the session. | Any state |
| `start` | Begin a session from the inputs. | `idle` |
| `reset` | End any session and clear every input. | Any state |

Commands return no reply. Watch `state_update` to see each change take effect.

When the model refuses a command, nothing changes and you get an error code. In JavaScript,
`sendCommand` resolves `undefined` and the client emits `error` with `operation: "sendCommand"`. In
Python, `send_command` raises `ReactorError`. See [Refusals](#refusals) for every code.

### `set_first_frame`

Set the picture the video starts on. The first frame of the session is this image.

An 832 × 480 image matches the output exactly. Any other size works too: at `start` the image is
scaled to cover the output and center-cropped. The frame stays set for later sessions until `reset`
or another `set_first_frame`.

| Parameter | Type | Required | Meaning |
| - | - | - | - |
| `image` | upload reference or null | No | A PNG or JPEG from `uploadFile()`. `null` removes the frame. |

```typescript JavaScript SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
const image = await reactor.uploadFile(file);
await reactor.sendCommand("set_first_frame", { image });
```

```typescript TypeScript typed SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
const image = await halo.uploadFile(file);
await halo.setFirstFrame({ image });
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
image = await reactor.upload_file("first_frame.png")
await reactor.send_command("set_first_frame", {"image": image})
```

### `set_references`

Set how the playable character looks, with up to five pictures of it. The video does not start on
these pictures. The model keeps the character's look to them for the whole session. The call
replaces the whole list, and `[]` removes every reference.

| Parameter | Type | Required | Meaning |
| - | - | - | - |
| `items` | upload reference array | Yes | 0 to 5 PNG or JPEG pictures, each at most 2:1. |

Order matters. Send the pictures in this order: head, left, right, front, back. With fewer than
five, keep that order. A picture is refused when its long side is more than
twice its short side. A refusal keeps the previous list. See the
[prompt guide](https://docs.reactor.inc/model-api-reference/abot-world-halo/prompt-guide.md#character-pictures) for how to
prepare them.

```typescript JavaScript SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
const items = await Promise.all([head, left, right, front, back].map((f) => reactor.uploadFile(f)));
await reactor.sendCommand("set_references", { items });
```

```typescript TypeScript typed SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
const items = await Promise.all([head, left, right, front, back].map((f) => halo.uploadFile(f)));
await halo.setReferences({ items });
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
names = ["head.png", "left.png", "right.png", "front.png", "back.png"]
items = [await reactor.upload_file(name) for name in names]
await reactor.send_command("set_references", {"items": items})
```

### `set_prompt`

Set the scene description in plain English. Leading and trailing whitespace is removed. An empty
string is allowed.

| Parameter | Type | Required | Meaning |
| - | - | - | - |
| `prompt` | string | Yes | The scene, up to 1,024 tokens. |

In `idle`, the prompt sets the scene for the next session. `start` needs one.

During a session, a new prompt changes the scene from the next chunk, or from the first chunk after
the new text is processed. Video already generated does not change. Each `chunk_complete` reports
the scene it used in `scene`, so you can see when your change takes effect.

A live prompt has a length limit. Once the first chunk is out, `applied.scene_max_tokens` in
`state_update` gives that limit in tokens. Until then, a live `set_prompt` is refused with
`not_ready`.

```typescript JavaScript SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.sendCommand("set_prompt", {
  prompt: "The courtyard at night under heavy snow, lanterns glowing on the walls.",
});
```

```typescript TypeScript typed SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await halo.setPrompt({
  prompt: "The courtyard at night under heavy snow, lanterns glowing on the walls.",
});
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.send_command("set_prompt", {
    "prompt": "The courtyard at night under heavy snow, lanterns glowing on the walls.",
})
```

### `set_seed`

Set the seed for the session's randomness. The same inputs, seed, and controls give the same video.

| Parameter | Type | Required | Meaning |
| - | - | - | - |
| `seed` | integer | Yes | `-1` for random (the default), or 0 to 2147483647. |

With `-1`, each `start` picks a new seed. To see the seed in use, read `applied.seed` in
`state_update` or `seed` in `generation_started`.

```typescript JavaScript SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.sendCommand("set_seed", { seed: 42 });
```

```typescript TypeScript typed SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await halo.setSeed({ seed: 42 });
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.send_command("set_seed", {"seed": 42})
```

### `set_resolution`

Choose the output size by name. `480p` (832 × 480) is the only size available.

| Parameter | Type | Required | Meaning |
| - | - | - | - |
| `name` | string | Yes | `480p`, the default. |

`capabilities.set_resolution.values` lists the sizes a session can serve. Any other name is refused
with `unsupported_value`.

```typescript JavaScript SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.sendCommand("set_resolution", { name: "480p" });
```

```typescript TypeScript typed SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await halo.setResolution({ name: "480p" });
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.send_command("set_resolution", {"name": "480p"})
```

### `set_move`

Walk the character relative to where it faces. Each axis is one held key: send the new value when a
key is pressed or released. The value holds until changed, and the pace is the model's own.

| Parameter | Type | Required | Meaning |
| - | - | - | - |
| `forward` | integer | Yes | `1` forward (W), `-1` back (S), `0` neither. |
| `right` | integer | Yes | `1` right (D), `-1` left (A), `0` neither. |

Any other value, including a fraction, is refused with `unsupported_value`. Movement sent in `idle`
applies to the first chunk. Movement sent while paused applies to the first chunk after resuming.

```typescript JavaScript SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.sendCommand("set_move", { forward: 1, right: -1 }); // W + A
await reactor.sendCommand("set_move", { forward: 0, right: 0 }); // Stop
```

```typescript TypeScript typed SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await halo.setMove({ forward: 1, right: -1 }); // W + A
await halo.setMove({ forward: 0, right: 0 }); // Stop
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.send_command("set_move", {"forward": 1, "right": -1})
await reactor.send_command("set_move", {"forward": 0, "right": 0})
```

### `set_look`

Turn the view. It works like `set_move`: one held key per direction, held until changed, and the
turn rate is the model's own.

| Parameter | Type | Required | Meaning |
| - | - | - | - |
| `yaw` | integer | Yes | `1` turn right (L), `-1` turn left (J), `0` neither. |
| `pitch` | integer | Yes | `1` look up (I), `-1` look down (K), `0` neither. |

```typescript JavaScript SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.sendCommand("set_look", { yaw: 1, pitch: 0 });
```

```typescript TypeScript typed SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await halo.setLook({ yaw: 1, pitch: 0 });
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.send_command("set_look", {"yaw": 1, "pitch": 0})
```

### `set_action`

Hold an action: what the character does beyond walking and turning. Actions work like keys. Send
the action when it starts and `none` when it ends. The action held when a chunk starts is the one
that chunk runs with, so a press lasts at least one chunk.

| Parameter | Type | Required | Meaning |
| - | - | - | - |
| `name` | string | Yes | `none`, a preset below, or `custom`. |
| `text` | string | No | Only with `custom`: the action in plain English, up to 512 tokens. Empty otherwise. |

| Name | What the character does |
| - | - |
| `none` | No action. Walking and turning continue. |
| `sprint` | Speeds up into a run in the direction of movement. |
| `shield` | Raises a glowing violet-blue spherical shield. |
| `jump` | Jumps and lands while moving. |
| `energy_projectile` | Fires a white-blue energy pulse from a wand. |
| `crouch` | Crouches and keeps moving with bent knees. |
| `repeated_casting` | Casts a quick series of red-orange bolts. |
| `custom` | Your own description in `text`. |

The presets switch at once. A `custom` text is prepared the first time a session uses it, so that
chunk takes longer. `capabilities.set_action.presets` carries each preset's full text. A preset with
`text`, or `custom` without it, is refused with `unsupported_value`.

```typescript JavaScript SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.sendCommand("set_action", { name: "sprint" });
await reactor.sendCommand("set_action", {
  name: "custom",
  text: "The character swings a glowing sword in a wide arc.",
});
await reactor.sendCommand("set_action", { name: "none" });
```

```typescript TypeScript typed SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await halo.setAction({ name: "sprint" });
await halo.setAction({ name: "custom", text: "The character swings a glowing sword in a wide arc." });
await halo.setAction({ name: "none" });
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.send_command("set_action", {"name": "sprint"})
await reactor.send_command("set_action", {
    "name": "custom",
    "text": "The character swings a glowing sword in a wide arc.",
})
await reactor.send_command("set_action", {"name": "none"})
```

### `set_paused`

Hold the session. While `paused` is true, no video is generated, the picture stays on the last
frame, and every input is kept. Set it before `start` to start held.

| Parameter | Type | Required | Meaning |
| - | - | - | - |
| `paused` | boolean | Yes | `true` to hold, `false` to resume. |

The next `state_update` reports the change.

```typescript JavaScript SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.sendCommand("set_paused", { paused: true });
```

```typescript TypeScript typed SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await halo.setPaused({ paused: true });
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.send_command("set_paused", {"paused": True})
```

### `start`

Begin a session from the first frame, references, prompt, seed, and resolution. Takes no
parameters. A `state_update` with `running` follows at once. The session is built at the next step,
so the first chunk takes longer. Then `generation_started` arrives and video and audio stream, with
one `chunk_complete` per chunk.

A session that cannot be built is reported after the call succeeded: a `state_update` back in
`idle` carries `error` with `code: "start_failed"`. Every input is kept, so you can fix it and call
`start` again.

```typescript JavaScript SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.sendCommand("start", {});
```

```typescript TypeScript typed SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await halo.start();
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.send_command("start", {})
```

### `reset`

End any session and clear every input to its starting value: no first frame, no references, no
prompt, seed `-1`, `480p`, no movement, no action, and not paused. Takes no parameters. The
connection stays open, in `idle`. When a session was generating, `generation_complete` with
`reason: "reset"` comes first, then `state_update`.

```typescript JavaScript SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.sendCommand("reset", {});
```

```typescript TypeScript typed SDK theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await halo.reset();
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await reactor.send_command("reset", {})
```

A session that ends with `reason: "error"` keeps its inputs, so `start` can run again. With seed
`-1` it draws a new seed.

## Refusals

| Code | Command | Meaning |
| - | - | - |
| `locked_while_running` | Session setup commands | A session is running or paused. Call `reset` first. |
| `already_running` | `start` | A session is running or paused. |
| `missing_first_frame` | `start` | No first frame was set. |
| `missing_prompt` | `start` | No prompt was set. |
| `unsupported_media` | `set_first_frame`, `set_references` | An upload is not an image. |
| `undecodable_image` | `set_first_frame`, `set_references` | An image cannot be decoded. |
| `too_many_references` | `set_references` | More than five pictures. |
| `reference_too_elongated` | `set_references` | A picture's long side is more than twice its short side. |
| `unsupported_value` | `set_seed`, `set_resolution`, `set_move`, `set_look`, `set_action` | A value outside the accepted set. |
| `action_too_long` | `set_action` | A `custom` text over 512 tokens. |
| `prompt_too_long` | `set_prompt` | Over 1,024 tokens, or a live scene over `applied.scene_max_tokens`. |
| `not_ready` | `set_prompt` | A live scene sent before the session's first chunk. |

Schema validation can also report `invalid_command` before the model sees the call, for example
for a value of the wrong type.

## Messages

| Message | When | Meaning |
| - | - | - |
| `state_update` | On connect, after every accepted command, and on the chunk that applies a control change. | The whole observable state. |
| `generation_started` | With the first chunk of a session. | The seed and size the session runs with. |
| `chunk_complete` | Once per chunk, before its frames. | What the chunk ran with. |
| `generation_complete` | When the session ends. | Why it ended and how many chunks it made. |

Base SDK messages arrive as `{ type, data }`. Typed SDK handlers such as `onStateUpdate` receive
the fields directly.

### state\_update payload

| Field | Type | Meaning |
| - | - | - |
| `state` | string | `idle`, `running`, or `paused`. |
| `settings` | object | Each input as last sent. See below. |
| `applied` | object | What the session runs with. Empty in `idle`. See below. |
| `width` | integer | Width of `main_video` in pixels. |
| `height` | integer | Height of `main_video` in pixels. |
| `fps` | integer | Frames per second of `main_video` (24). |
| `chunks` | integer | Chunks generated in this session. 0 in `idle`. |
| `frames` | integer | Frames generated in this session. 0 in `idle`. |
| `total_frames` | null | Always null. A session has no length limit. |
| `capabilities` | object | Every command with its kind and the values it accepts. |
| `error` | object or null | Null, except when a started session could not be built. See [`start`](#start). |

`settings` holds `first_frame_set` (boolean), `references` (a count), `prompt` (text, or null
before `set_prompt`), `seed`, `resolution`, `move` (`forward`, `right`), `look` (`yaw`, `pitch`),
`action` (`name`, and `text` for `custom`), and `paused`.

`applied` holds `seed` (the seed in use, also when `-1` was sent), `resolution`, `move` and `look`
as applied to the last chunk, and `action` for the last chunk (`name` and `text`, or null before the
first chunk). It also holds `scene` for the last chunk (`text`, `live` when it was set during the
session, and `tokens`) and `scene_max_tokens`, the room for a live scene (null before the first
chunk).

### generation\_started payload

| Field | Type | Meaning |
| - | - | - |
| `seed` | integer | The seed the session runs with. |
| `resolution` | string | `480p`. |
| `width` | integer | Width of `main_video` in pixels. |
| `height` | integer | Height of `main_video` in pixels. |
| `total_frames` | null | Always null. |

### chunk\_complete payload

| Field | Type | Meaning |
| - | - | - |
| `index` | integer | The chunk's position in the session, from 0. |
| `frames` | integer | Frames the chunk adds, each with its own sound. |
| `frames_total` | integer | Frames generated so far, this chunk included. |
| `action` | string | The action held when the chunk started, or `none`. |
| `action_text` | string | The action text the chunk ran with, as the model reads it. |
| `scene` | string | The scene description the chunk ran with. |
| `scene_live` | boolean | True when `scene` was set with `set_prompt` during the session. |

### generation\_complete payload

| Field | Type | Meaning |
| - | - | - |
| `reason` | string | `reset`, `client_ended` (the session ended), or `error`. |
| `chunks` | integer | Chunks the session generated. |

## Complete example

The [tutorial](https://docs.reactor.inc/model-api-reference/abot-world-halo/tutorial.md) walks through a browser app that sets
the inputs, plays the world with keys, holds actions, and changes the scene live.


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