> ## 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; X-WAM observations, actions, and client integration are under /robotics/xwam/; Cosmos3 Nano Policy DROID is under /robotics/cosmos/nano-policy-droid/. 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.

# XMAX X2.1 overview

> Edit a video stream with text, a reference image, and drag points.

XMAX X2.1 edits video as you stream it. Publish a webcam, a video clip, or a still image as video.
Use a prompt to describe the edit, a reference image to supply appearance, and drag points to guide
motion.

This reference has four pages: this overview, the [schema](https://docs.reactor.inc/model-api-reference/xmax-x2-1/schema.md),
the [prompt guide](https://docs.reactor.inc/model-api-reference/xmax-x2-1/prompt-guide.md), and the
[tutorial](https://docs.reactor.inc/model-api-reference/xmax-x2-1/tutorial.md).

The base [`Reactor`](https://docs.reactor.inc/sdk-reference/reactor-class) client connects with `reactor/xmax-x2-1` and
sends named commands. The typed SDK, `@reactor-models/xmax-x2-1`, provides the same commands as
named methods and React hooks. See [Typed Model SDKs](https://docs.reactor.inc/sdk-reference/typed-model-sdk.md).

## At a glance

| Spec | Value |
| - | - |
| **Model name** | `reactor/xmax-x2-1` |
| **Pricing** | |
| **Input** | Source video, a text prompt, an optional reference image, and optional drag points |
| **Output** | Edited video |
| **Drag points** | Up to eight |

Use the full model name when you open a session. The CLI and pricing catalog use the short slug
`xmax-x2-1`. See [Pricing & Billing](https://docs.reactor.inc/resources/billing.md).

## Key features

> **Edit a live source**
>
> Publish video on `source` and receive the edited video on `main_video`. Change the prompt during
> a run.

> **Supply a reference**
>
> Upload a character or object image for a swap or insertion. Replace it during a run to change
> the reference in the stream.

> **Guide motion**
>
> Send drag positions for each frame in a four-frame window. Use an empty prompt for motion
> without a text instruction.

## Quick start

The
[example template](https://github.com/reactor-team/create-reactor-app/tree/main/templates/xmax-x2-1)
is the planned destination for source selection and editing controls.

**npm**

```shell theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
npx create-reactor-app my-xmax-app --model=xmax-x2-1
```

**pnpm**

```shell theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
pnpm create reactor-app my-xmax-app --model=xmax-x2-1
```

This browser example uses the base SDK. Provide a `<video id="output" autoplay playsinline muted>`
element and a server token route as described in [Authentication](https://docs.reactor.inc/authentication.md).

```typescript theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
import { Reactor } from "@reactor-team/js-sdk";

const output = document.getElementById("output") as HTMLVideoElement;
const reactor = new Reactor({
  modelName: "reactor/xmax-x2-1",
  modelTracks: [
    { name: "source", kind: "video", direction: "sendonly" },
    { name: "main_video", kind: "video", direction: "recvonly" },
  ],
});

reactor.on("trackReceived", (name, _track, stream) => {
  if (name !== "main_video") return;
  output.srcObject = stream;
  void output.play().catch(console.error);
});
reactor.on("error", console.error);

const response = await fetch("/api/reactor/token", { cache: "no-store" });
if (!response.ok) throw new Error(`Token request failed: ${response.status}`);
const { jwt } = await response.json();
await reactor.connect(jwt);

const camera = await navigator.mediaDevices.getUserMedia({ video: true });
await reactor.publishTrack("source", camera.getVideoTracks()[0]);
await reactor.sendCommand("set_prompt", {
  prompt: "Replace the white ball in the hand with a small orange kitten.",
});
```

For named methods and React controls, use `XmaxX21Model` or `useXmaxX21` from the typed SDK.

## How it works

1. Connect to `reactor/xmax-x2-1`.
2. Publish a source video track.
3. Set a prompt. Generation starts when a prompt is set and source frames arrive. The empty string
   is valid.
4. Read the output dimensions from `generation_started` or `state_update`.
5. Change the prompt, reference image, or drag window as needed.
6. Call `reset` to stop generation and clear the prompt, reference image, and drag points.

> [!NOTE]
>
> There is no `start` command. A `null` prompt means no prompt was set. An empty string means
> generation can run without text guidance. Reset keeps the session's output dimensions.


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