> ## 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.

# Types

> Android SDK replies, connection state, step results, and errors

Public Android SDK types live in `inc.reactor.sdk.android`. These are the types used in the
examples; the [API reference](https://javadoc.io/doc/inc.reactor/reactor-sdk-android/1.1.0) provides
the complete reference.

## ConnectionStatus

Read `reactor.status.value` or collect `reactor.status`.

| Value | Meaning |
| - | - |
| `DISCONNECTED` | No active connection |
| `CONNECTING` | Establishing the session connection |
| `WAITING` | Connected, waiting for the model to be ready |
| `READY` | The model can answer commands and stream media |

## JSON arguments

Command arguments, uploads, step state, and token scopes are JSON objects passed as strings, such as
`"""{"prompt":"a red bicycle"}"""`. Build them with any JSON library your app already uses, such as
`org.json.JSONObject` or kotlinx.serialization, or with a raw string. Results the SDK parses, such
as a reply's `data` or `requestSchema()`, arrive as `Map<String, Any?>`, `List<Any?>`, `String`,
`Double`, `Boolean`, or `null`.

## CommandReply

`sendCommand` returns a `CommandReply`. `isEmpty` is `true` when the model acknowledged the command
without a reply message; that is a successful result.

| Property | Result |
| - | - |
| `type` | `String?`: model message type |
| `data` | `Any?`: the parsed message payload |

## FileRef

`uploadFile`, `uploadBytes`, `uploadContent`, and `uploadStream` return a `FileRef` with `uploadId`,
`name`, `mimeType`, and `size` in bytes. Pass it in a command's `uploads`, keyed by the parameter
name. See [Upload files](https://docs.reactor.inc/sdk-reference/android/reactor.md#upload-files).

## Clip and DownloadedClip

A `Clip` identifies media the platform is assembling. Its `playlistUrl` points to the HLS playlist;
`sessionId` identifies the session. It also exposes `kind`, `predictedReadyAtMs`, and the full
response as `raw`.

A clip request completing does not mean its media is ready. Use `downloadClip` to wait and save it.
The resulting `DownloadedClip` contains `path`, `bytes`, and `segments`. The progress callback
receives a `ClipProgress` with `done`, `total`, and `fraction`.

## StepResult

`step()` returns a `StepResult`, copied out of the native layer once. It holds no native memory and
can be kept.

| Property | Meaning |
| - | - |
| `step` | The step's number in the session |
| `tracks` | One `StepTrackOutput` per output track: `name`, `kind`, `rate`, and `frames` |
| `elapsed` | Seconds the step's generation took |
| `files` | `StepFile` entries (`name`, `contentType`, `size`) the model kept with the step |
| `error` | The model's failure message when the step ran but failed, otherwise `null` |

`track(name)` returns one track's output and throws if the step produced none; `findTrack(name)`
returns `null` instead. A `StepFrame` exposes `dtype`, `shape`, `encoding`, `metadata`, and
`captureTimeUs`. Read its bytes with `data()`, a read-only little-endian `ByteBuffer`, or copy them
with `toByteArray()`. Video comes back as `(height, width, 3)` `uint8` RGB, and audio as
`(channels, samples)` `int16`.

A step that ran but failed returns normally with `error` set. The bytes of `files` are not in the
result; fetch them over HTTP from the session's step results.

## Stats

`stats()` returns a `Stats` snapshot. `raw` holds every measurement the platform reported, as parsed
JSON. `number(key)` and `string(key)` read one measurement, or return `null` when it is absent.

## Errors

`ReactorException` is the base class for SDK failures. A failed call throws it, and the `errors`
flow delivers the same object. Each code has its own subclass, such as `UnauthorizedException`,
`RateLimitedException`, `DisconnectedException`, `RequestTimeoutException`, and
`StepRefusedException`. A code the SDK does not know arrives as `UnknownReactorException`, with the
code still available.

| Property | Meaning |
| - | - |
| `code` | Stable code to match; prefer it to parsing the message |
| `message` | Human-readable explanation |
| `recoverable` | Whether the same operation could succeed later |
| `status` | HTTP status, or `null` |
| `operation` | Failed operation, or `null` |
| `retryAfterMs` | Suggested backoff in milliseconds, or `null` |

```kotlin theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
try {
    reactor.sendCommand("set_prompt", """{"prompt":"a mountain landscape"}""")
} catch (error: ReactorException) {
    Log.w(TAG, "${error.code}: ${error.message}")
}
```

Check the error before retrying. For example, an expired token needs replacement, and a terminal
session needs a new session. `recoverable` comes from the code, so every Reactor SDK classifies the
same failure the same way.


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