> ## 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
> Reactor hosts multiple models, each with its own connect slug (modelName) and command/event schema. The catalog of every model — slug, typed SDK package, and links to its schema — is at /model-api-reference/overview. 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.

# H3 Reference Turbo Realtime tutorial

> Upload reference images, enqueue clips, and control synchronized audio/video playback.

Turn reference images into a sequence of clips with synchronized audio. This walkthrough starts
within a connected Reactor session and covers uploading, queuing, and playback. See the
[schema](/model-api-reference/h3-reference-to-video-turbo-realtime/schema) for the full command
reference.

## Upload and enqueue

1. Subscribe to `main_video` and `main_audio`. Read `state_update` for defaults, queue capacities,
   playback state, and `valid_commands`. Read `queue_update` for the full queues.
2. If you need a different canvas, call `set_canvas` before adding clips, while both queues and
   playback are empty.
3. Upload one to nine JPEG, PNG, or WebP images through the
   [file upload flow](/concepts/file-uploads).
4. Call `enqueue` with a nonempty `prompt` and either one `reference_image` or an ordered
   `reference_images` list. Refer to list entries as `Picture 1`, `Picture 2`, and so on.
5. Keep the `clip_id` from the `clip_queued` reply. The accepted clip also reports its seed,
   effective duration, and frame count. Use `metadata` for a client string you want echoed
   unchanged.

`clip_queued` acknowledges acceptance. Wait for `clip_generated`, or find the clip in
`queue_update.playout`, before requesting playback.

## Play and queue more

Call `play` with the ready clip's `clip_id`, or send `{}` to play the front of the playout queue.
`clip_started` reports when output starts. `clip_finished` reports when all video frames and
synchronized audio have been sent.

For automatic playback, call `set_autoplay` with `enabled: true`. Ready clips start whenever idle;
an empty queue waits for more clips. Each new `enqueue` supplies its own prompt and references.

Read `generation_capacity` and `playout_capacity` from `state_update`. A full generation queue
rejects new enqueues. A full playout queue pauses building until room is available. `valid_commands`
reflects current state, but command arguments still need validation and state can change before a
request arrives.

## Reorder or remove

Call `move` with a `clip_id` and zero-based `position` to reorder a clip within its current queue. A
position past the end appends. Moving a clip does not affect a running build.

Call `pop` with a queued `clip_id` to remove it. If its build is already running, the work finishes
but its result is discarded. To cut a playing clip, use `stop` instead. It cannot be resumed.

With autoplay enabled, `stop` skips to the next ready clip. To stop without starting the next one,
disable autoplay before calling `stop`.

## Handle failures and reset

`command_error` contains the refused command and reason without changing queues or defaults.
`clip_failed` contains the failed clip and reason; that clip is removed and the queue continues. To
try again, submit a new `enqueue` request with the desired prompt and references.

Call `reset` to drop both queues, cut playback, restore defaults, and clear the tracks. Its
`session_reset` reply reports `cleared_clips` and `was_playing`. In-flight results are discarded.
