Introduction
The Real-time API provides WebRTC-based real-time video transformation capabilities. It enables low-latency, interactive video generation by streaming video input and receiving transformed output in real-time.Supported Models
The Real-time API supports the following models:- mirage - Real-time video restyling model
- mirage_v2 - Real-time video restyling model (v2)
- lucy_v2v_720p_rt - Real-time video editing model (720p)
- lucy_2_rt - Real-time video editing model (supports reference image)
- live_avatar - Real-time avatar animation with audio input
Use Cases
- Live video restyling: Transform webcam input in real-time with custom prompts
- Interactive video editing: Apply real-time effects and transformations
- Avatar animation: Animate avatars with live audio input
- Live streaming effects: Add AI-powered effects to live streams
Basic Example
Here’s a complete example of connecting to the real-time API:Client API
TheRealTimeClient returned by connect() provides:
Connection States
The real-time connection progresses through these states:- connecting - Establishing WebRTC connection
- connected - Connected and ready to stream
- generating - Currently generating/transforming video
- reconnecting - Attempting to reconnect after disconnection
- disconnected - Connection closed
Next Steps
- Connection Management - Learn about connecting and disconnecting
- State Management - Update prompts and parameters
- Events & Diagnostics - Monitor connection and handle errors