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

# Installation

> Install the Reactor Java SDK for desktop and server JVM applications

The Java SDK connects JVM applications to Reactor models. These pages describe
`inc.reactor:reactor-sdk:1.0.0`. Use the
[published Javadoc](https://javadoc.io/doc/inc.reactor/reactor-sdk/1.0.0/inc.reactor.sdk/inc/reactor/sdk/package-summary.html)
for the complete API.

## Requirements

Use **JDK 22 or later**. Java 21 and earlier and Android are not supported by this SDK.

| Platform | Requirements                                      |
| -------- | ------------------------------------------------- |
| Linux    | x86\_64 or aarch64, glibc 2.34+                   |
| macOS    | Apple Silicon on macOS 11+, or Intel on macOS 13+ |
| Windows  | x86\_64                                           |

## Add the dependency

<CodeGroup>
  ```xml Maven theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
  <dependency>
    <groupId>inc.reactor</groupId>
    <artifactId>reactor-sdk</artifactId>
    <version>1.0.0</version>
  </dependency>
  ```

  ```kotlin Gradle (Kotlin DSL) theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
  repositories {
      mavenCentral()
  }

  dependencies {
      implementation("inc.reactor:reactor-sdk:1.0.0")
  }
  ```
</CodeGroup>

The dependency includes the native libraries for all supported platforms. No separate download or
compiler toolchain is needed.

## Enable native access

Add the appropriate option to the JVM that runs your application:

<CodeGroup>
  ```bash Classpath application theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
  java --enable-native-access=ALL-UNNAMED -cp "your-classpath" YourMainClass
  ```

  ```bash Modular application theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
  java --enable-native-access=inc.reactor.sdk --module-path "your-module-path" --module your.app/your.MainClass
  ```
</CodeGroup>

A modular application also declares `requires inc.reactor.sdk;` in its `module-info.java`. For
Gradle's `application` plugin, set
`applicationDefaultJvmArgs = listOf("--enable-native-access=ALL-UNNAMED")` inside the `application`
block for a classpath application.

## Connect

Have your backend issue a short-lived, scoped JWT and provide it to your application. This example
reads it from `REACTOR_JWT`; see [Authentication](/authentication) for token issuance.

```java theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
import inc.reactor.sdk.JsonValue;
import inc.reactor.sdk.Reactor;
import inc.reactor.sdk.ReactorOptions;

public class Connect {
    public static void main(String[] args) {
        String jwt = System.getenv("REACTOR_JWT");
        if (jwt == null || jwt.isBlank()) {
            throw new IllegalStateException("Set REACTOR_JWT to a scoped session token");
        }
        var options = ReactorOptions.builder("https://api.reactor.inc", "reactor/helios")
                .jwt(jwt)
                .build();
        try (Reactor reactor = Reactor.open(options)) {
            try {
                reactor.connect().join();
                reactor.sendCommand("set_prompt", JsonValue.object()
                        .put("prompt", "a mountain landscape")
                        .build()).join();
            } finally {
                reactor.disconnect().join();
            }
        }
    }
}
```

`join()` blocks the calling thread. Use future composition in a UI application, and keep blocking
calls off the UI thread. `disconnect()` ends a session the client created; try-with-resources
releases the client even if an operation fails.

<Warning>
  Never bundle a Reactor API key in a desktop application. Keep it on your backend and give the
  application a scoped JWT.
</Warning>

## Optional modules

Add these separately when needed, using the same `1.0.0` version:

| Artifact in the `inc.reactor` group | Purpose                                               |
| ----------------------------------- | ----------------------------------------------------- |
| `reactor-sdk-audio`                 | Microphone and speaker helpers                        |
| `reactor-sdk-jackson`               | Adapters between `JsonValue` and Jackson's `JsonNode` |
| `reactor-sdk-kotlin`                | Kotlin suspend functions and flows                    |

The base SDK does not open a microphone or speaker automatically.

<CardGroup cols={2}>
  <Card title="Reactor" icon="plug" href="/sdk-reference/java/reactor">
    Connect, send commands, upload files, and download recordings.
  </Card>

  <Card title="Track" icon="video" href="/sdk-reference/java/track">
    Receive and send video and audio frames.
  </Card>

  <Card title="Types" icon="braces" href="/sdk-reference/java/types">
    JSON values, replies, events, and errors.
  </Card>
</CardGroup>
