Overview
This version targets customers who bring their own RTC channels and their own real-time speech capabilities. Vidu is only responsible for character rendering and streaming. You send the character's speech and motion instructions to Vidu, and Vidu pushes the rendered character to the corresponding RTC channel.
Minimal Integration Flow
Create a Session
Call the creation API with your API Key, passing in your own RTC channel information (rtc_info). Vidu will use this information to join your channel and prepare to stream the character video. The live.id in the response is used later for WebSocket and queries; client_secret is used for the WebSocket connection in browser scenarios.
Establish the WebSocket and Send the Start Signal
Connect to /live/v1/external-lives/{live_id}/stream. Once connected, the first frame must be conn_init (any other signals sent before it will be ignored). Receiving conn_init_ack.success=true indicates that the rendering side is ready; if NOT_READY is returned, simply wait a moment and retry conn_init — there is no need to reconnect the WebSocket.
Continuously Push Data During the Session
Once ready, send raw PCM audio via binary frames, while sending user transcription text (type=9) and model reply text (type=10) via text frames. When the user is detected as speaking, send audio_interrupted (type=7) to interrupt the character's current reply. The character video is streamed in real time by Vidu to your own RTC channel; you subscribe to and render it in your client.
API Protocol Overview
End-to-End Integration Flow
- Create (HTTP, with your
rtc_info) - Obtain
live_idandclient_secret - Establish the WebSocket stream and send
conn_init - Enter the live session after receiving
conn_init_ack.success=true - During the session, continuously send PCM audio, user transcription text (type=9), and model reply text (type=10); send an interrupt (type=7) when necessary
- At the end, send
call_hangupor simply close the WebSocket.
API Overview
The table below lists all external APIs; you can look up the entry point by purpose. All HTTP APIs require Authorization: Token vda_xxx.
| Method | Path | Purpose |
|---|---|---|
| POST | /live/s_avatar/component | Create (core entry point, returns live and client_secret) |
| GET | /live/v1/lives/{live_id} | Query the status of a single live session |
| WebSocket | /live/v1/external-lives/{live_id}/stream | Feed data + control signaling (audio / transcription / interrupt / hangup) |
General Conventions
| Item | Convention |
|---|---|
{host} | {host} is the domain name, without the protocol. For the China (domestic) environment it is api.vidu.cn; for the international environment it is api.vidu.com. Use https://{host} for HTTP and wss://{host} for WebSocket |
| Gateway Prefix | Paths below include the /live prefix (gateway path) |
| JSON Fields | Request and response fields use snake_case, e.g., image_uri, rtc_info, client_secret |
| IDs and Timestamps | For int64 fields such as live_id and created_at, it is recommended that the frontend handle them as strings to avoid JavaScript number precision issues |
| Media Transport | The character video is pushed by Vidu to your own RTC channel; the WebSocket only carries control signaling, transcription text, and your upstream PCM audio |