Skip to main content
Public Android SDK types live in inc.reactor.sdk.android. These are the types used in the examples; the API reference provides the complete reference.

ConnectionStatus

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

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.

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.

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