Connect control and media
Create a Streaming World Session first, then use the returnedcontrol and media descriptors as opaque connection details. Connect the media descriptor with the Vivix realtime media client and connect the WSS control channel with control.url and control.client_secret. Do not infer or hardcode an underlying media transport.
- Read the Session
capabilitiesand expose only the controls supported by that Session. - Connect the opaque media descriptor and begin rendering the continuous output.
- Connect WSS. A new connection receives
session.ready; a reconnect receivessession.snapshotinstead. - Send client events with a stable, client-generated
event_idand wait for the corresponding server lifecycle event.
Control the world with Events
event.create guides the unpublished future of the running world. An Event is still prompt-shaped: describe the experience you want as one coherent, open-ended intent. Do not split speech and behavior into separate speaker turns, dialogue lines, actions, beats, scenes, or other orchestration objects.
Keep multi-character interaction natural. Name the relevant references, describe the dramatic or interactive direction, and let Vivix decide how many turns, pauses, reactions, and movements are needed.
event.create
Interpret Event lifecycle messages
There is no event.completed lifecycle message. An Event can influence a continuous world long after its first visible effect, so it has no reliable semantic completion boundary.
Redirect, hold, and resume
Redirect with a newer Event. Send another event.create when the user or application should change what happens next. The default steer handling preserves committed media and redirects the unpublished future at a safe boundary. Cancel only when supported. Checkcapabilities.event_cancel before sending event.cancel. Once an Event has been applied, its influence is part of media history; send a newer Event instead of trying to roll it back.
Hold without closing. Send session.hold to stop new world progression at a safe media boundary while preserving Session continuity and the last available visual output.
Resume the same world. Send session.resume and wait for media.state.updated. Creating a new Event while held also requests an implicit resume.
Redirecting, cancelling, or holding never retracts media that has already been committed, published, or buffered by a client.
Maintain application state from server events
- Reconnect. Use
session.snapshotas the new operational baseline. Events missed while disconnected are not replayed, and the snapshot is not an authoritative semantic description of the generated world. - Ordering. Process live events in
sequenceorder and use gaps as a connection-health signal, not as evidence about world semantics. - Captions. Append
caption.deltafragments by caption id, then replace the assembled text with the authoritativecaption.completedvalue. - Usage. Treat
usage.updatedas a cumulative application-level view of generated audio and video usage. - Media. Drive loading, running, held, stalled, and recovery UI from
media.state.updatedwithout depending on transport implementation details.
Recommended event flow
API Reference. This guide explains the control model. For complete schemas, see Sessions, Client events, and Server events.