Skip to main content

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.

What is a session?

When you connect to a model, Reactor creates a session on a GPU running that model. The session holds all the state for your interaction: the model’s current generation context, any prompts you have sent, and the media streams flowing between the model and your app. A session is independent of the network connection. If your connection drops, the session keeps running on the GPU. Reconnect and pick up where you left off without losing any model state.

Connection lifecycle

Every connection goes through four states:
Connection lifecycle: disconnected → connecting → waiting → ready
StateMeaning
disconnectedNo active connection
connectingNegotiating with Reactor to create a session
waitingSession created, waiting for a GPU to be assigned
readyConnected to the GPU. You can send commands and receive media
The waiting state is normal. Reactor has accepted your request and is assigning a GPU, which typically takes a few seconds. Once the status reaches ready, the WebRTC connection to the GPU is established and media starts flowing.

Disconnecting

When you disconnect, choose whether to keep the session alive.

Non-recoverable (default)

The session is terminated and all state is released. Use this when the user is done.

Recoverable

The session stays alive on the GPU for 30 seconds. Reconnect within that window and the model resumes exactly where it left off. Use this to survive brief network interruptions. After 30 seconds without a reconnection, the session is automatically terminated. Billing continues for the full reconnection window. For more information, see Rate Limits.
// Terminate the session
await reactor.disconnect();

// Keep the session alive
await reactor.disconnect(true);
await reactor.reconnect();
You are billed for the full duration of a session, from connection until termination. See Pricing & Billing for rates, recoverable-disconnect behavior, and tips for minimizing cost.

Session ID

Each session has a unique ID that persists across reconnections. You can access it once connected:
const sessionId = reactor.getSessionId();
Include the session ID in support requests or logs to help trace issues to a specific session.

Next steps

Commands & Messages

Send commands to the model and handle messages back.

Pricing & Billing

How session time translates to cost.