curl --request POST \ --url https://api.vivix.ai/v1/realtime-avatar/sessions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "vivix-a1-stream", "output": { "aspect_ratio": "9:16", "resolution": "720p" }, "avatars": [ { "avatar_id": "companion", "persona": "You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.", "visual": { "source_images": [ { "source_image_id": "front", "url": "https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png", "media_type": "image/png", "description": "A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room." } ] } } ], "pipeline_config": { "tts_config": { "tts_voice_id": "longanhuan_v3.6" } }}'
import requests
url = "https://api.vivix.ai/v1/realtime-avatar/sessions"
payload = {
"model": "vivix-a1-stream",
"output": {
"aspect_ratio": "9:16",
"resolution": "720p"
},
"avatars": [
{
"avatar_id": "companion",
"persona": "You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.",
"visual": { "source_images": [
{
"source_image_id": "front",
"url": "https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png",
"media_type": "image/png",
"description": "A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room."
}
] }
}
],
"pipeline_config": { "tts_config": { "tts_voice_id": "longanhuan_v3.6" } }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'vivix-a1-stream',
output: {aspect_ratio: '9:16', resolution: '720p'},
avatars: [
{
avatar_id: 'companion',
persona: 'You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.',
visual: {
source_images: [
{
source_image_id: 'front',
url: 'https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png',
media_type: 'image/png',
description: 'A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room.'
}
]
}
}
],
pipeline_config: {tts_config: {tts_voice_id: 'longanhuan_v3.6'}}
})
};
fetch('https://api.vivix.ai/v1/realtime-avatar/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vivix.ai/v1/realtime-avatar/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'vivix-a1-stream',
'output' => [
'aspect_ratio' => '9:16',
'resolution' => '720p'
],
'avatars' => [
[
'avatar_id' => 'companion',
'persona' => 'You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.',
'visual' => [
'source_images' => [
[
'source_image_id' => 'front',
'url' => 'https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png',
'media_type' => 'image/png',
'description' => 'A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room.'
]
]
]
]
],
'pipeline_config' => [
'tts_config' => [
'tts_voice_id' => 'longanhuan_v3.6'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vivix.ai/v1/realtime-avatar/sessions"
payload := strings.NewReader("{\n \"model\": \"vivix-a1-stream\",\n \"output\": {\n \"aspect_ratio\": \"9:16\",\n \"resolution\": \"720p\"\n },\n \"avatars\": [\n {\n \"avatar_id\": \"companion\",\n \"persona\": \"You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.\",\n \"visual\": {\n \"source_images\": [\n {\n \"source_image_id\": \"front\",\n \"url\": \"https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png\",\n \"media_type\": \"image/png\",\n \"description\": \"A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room.\"\n }\n ]\n }\n }\n ],\n \"pipeline_config\": {\n \"tts_config\": {\n \"tts_voice_id\": \"longanhuan_v3.6\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.post("https://api.vivix.ai/v1/realtime-avatar/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"vivix-a1-stream\",\n \"output\": {\n \"aspect_ratio\": \"9:16\",\n \"resolution\": \"720p\"\n },\n \"avatars\": [\n {\n \"avatar_id\": \"companion\",\n \"persona\": \"You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.\",\n \"visual\": {\n \"source_images\": [\n {\n \"source_image_id\": \"front\",\n \"url\": \"https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png\",\n \"media_type\": \"image/png\",\n \"description\": \"A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room.\"\n }\n ]\n }\n }\n ],\n \"pipeline_config\": {\n \"tts_config\": {\n \"tts_voice_id\": \"longanhuan_v3.6\"\n }\n }\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.vivix.ai/v1/realtime-avatar/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"vivix-a1-stream\",\n \"output\": {\n \"aspect_ratio\": \"9:16\",\n \"resolution\": \"720p\"\n },\n \"avatars\": [\n {\n \"avatar_id\": \"companion\",\n \"persona\": \"You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.\",\n \"visual\": {\n \"source_images\": [\n {\n \"source_image_id\": \"front\",\n \"url\": \"https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png\",\n \"media_type\": \"image/png\",\n \"description\": \"A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room.\"\n }\n ]\n }\n }\n ],\n \"pipeline_config\": {\n \"tts_config\": {\n \"tts_voice_id\": \"longanhuan_v3.6\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
{ "code": 0, "message": "success", "data": { "session_id": "avatar-session-123", "status": "active", "session": { "mode": "video_avatar", "active_avatar_id": "companion", "source_image_id": "front" }, "control": { "url": "wss://api.vivix.ai/v1/realtime-avatar/control?session_id=avatar-session-123", "client_secret": "ctl_..." }, "output": { "aspect_ratio": "9:16", "resolution": "720p" }, "delivery": { "media": { "transport": "trtc", "trtc": { "sdk_app_id": "1400000000", "room_id": "avatar-session-123", "user_id": "viewer", "user_sig": "...", "publisher_user_id": "publisher_xxx" } } }, "model": "vivix-a1-stream", "expires_at": "2026-07-16T10:05:00Z", "recording_mode": "off", "auto_close": { "disconnected_timeout_seconds": 0, "interaction_idle_timeout_seconds": 0 }, "conversation": { "tools": [], "turn_detection": { "type": "server_vad", "silence_duration_ms": 500 } }, "avatars": [ { "avatar_id": "companion", "persona": "You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.", "visual": { "source_images": [ { "source_image_id": "front", "url": "https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png", "media_type": "image/png" } ] } } ] }}
Sessions
Create Session
Create a live session from an image, a Persona, and a voice. Returns session settings, a WebSocket control credential, and RTC media credentials. For a minimal working request, see the Quickstart.
POST
/
v1
/
realtime-avatar
/
sessions
Create Session
curl --request POST \ --url https://api.vivix.ai/v1/realtime-avatar/sessions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "vivix-a1-stream", "output": { "aspect_ratio": "9:16", "resolution": "720p" }, "avatars": [ { "avatar_id": "companion", "persona": "You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.", "visual": { "source_images": [ { "source_image_id": "front", "url": "https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png", "media_type": "image/png", "description": "A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room." } ] } } ], "pipeline_config": { "tts_config": { "tts_voice_id": "longanhuan_v3.6" } }}'
import requests
url = "https://api.vivix.ai/v1/realtime-avatar/sessions"
payload = {
"model": "vivix-a1-stream",
"output": {
"aspect_ratio": "9:16",
"resolution": "720p"
},
"avatars": [
{
"avatar_id": "companion",
"persona": "You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.",
"visual": { "source_images": [
{
"source_image_id": "front",
"url": "https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png",
"media_type": "image/png",
"description": "A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room."
}
] }
}
],
"pipeline_config": { "tts_config": { "tts_voice_id": "longanhuan_v3.6" } }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'vivix-a1-stream',
output: {aspect_ratio: '9:16', resolution: '720p'},
avatars: [
{
avatar_id: 'companion',
persona: 'You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.',
visual: {
source_images: [
{
source_image_id: 'front',
url: 'https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png',
media_type: 'image/png',
description: 'A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room.'
}
]
}
}
],
pipeline_config: {tts_config: {tts_voice_id: 'longanhuan_v3.6'}}
})
};
fetch('https://api.vivix.ai/v1/realtime-avatar/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vivix.ai/v1/realtime-avatar/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'vivix-a1-stream',
'output' => [
'aspect_ratio' => '9:16',
'resolution' => '720p'
],
'avatars' => [
[
'avatar_id' => 'companion',
'persona' => 'You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.',
'visual' => [
'source_images' => [
[
'source_image_id' => 'front',
'url' => 'https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png',
'media_type' => 'image/png',
'description' => 'A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room.'
]
]
]
]
],
'pipeline_config' => [
'tts_config' => [
'tts_voice_id' => 'longanhuan_v3.6'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vivix.ai/v1/realtime-avatar/sessions"
payload := strings.NewReader("{\n \"model\": \"vivix-a1-stream\",\n \"output\": {\n \"aspect_ratio\": \"9:16\",\n \"resolution\": \"720p\"\n },\n \"avatars\": [\n {\n \"avatar_id\": \"companion\",\n \"persona\": \"You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.\",\n \"visual\": {\n \"source_images\": [\n {\n \"source_image_id\": \"front\",\n \"url\": \"https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png\",\n \"media_type\": \"image/png\",\n \"description\": \"A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room.\"\n }\n ]\n }\n }\n ],\n \"pipeline_config\": {\n \"tts_config\": {\n \"tts_voice_id\": \"longanhuan_v3.6\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.post("https://api.vivix.ai/v1/realtime-avatar/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"vivix-a1-stream\",\n \"output\": {\n \"aspect_ratio\": \"9:16\",\n \"resolution\": \"720p\"\n },\n \"avatars\": [\n {\n \"avatar_id\": \"companion\",\n \"persona\": \"You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.\",\n \"visual\": {\n \"source_images\": [\n {\n \"source_image_id\": \"front\",\n \"url\": \"https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png\",\n \"media_type\": \"image/png\",\n \"description\": \"A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room.\"\n }\n ]\n }\n }\n ],\n \"pipeline_config\": {\n \"tts_config\": {\n \"tts_voice_id\": \"longanhuan_v3.6\"\n }\n }\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.vivix.ai/v1/realtime-avatar/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"vivix-a1-stream\",\n \"output\": {\n \"aspect_ratio\": \"9:16\",\n \"resolution\": \"720p\"\n },\n \"avatars\": [\n {\n \"avatar_id\": \"companion\",\n \"persona\": \"You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.\",\n \"visual\": {\n \"source_images\": [\n {\n \"source_image_id\": \"front\",\n \"url\": \"https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png\",\n \"media_type\": \"image/png\",\n \"description\": \"A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room.\"\n }\n ]\n }\n }\n ],\n \"pipeline_config\": {\n \"tts_config\": {\n \"tts_voice_id\": \"longanhuan_v3.6\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
{ "code": 0, "message": "success", "data": { "session_id": "avatar-session-123", "status": "active", "session": { "mode": "video_avatar", "active_avatar_id": "companion", "source_image_id": "front" }, "control": { "url": "wss://api.vivix.ai/v1/realtime-avatar/control?session_id=avatar-session-123", "client_secret": "ctl_..." }, "output": { "aspect_ratio": "9:16", "resolution": "720p" }, "delivery": { "media": { "transport": "trtc", "trtc": { "sdk_app_id": "1400000000", "room_id": "avatar-session-123", "user_id": "viewer", "user_sig": "...", "publisher_user_id": "publisher_xxx" } } }, "model": "vivix-a1-stream", "expires_at": "2026-07-16T10:05:00Z", "recording_mode": "off", "auto_close": { "disconnected_timeout_seconds": 0, "interaction_idle_timeout_seconds": 0 }, "conversation": { "tools": [], "turn_detection": { "type": "server_vad", "silence_duration_ms": 500 } }, "avatars": [ { "avatar_id": "companion", "persona": "You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.", "visual": { "source_images": [ { "source_image_id": "front", "url": "https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png", "media_type": "image/png" } ] } } ] }}
For video avatar sessions, include output. Its aspect_ratio accepts 9:16 (portrait) or 16:9 (landscape). If omitted, it defaults to 9:16. An unsupported ratio returns error 20004 before the session starts.
Connection, duration, and errors
The response includes control and media credentials. See Sessions to connect, session management for automatic closure, and Errors for error codes.
Use output.resolution to select 480p or 720p. If omitted, the session starts at 720p and Vivix fits the images to that size. Vivix fits each starting image, including images the session can switch to later. A session-level image_fit overrides the saved Character setting. If neither supplies a setting, Vivix uses a centered crop. The same anchor applies to every image in the session. To keep more of the top when the image is too tall for the frame, send:
To use images you already prepared, send {"image_fit":{"mode":"manual"}}. For JPEGs, Vivix applies EXIF orientation before checking dimensions. Manual mode preserves the framing and skips cropping and scaling. If an image has the wrong dimensions, the API returns 20013 with its field path, actual dimensions, and expected dimensions. See Prepare the first image.For a 720p portrait session, a manual image at 720 × 1280 produces this error.
{ "code": 20013, "message": "invalid avatars: avatars[0].visual.source_images[0]: image is 720 × 1280, expected 672 × 1280; see https://docs.vivix.ai/streaming-avatar/character/first-image", "data": null}
When opening-image checks are enabled, they run on the active avatar’s selected opening image after fitting, including when you create a session from a saved character. If the request returns HTTP 422 with 20021 or 20022, update the image before retrying. See Session errors and the first-image guide.
Authorizations
Authorization
string
header
required
Your Vivix API key. Keep it on your server.
Body
application/json
model
string
required
Use vivix-a1-stream.
output
object
required
Required video output settings. Set the aspect ratio and resolution when creating the session.
Show child attributes
avatars
object[]
required
Available characters. Supply at least one, with unique avatar_id values. Each avatar selected for video needs a source image. Configure the shared voice in pipeline_config.tts_config.
Minimum array length: 1
Show child attributes
image_fit
object
How Vivix fits each starting image to the video avatar session frame. A session value overrides the saved character setting.
Show child attributes
idempotency_key
string
Optional key for retrying session creation. Reuse the same key when retrying the same request; use a new key for a new session.
session
object
Opening avatar and source image. Omit this object for a single avatar with one image. Use session.update to change the selected avatar or image during the session.
Show child attributes
pipeline_config
object
Session-wide speech recognition, speech synthesis, dialogue model, and audio rendering settings. These settings are fixed at session creation.
Show child attributes
conversation
object
Initial conversational defaults for tools, turn handling, and response generation.
Show child attributes
assets
object
Reusable image references, audio, speech text, and motion prompts. Use images for props or products in object interaction; put the character’s starting images in avatars[].visual.source_images. Asset IDs must be unique across all asset types.
Show child attributes
delivery
object
Media transport and delivery settings. Defaults to TRTC when omitted.
Show child attributes
max_duration_seconds
integer
Session time limit in seconds; minimum 4. The standard default is 20 minutes (1200 seconds), subject to your workspace’s session-duration limit. Check expires_at in the response for the actual expiry.
Required range: x >= 4
auto_close
object
Automatic close policy fixed when the session is created. The response returns the effective values after platform defaults are applied.
Show child attributes
recording_mode
string
on or off. Send off to disable recording.
Response
Success
code
integer
required
0 on success; any other value is an error code.
message
string
required
success, or an English error description.
data
object
required
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Vivix API Platform","description":"Build real-time interactive avatars, worlds, and blazing fast video generation with the Vivix API.","colors":{"primary":"#202124","light":"#E8EAED","dark":"#202124"},"logo":{"light":"https://mintcdn.com/vivix-20d305ce/_pH0P9NPGXmrYjpb/logo/light.svg?fit=max\u0026auto=format\u0026n=_pH0P9NPGXmrYjpb\u0026q=85\u0026s=baf0ff5242cbe15c7109578472ce97da","dark":"https://mintcdn.com/vivix-20d305ce/_pH0P9NPGXmrYjpb/logo/dark.svg?fit=max\u0026auto=format\u0026n=_pH0P9NPGXmrYjpb\u0026q=85\u0026s=589e9a9cf678ffb3e4d02b257709d2b2","href":"https://platform.vivix.ai"},"favicon":"https://mintcdn.com/vivix-20d305ce/_pH0P9NPGXmrYjpb/favicon.png?fit=max\u0026auto=format\u0026n=_pH0P9NPGXmrYjpb\u0026q=85\u0026s=5c253eff0d790be37c1e534f29b580b0","appearance":{"default":"light","strict":true},"background":{"color":{"light":"#F9F6F4","dark":"#141413"}},"navbar":{"primary":{"type":"button","label":"Developer Platform","href":"https://platform.vivix.ai"}},"seo":{"indexing":"navigable"},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"vivix-20d305ce","hasAudioNarration":false,"actualSubdomain":"vivix-20d305ce","customDomains":["docs.vivix.ai"],"gitSource":{"type":"gitlab","owner":"vivix-labs","repo":"vivix-api-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"projectId":689,"hostUrl":"https://gitlab.vivix.work","mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6af736e036896a78e7f6275c","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"API","count":73},{"language":"default","tag":"A1: Streaming Avatar","count":64},{"language":"default","tag":"API reference","count":45},{"language":"default","tag":"Server events","count":22},{"language":"default","tag":"Client events","count":8},{"language":"default","tag":"Integrate your app","count":7},{"language":"default","tag":"Agent","count":5},{"language":"default","tag":"Characters","count":5},{"language":"default","tag":"Sessions","count":5},{"language":"default","tag":"Voices","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":":root{--vivix-bg: #f9f6f4;--vivix-active: #e9e5e0;--vivix-line: #ddd8d3;--vivix-ink: #313131;--vivix-muted: #70757d;--vivix-note-bg: #f6f6f6}#sidebar-content li[data-active]>a{background-color:var(--vivix-active)!important;color:#202124!important}.callout[data-callout-type=\"note\"]{background-color:var(--vivix-note-bg)!important;border:0!important;border-left:3px solid var(--vivix-muted)!important;border-radius:6px!important}.callout[data-callout-type=\"note\"] [data-component-part=\"callout-content\"],.callout[data-callout-type=\"note\"] [data-component-part=\"callout-icon\"] svg{color:var(--vivix-ink)!important}#navbar{background-color:var(--vivix-bg);border-color:var(--vivix-line)}.columns>div>figure[data-name=\"frame\"]{height:100%}#w1-reference-pricing-note{background-color:#f0ece8;border-left:3px solid #b6aba0;border-radius:6px;padding:10px 14px;color:#5f6368;font-size:14px;line-height:1.5}#w1-reference-pricing-note strong{color:var(--vivix-ink);font-weight:600}.persona-map{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:16px;margin:28px 0 36px;color:#313131;font-size:13px;line-height:1.5}.persona-group-label{grid-column:1 / -1;color:#61716a;font-size:12px;font-weight:600}.persona-group-label:not(:first-child){margin-top:8px}.persona-speech{grid-column:1 / -1}.persona-outcome{display:flex;flex-direction:column;padding:20px;border:1px solid #ddd8d3;border-radius:16px;background:#f5f1ed}.persona-inputs{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:20px}.persona-inputs a,.persona-single-input{display:flex;flex-direction:column;gap:6px;text-decoration:none!important;border-bottom:0!important;color:#313131!important;font-weight:400}.persona-inputs a:hover .persona-module-title,.persona-single-input:hover .persona-module-title{text-decoration:underline}.persona-inputs a:focus-visible,.persona-single-input:focus-visible{outline:2px solid #617d79;outline-offset:4px;border-radius:3px}.persona-module-title{font-size:15px;line-height:1.4;font-weight:700}.persona-connector{margin:16px 0;text-align:center;color:#7b9788;font-size:23px;line-height:1}.persona-dialogue-scene{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:center}.persona-speech-example{display:flex;flex-direction:column;gap:12px}.persona-viewer{color:#61716a;font-size:13px}.persona-reply{padding:14px 16px;border-radius:14px 14px 14px 3px;background:#fffaf5;border:1px solid #ddd8d3;font-size:15px;line-height:1.5}.persona-scene-caption{margin-top:12px;color:#576962;font-size:13px;line-height:1.6}.persona-map .persona-behavior-scene{width:100%;height:auto;margin:0}.persona-scene-labels{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px;color:#576962;font-size:13px;text-align:center}@media (max-width: 540px){.persona-map,.persona-inputs,.persona-dialogue-scene{grid-template-columns:minmax(0, 1fr)}.persona-speech,.persona-group-label{grid-column:1}.persona-dialogue-scene{gap:12px}}"}],"page":{"pagePath":"streaming-avatar/api-references/sessions/create","slug":"/streaming-avatar/api-references/sessions/create","pageMetadata":{"title":"Create Session","openapi":"streaming-avatar/api-references/openapi.json POST /v1/realtime-avatar/sessions","description":"Create a live session from an image, a Persona, and a voice. Returns session settings, a WebSocket control credential, and RTC media credentials. For a minimal working request, see the [Quickstart](/streaming-avatar/get-started/quickstart).","href":"/streaming-avatar/api-references/sessions/create"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"Create a live session from an image, a Persona, and a voice. Returns session settings, a WebSocket control credential, and RTC media credentials. For a minimal working request, see the \", _jsx(_components.a, {\n href: \"/streaming-avatar/get-started/quickstart\",\n children: \"Quickstart\"\n }), \".\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{Accordion,CodeBlock}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`For video avatar sessions, include `,_jsx(_components.code,{children:`output`}),`. Its `,_jsx(_components.code,{children:`aspect_ratio`}),` accepts `,_jsx(_components.code,{children:`9:16`}),` (portrait) or `,_jsx(_components.code,{children:`16:9`}),` (landscape). If omitted, it defaults to `,_jsx(_components.code,{children:`9:16`}),`. An unsupported ratio returns error `,_jsx(_components.code,{children:`20004`}),` before the session starts.`]}),`\n`,_jsx(Accordion,{title:`Connection, duration, and errors`,id:`connection-duration-and-errors`,children:_jsxs(_components.p,{children:[`The response includes control and media credentials. See `,_jsx(_components.a,{href:`/streaming-avatar/api-references/sessions#connect-and-control`,children:`Sessions`}),` to connect, `,_jsx(_components.a,{href:`/streaming-avatar/integrate/sessions`,children:`session management`}),` for automatic closure, and `,_jsx(_components.a,{href:`/streaming-avatar/api-references/sessions#errors`,children:`Errors`}),` for error codes.`]})}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`output.resolution`}),` to select `,_jsx(_components.code,{children:`480p`}),` or `,_jsx(_components.code,{children:`720p`}),`. If omitted, the session starts at `,_jsx(_components.code,{children:`720p`}),` and Vivix fits the images to that size. Vivix fits each starting image, including images the session can switch to later. A session-level `,_jsx(_components.code,{children:`image_fit`}),` overrides the saved Character setting. If neither supplies a setting, Vivix uses a centered crop. The same anchor applies to every image in the session. To keep more of the top when the image is too tall for the frame, send:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"image_fit\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:{`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"auto\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"crop_anchor\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:{`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"x\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"y\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}}}`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`To use images you already prepared, send `,_jsx(_components.code,{children:`{\"image_fit\":{\"mode\":\"manual\"}}`}),`. For JPEGs, Vivix applies EXIF orientation before checking dimensions. Manual mode preserves the framing and skips cropping and scaling. If an image has the wrong dimensions, the API returns `,_jsx(_components.code,{children:`20013`}),` with its field path, actual dimensions, and expected dimensions. See `,_jsx(_components.a,{href:`/streaming-avatar/character/first-image`,children:`Prepare the first image`}),`.`]}),`\n`,_jsx(_components.p,{children:`For a 720p portrait session, a manual image at 720 × 1280 produces this error.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`20013`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"invalid avatars: avatars[0].visual.source_images[0]: image is 720 × 1280, expected 672 × 1280; see https://docs.vivix.ai/streaming-avatar/character/first-image\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`When opening-image checks are enabled, they run on the active avatar’s selected opening image after fitting, including when you create a session from a saved character. If the request returns HTTP 422 with `,_jsx(_components.code,{children:`20021`}),` or `,_jsx(_components.code,{children:`20022`}),`, update the image before retrying. See `,_jsx(_components.a,{href:`/streaming-avatar/api-references/sessions#errors`,children:`Session errors`}),` and the `,_jsx(_components.a,{href:`/streaming-avatar/character/first-image`,children:`first-image guide`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create Session","openapi":"streaming-avatar/api-references/openapi.json POST /v1/realtime-avatar/sessions","description":"Create a live session from an image, a Persona, and a voice. Returns session settings, a WebSocket control credential, and RTC media credentials. For a minimal working request, see the [Quickstart](/streaming-avatar/get-started/quickstart).","href":"/streaming-avatar/api-references/sessions/create"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createSession","summary":"Create Session","description":"Create a live session from an image, a Persona, and a voice. Returns session settings, a WebSocket control credential, and RTC media credentials. For a minimal working request, see the [Quickstart](/streaming-avatar/get-started/quickstart).","requestBody":"c9dba9ca-7f94-4c6f-8472-9ca6e906357c","responses":{"200":"2287290b-d7f0-421a-b0fc-49ed9276ff22","422":"699688ee-3341-4f36-8405-4ba83a572cb2"},"method":"post","type":"path","servers":["e8dd2a0a-f29f-4e25-ac5c-3463a23bc70e"],"security":["42b210fd-35b9-4d7a-9d11-bc61cb5f168d"],"path":"/v1/realtime-avatar/sessions","baseUrlOptions":["https://api.vivix.ai"],"title":"Create Session","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Use `vivix-a1-stream`.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"output":{"type":"object","description":"Required video output settings. Set the aspect ratio and resolution when creating the session.","properties":{"aspect_ratio":{"type":"string","enum":["9:16","16:9"],"default":"9:16","description":"Video avatar aspect ratio. Defaults to 9:16 when absent from the effective output settings. Other values return error 20004.","uniqueKey":"output.aspect_ratio","typeLabel":"enum\u003cstring>"},"resolution":{"type":"string","enum":["480p","720p"],"default":"720p","description":"Avatar video resolution. The effective session output defaults to 720p when no resolution is set.","uniqueKey":"output.resolution","typeLabel":"enum\u003cstring>"}},"isRequired":true,"uniqueKey":"output","typeLabel":"object"},"avatars":{"type":"array","description":"Available characters. Supply at least one, with unique `avatar_id` values. Each avatar selected for video needs a source image. Configure the shared voice in `pipeline_config.tts_config`.","items":{"type":"object","properties":{"avatar_id":{"type":"string","description":"Caller-defined avatar identifier, unique within the session.","isRequired":true,"uniqueKey":"avatars.items.[INDEX].avatar_id","typeLabel":"string"},"persona":{"type":"string","description":"Describe the character's identity, personality, speaking style, response habits, movement preferences, and listening behavior in plain language or Markdown. Vivix uses this Persona to prepare the character's behavior automatically. See [Write a Persona](/streaming-avatar/character/persona).","minLength":1,"isRequired":true,"uniqueKey":"avatars.items.[INDEX].persona","typeLabel":"string"},"voice":{"type":"object","description":"Optional per-avatar TTS configuration for multi-avatar sessions that require different voices. Provide `provider`, `provider_voice_id`, and `model`. For the normal session-wide voice path, omit this object and configure `pipeline_config.tts_config`. A session TTS configuration takes precedence over every per-avatar voice.","properties":{"provider":{"type":"string","description":"TTS backend, such as `qwen-audio-3.0-tts-flash_ws`, `elevenlabs`, or `qwen3tts`. Required with `provider_voice_id` and `model`.","isRequired":true,"uniqueKey":"avatars.items.[INDEX].voice.provider","typeLabel":"string"},"provider_voice_id":{"type":"string","description":"Provider-side voice or style id. Required with `provider` and `model`.","isRequired":true,"uniqueKey":"avatars.items.[INDEX].voice.provider_voice_id","typeLabel":"string"},"model":{"type":"string","description":"Provider TTS model ID. Required with `provider` and `provider_voice_id`.","isRequired":true,"uniqueKey":"avatars.items.[INDEX].voice.model","typeLabel":"string"},"speed":{"type":"number","description":"Speech speed multiplier. The valid range is `0.7` to `1.2`.","uniqueKey":"avatars.items.[INDEX].voice.speed","typeLabel":"number"}},"required":["provider","provider_voice_id","model"],"uniqueKey":"avatars.items.[INDEX].voice","typeLabel":"object"},"visual":{"type":"object","description":"Visual rendering settings. Required when this avatar is used for video rendering.","properties":{"source_images":{"type":"array","description":"Registered source images available for this avatar. Required when image-based avatar video rendering is used.","items":{"type":"object","description":"One source image that can be selected for avatar video rendering.","properties":{"source_image_id":{"type":"string","description":"Caller-defined source image identifier, unique within the avatar.","isRequired":true,"uniqueKey":"avatars.items.[INDEX].visual.source_images.items.[INDEX].source_image_id","typeLabel":"string"},"url":{"type":"string","description":"Publicly accessible HTTPS URL of the starting image. Vivix fits it to the session size by default. In manual mode, the image must already match the target dimensions.","isRequired":true,"uniqueKey":"avatars.items.[INDEX].visual.source_images.items.[INDEX].url","typeLabel":"string"},"media_type":{"type":"string","description":"Image media type, such as `image/png` or `image/jpeg`.","isRequired":true,"uniqueKey":"avatars.items.[INDEX].visual.source_images.items.[INDEX].media_type","typeLabel":"string"},"description":{"type":"string","description":"Optional description of the person, pose, and scene.","uniqueKey":"avatars.items.[INDEX].visual.source_images.items.[INDEX].description","typeLabel":"string"},"opening":{"type":"object","description":"Optional opening speech or action. Supply `dialogue`, `action`, or both. It runs when this image is selected and begins rendering.","properties":{"dialogue":{"type":"string","description":"Exact opening words to synthesize.","uniqueKey":"avatars.items.[INDEX].visual.source_images.items.[INDEX].opening.dialogue","typeLabel":"string"},"action":{"type":"object","properties":{"prompt":{"type":"string","description":"Visual motion prompt for the opening action.","isRequired":true,"uniqueKey":"avatars.items.[INDEX].visual.source_images.items.[INDEX].opening.action.prompt","typeLabel":"string"},"duration_ms":{"type":"integer","minimum":1,"description":"Opening action duration in milliseconds.","isRequired":true,"uniqueKey":"avatars.items.[INDEX].visual.source_images.items.[INDEX].opening.action.duration_ms","typeLabel":"integer"}},"required":["prompt","duration_ms"],"description":"Opening movement, described by a prompt and duration.","uniqueKey":"avatars.items.[INDEX].visual.source_images.items.[INDEX].opening.action","typeLabel":"object"},"starting_at":{"type":"integer","minimum":0,"default":0,"description":"Delay in milliseconds before the opening begins, measured from the first frame becoming available.","uniqueKey":"avatars.items.[INDEX].visual.source_images.items.[INDEX].opening.starting_at","typeLabel":"integer"}},"uniqueKey":"avatars.items.[INDEX].visual.source_images.items.[INDEX].opening","typeLabel":"object"}},"required":["source_image_id","media_type","url"],"uniqueKey":"avatars.items.[INDEX].visual.source_images.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"avatars.items.[INDEX].visual.source_images","typeLabel":"object[]"},"default_source_image_id":{"type":"string","description":"Default image ID. Omit when the avatar has one source image; otherwise set this or `session.source_image_id`.","uniqueKey":"avatars.items.[INDEX].visual.default_source_image_id","typeLabel":"string"}},"required":["source_images"],"uniqueKey":"avatars.items.[INDEX].visual","typeLabel":"object"}},"required":["avatar_id","persona"],"uniqueKey":"avatars.items.[INDEX]","typeLabel":"object"},"minItems":1,"isRequired":true,"uniqueKey":"avatars","typeLabel":"object[]"},"image_fit":{"type":"object","description":"How Vivix fits each starting image to the video avatar session frame. A session value overrides the saved character setting.","properties":{"mode":{"type":"string","enum":["auto","manual"],"default":"auto","description":"Auto fills the frame proportionally and crops the excess. Manual requires the exact target dimensions after applying JPEG EXIF orientation when present, with no cropping or scaling.","uniqueKey":"image_fit.mode","typeLabel":"enum\u003cstring>"},"crop_anchor":{"type":"object","description":"Position within the available crop travel in auto mode. On the x axis, 0 is left and 1 is right. On the y axis, 0 is top and 1 is bottom. Omit to center.","required":["x","y"],"properties":{"x":{"type":"number","minimum":0,"maximum":1,"isRequired":true,"uniqueKey":"image_fit.crop_anchor.x","typeLabel":"number"},"y":{"type":"number","minimum":0,"maximum":1,"isRequired":true,"uniqueKey":"image_fit.crop_anchor.y","typeLabel":"number"}},"uniqueKey":"image_fit.crop_anchor","typeLabel":"object"}},"uniqueKey":"image_fit","typeLabel":"object"},"idempotency_key":{"type":"string","description":"Optional key for retrying session creation. Reuse the same key when retrying the same request; use a new key for a new session.","uniqueKey":"idempotency_key","typeLabel":"string"},"session":{"type":"object","description":"Opening avatar and source image. Omit this object for a single avatar with one image. Use `session.update` to change the selected avatar or image during the session.","properties":{"mode":{"type":"string","description":"Session mode. Defaults to `video_avatar`, which streams avatar video, speech, and text events.","enum":["video_avatar"],"default":"video_avatar","uniqueKey":"session.mode","typeLabel":"enum\u003cstring>"},"active_avatar_id":{"type":"string","description":"Initial avatar ID. Omit when supplying one avatar; specify it when supplying multiple avatars.","uniqueKey":"session.active_avatar_id","typeLabel":"string"},"source_image_id":{"type":"string","description":"Opening image ID. Omit to use the active avatar’s default image, or its only image. Set this when no default image can be selected.","uniqueKey":"session.source_image_id","typeLabel":"string"}},"uniqueKey":"session","typeLabel":"object"},"pipeline_config":{"type":"object","description":"Session-wide speech recognition, speech synthesis, dialogue model, and audio rendering settings. These settings are fixed at session creation.","properties":{"tag_audio_enabled":{"type":"boolean","description":"Play a short vocal cue such as “mm” or “hmm” before the main answer. Defaults to `false`. Also configure the opening in the Persona’s Speaking Style section; see [Short vocal cues](/streaming-avatar/interaction/acknowledgement).","uniqueKey":"pipeline_config.tag_audio_enabled","typeLabel":"boolean"},"tts_config":{"type":"object","properties":{"tts_voice_id":{"type":"string","description":"Built-in voice ID or Vivix cloned `voice_id`. Required when `tts_config` is supplied.","isRequired":true,"uniqueKey":"pipeline_config.tts_config.tts_voice_id","typeLabel":"string"},"tts_provider":{"type":"string","description":"Speech service. For built-in Qwen Audio voices, defaults to `qwen-audio-3.0-tts-flash_ws`. Omit for Vivix cloned voices; specify for other services.","uniqueKey":"pipeline_config.tts_config.tts_provider","typeLabel":"string"},"tts_model_id":{"type":"string","description":"Speech model. For built-in Qwen Audio voices, defaults to `qwen-audio-3.0-tts-flash`. Omit for Vivix cloned voices; specify for other services.","uniqueKey":"pipeline_config.tts_config.tts_model_id","typeLabel":"string"},"tts_endpoint":{"type":"string","description":"Custom speech-service endpoint. Omit for built-in and Vivix cloned voices.","uniqueKey":"pipeline_config.tts_config.tts_endpoint","typeLabel":"string"},"tts_api_key":{"type":"string","description":"Your speech-service API key, when using your own service credentials. Built-in voices need no separate key.","uniqueKey":"pipeline_config.tts_config.tts_api_key","typeLabel":"string"},"payload":{"type":"object","description":"Additional parameters supported by the selected speech service. See [Speech synthesis](/streaming-avatar/integrate/speech-synthesis).","uniqueKey":"pipeline_config.tts_config.payload","typeLabel":"object"}},"required":["tts_voice_id"],"description":"Session-wide TTS configuration. It takes precedence over every `avatars[].voice`.","uniqueKey":"pipeline_config.tts_config","typeLabel":"object"},"asr_config":{"type":"object","properties":{"provider":{"type":"string","description":"Recognition service: `doubao` or `nova-3`. Required when supplying `asr_config`; omit the whole object to use the default.","isRequired":true,"uniqueKey":"pipeline_config.asr_config.provider","typeLabel":"string"},"language":{"type":"string","description":"Optional. Examples: `zh-CN` or `en-US` for Doubao; `en` for Nova. Controls recognition language, not the reply language.","uniqueKey":"pipeline_config.asr_config.language","typeLabel":"string"}},"required":["provider"],"description":"Advanced override. Omit it to use the platform default, `doubao`. Set `provider` (`doubao` for multilingual, or `nova-3` for English-only) and optional `language`. See [`asr_config`](/streaming-avatar/integrate/speech-recognition).","uniqueKey":"pipeline_config.asr_config","typeLabel":"object"},"llm_config":{"type":"object","properties":{"llm_backend":{"type":"string","description":"Optional; only `openai` is supported.","uniqueKey":"pipeline_config.llm_config.llm_backend","typeLabel":"string"},"llm_base_url":{"type":"string","description":"OpenAI-compatible base URL. Supply with `llm_model` to use a custom dialogue service.","uniqueKey":"pipeline_config.llm_config.llm_base_url","typeLabel":"string"},"llm_model":{"type":"string","description":"Optional custom model name.","uniqueKey":"pipeline_config.llm_config.llm_model","typeLabel":"string"},"llm_api_key":{"type":"string","description":"Your dialogue-service API key, when required by the custom service.","uniqueKey":"pipeline_config.llm_config.llm_api_key","typeLabel":"string"},"llm_temperature":{"type":"number","description":"Optional generation temperature; use the range supported by the model.","uniqueKey":"pipeline_config.llm_config.llm_temperature","typeLabel":"number"},"llm_max_output_tokens":{"type":"integer","description":"Optional generated-token limit, not a word count.","uniqueKey":"pipeline_config.llm_config.llm_max_output_tokens","typeLabel":"integer"},"llm_extra_payload":{"type":"string","description":"Optional JSON-encoded object string; do not supply a nested object.","uniqueKey":"pipeline_config.llm_config.llm_extra_payload","typeLabel":"string"}},"description":"Optional dialogue-model configuration. Set `llm_base_url` and `llm_model` for a custom service, or override only generation parameters. See [Dialogue model configuration](/streaming-avatar/integrate/dialogue-model) for field types and examples.","uniqueKey":"pipeline_config.llm_config","typeLabel":"object"},"a2a_config":{"type":"object","description":"Render the avatar from audio published by your application. See [Pure rendering mode](/streaming-avatar/integrate/pure-rendering).","properties":{"enable_a2a":{"type":"boolean","default":false,"description":"Set `true` to drive the avatar with your application’s live audio.","uniqueKey":"pipeline_config.a2a_config.enable_a2a","typeLabel":"boolean"},"provider":{"type":"string","description":"Use `passthrough` to render the audio you publish to the RTC room.","enum":["passthrough"],"uniqueKey":"pipeline_config.a2a_config.provider","typeLabel":"enum\u003cstring>"}},"uniqueKey":"pipeline_config.a2a_config","typeLabel":"object"}},"uniqueKey":"pipeline_config","typeLabel":"object"},"conversation":{"type":"object","description":"Initial conversational defaults for tools, turn handling, and response generation.","properties":{"tools":{"type":"array","description":"Tools available to responses in the session.","items":{"type":"object","description":"One tool definition. Only function tools are documented for v1.","properties":{"type":{"type":"string","description":"Use `function`.","isRequired":true,"uniqueKey":"conversation.tools.items.[INDEX].type","typeLabel":"string"},"name":{"type":"string","description":"Function name available to the response planner.","isRequired":true,"uniqueKey":"conversation.tools.items.[INDEX].name","typeLabel":"string"},"description":{"type":"string","description":"Human-readable description of when the tool should be used.","uniqueKey":"conversation.tools.items.[INDEX].description","typeLabel":"string"},"parameters":{"type":"object","description":"JSON Schema object describing function arguments.","uniqueKey":"conversation.tools.items.[INDEX].parameters","typeLabel":"object"}},"required":["type","name"],"uniqueKey":"conversation.tools.items.[INDEX]","typeLabel":"object"},"uniqueKey":"conversation.tools","typeLabel":"object[]"},"response_defaults":{"type":"object","description":"Default response-generation settings for later turns.","properties":{"temperature":{"type":"number","description":"Sampling temperature for generated response text. Supported range is `0` to `2`.","uniqueKey":"conversation.response_defaults.temperature","typeLabel":"number"},"max_output_tokens":{"type":"integer","description":"Maximum generated text tokens for a response.","uniqueKey":"conversation.response_defaults.max_output_tokens","typeLabel":"integer"}},"uniqueKey":"conversation.response_defaults","typeLabel":"object"},"turn_detection":{"type":"object","description":"Default turn handling for real-time user input.","properties":{"type":{"type":"string","description":"`manual` means the client starts responses explicitly. `server_vad` means the server detects turn boundaries from incoming user audio.","isRequired":true,"uniqueKey":"conversation.turn_detection.type","typeLabel":"string"},"silence_duration_ms":{"type":"integer","description":"Compatibility field. Do not use it to tune actual end-of-utterance timing. See [Speech recognition configuration](/streaming-avatar/integrate/speech-recognition) for recognition and turn-detection settings.","uniqueKey":"conversation.turn_detection.silence_duration_ms","typeLabel":"integer"}},"required":["type"],"uniqueKey":"conversation.turn_detection","typeLabel":"object"},"input_audio_transcription":{"type":"object","description":"Default transcription settings for user audio input.","properties":{"enabled":{"type":"boolean","description":"Whether user audio should be transcribed.","uniqueKey":"conversation.input_audio_transcription.enabled","typeLabel":"boolean"},"language":{"type":"string","description":"BCP-47 `language` code, or `auto` for automatic `language` detection.","uniqueKey":"conversation.input_audio_transcription.language","typeLabel":"string"}},"uniqueKey":"conversation.input_audio_transcription","typeLabel":"object"}},"uniqueKey":"conversation","typeLabel":"object"},"assets":{"type":"object","description":"Reusable image references, audio, speech text, and motion prompts. Use `images` for props or products in [object interaction](/streaming-avatar/interaction/object-interaction); put the character’s starting images in `avatars[].visual.source_images`. Asset IDs must be unique across all asset types.","properties":{"images":{"type":"array","description":"Reference images for props or products. These preserve the object’s appearance; they do not replace the character’s starting image or place the object in the scene by themselves.","items":{"type":"object","properties":{"asset_id":{"type":"string","description":"Object reference ID, unique across session assets. Use `OBJ_0`, `OBJ_1`, and so on.","isRequired":true,"uniqueKey":"assets.images.items.[INDEX].asset_id","typeLabel":"string"},"url":{"type":"string","description":"Publicly accessible HTTPS image URL.","isRequired":true,"uniqueKey":"assets.images.items.[INDEX].url","typeLabel":"string"},"mime_type":{"type":"string","description":"Image MIME type, such as `image/png` or `image/jpeg`.","uniqueKey":"assets.images.items.[INDEX].mime_type","typeLabel":"string"},"description":{"type":"string","description":"Optional visual description. If provided, include the matching reference tag, such as `a dark gray cylindrical speaker\u003cOBJ_0>` for `asset_id: \"OBJ_0\"`. See [Object interaction](/streaming-avatar/interaction/object-interaction).","uniqueKey":"assets.images.items.[INDEX].description","typeLabel":"string"}},"required":["asset_id","url"],"uniqueKey":"assets.images.items.[INDEX]","typeLabel":"object"},"uniqueKey":"assets.images","typeLabel":"object[]"},"audio":{"type":"array","description":"Reusable audio files that can be referenced by scripted vocal output.","items":{"type":"object","description":"One reusable audio asset.","properties":{"asset_id":{"type":"string","description":"Caller-defined audio asset id.","isRequired":true,"uniqueKey":"assets.audio.items.[INDEX].asset_id","typeLabel":"string"},"url":{"type":"string","description":"HTTPS URL for the audio file. The URL must be directly fetchable by Vivix without custom request headers.","isRequired":true,"uniqueKey":"assets.audio.items.[INDEX].url","typeLabel":"string"},"mime_type":{"type":"string","description":"Audio MIME type. Supported values are `audio/wav` and `audio/mpeg`.","uniqueKey":"assets.audio.items.[INDEX].mime_type","typeLabel":"string"}},"required":["asset_id","url"],"uniqueKey":"assets.audio.items.[INDEX]","typeLabel":"object"},"uniqueKey":"assets.audio","typeLabel":"object[]"},"speech_text":{"type":"array","description":"Reusable exact speech text that can be referenced by scripted vocal output.","items":{"type":"object","description":"One reusable speech text asset.","properties":{"asset_id":{"type":"string","description":"Caller-defined speech text asset id.","isRequired":true,"uniqueKey":"assets.speech_text.items.[INDEX].asset_id","typeLabel":"string"},"text":{"type":"string","description":"Exact text to synthesize and stream through output text events when used in `response.script`.","isRequired":true,"uniqueKey":"assets.speech_text.items.[INDEX].text","typeLabel":"string"}},"required":["asset_id","text"],"uniqueKey":"assets.speech_text.items.[INDEX]","typeLabel":"object"},"uniqueKey":"assets.speech_text","typeLabel":"object[]"},"visual_prompts":{"type":"array","description":"Reusable visual instructions that can be referenced by scripted visual output.","items":{"type":"object","description":"One reusable visual prompt asset.","properties":{"asset_id":{"type":"string","description":"Caller-defined visual prompt asset id.","isRequired":true,"uniqueKey":"assets.visual_prompts.items.[INDEX].asset_id","typeLabel":"string"},"prompt":{"type":"string","description":"Instruction for avatar movement, posture, gaze, gesture, or presentation.","isRequired":true,"uniqueKey":"assets.visual_prompts.items.[INDEX].prompt","typeLabel":"string"}},"required":["asset_id","prompt"],"uniqueKey":"assets.visual_prompts.items.[INDEX]","typeLabel":"object"},"uniqueKey":"assets.visual_prompts","typeLabel":"object[]"}},"uniqueKey":"assets","typeLabel":"object"},"delivery":{"type":"object","description":"Media transport and delivery settings. Defaults to TRTC when omitted.","properties":{"media":{"type":"object","description":"Selects how the client sends and receives realtime media.","properties":{"transport":{"type":"string","description":"Media transport requested for the session. Use `trtc` for TRTC or `agora` for Agora. If omitted, it defaults to TRTC. The response returns the corresponding provider-specific join details under `delivery.media.trtc` or `delivery.media.agora`.","uniqueKey":"delivery.media.transport","typeLabel":"string"}},"uniqueKey":"delivery.media","typeLabel":"object"}},"uniqueKey":"delivery","typeLabel":"object"},"max_duration_seconds":{"type":"integer","description":"Session time limit in seconds; minimum `4`. The standard default is 20 minutes (`1200` seconds), subject to your workspace’s session-duration limit. Check `expires_at` in the response for the actual expiry.","minimum":4,"uniqueKey":"max_duration_seconds","typeLabel":"integer"},"auto_close":{"type":"object","description":"Automatic close policy fixed when the session is created. The response returns the effective values after platform defaults are applied.","properties":{"disconnected_timeout_seconds":{"type":"integer","description":"Close after this many seconds without a control WebSocket connection. Omit to use the default policy, set `0` to disable, or use `10`–`3600`. A nonzero value cannot exceed the session duration.","uniqueKey":"auto_close.disconnected_timeout_seconds","typeLabel":"integer"},"interaction_idle_timeout_seconds":{"type":"integer","description":"Close after this many seconds without accepted client interaction or detected user speech. Set `0` to disable or use `30`–`3600`. A nonzero value cannot exceed the session duration. Ping/Pong does not count as interaction.","uniqueKey":"auto_close.interaction_idle_timeout_seconds","typeLabel":"integer"}},"uniqueKey":"auto_close","typeLabel":"object"},"recording_mode":{"type":"string","description":"`on` or `off`. Send `off` to disable recording.","uniqueKey":"recording_mode","typeLabel":"string"}},"required":["model","avatars","output"],"uniqueKey":"","typeLabel":"object"},"example":{"model":"vivix-a1-stream","output":{"aspect_ratio":"9:16","resolution":"720p"},"avatars":[{"avatar_id":"companion","persona":"You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.","visual":{"source_images":[{"source_image_id":"front","url":"https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png","media_type":"image/png","description":"A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room."}]}}],"pipeline_config":{"tts_config":{"tts_voice_id":"longanhuan_v3.6"}}},"examples":{"Example":{"title":"Example","value":{"model":"vivix-a1-stream","output":{"aspect_ratio":"9:16","resolution":"720p"},"avatars":[{"avatar_id":"companion","persona":"You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.","visual":{"source_images":[{"source_image_id":"front","url":"https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png","media_type":"image/png","description":"A young woman with curly black hair and a pink shirt, facing the camera in a softly lit room."}]}}],"pipeline_config":{"tts_config":{"tts_voice_id":"longanhuan_v3.6"}}}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"2287290b-d7f0-421a-b0fc-49ed9276ff22":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","description":"`0` on success; any other value is an error code.","isRequired":true,"uniqueKey":"code","typeLabel":"integer"},"message":{"type":"string","description":"`success`, or an English error description.","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"data":{"type":"object","properties":{"session_id":{"type":"string","description":"Identifier for the created avatar session.","isRequired":true,"uniqueKey":"data.session_id","typeLabel":"string"},"status":{"type":"string","description":"Current session status, such as `active`, `closing`, `closed`, or `failed`.","isRequired":true,"uniqueKey":"data.status","typeLabel":"string"},"auto_close":{"type":"object","description":"The effective policy snapshotted when the session was first created.","properties":{"disconnected_timeout_seconds":{"type":"integer","description":"The effective no-control-WSS timeout in seconds. 0 means disabled.","isRequired":true,"uniqueKey":"data.auto_close.disconnected_timeout_seconds","typeLabel":"integer"},"interaction_idle_timeout_seconds":{"type":"integer","description":"The effective interaction idle timeout in seconds. 0 means disabled.","isRequired":true,"uniqueKey":"data.auto_close.interaction_idle_timeout_seconds","typeLabel":"integer"}},"required":["disconnected_timeout_seconds","interaction_idle_timeout_seconds"],"isRequired":true,"uniqueKey":"data.auto_close","typeLabel":"object"},"session":{"type":"object","description":"Effective mutable session state after defaults and validation are applied.","properties":{"mode":{"type":"string","description":"Session mode: `video_avatar`.","enum":["video_avatar"],"isRequired":true,"uniqueKey":"data.session.mode","typeLabel":"enum\u003cstring>"},"active_avatar_id":{"type":"string","description":"Avatar rendered in the video and used for subsequent responses.","isRequired":true,"uniqueKey":"data.session.active_avatar_id","typeLabel":"string"},"source_image_id":{"type":"string","description":"ID of the source image currently used for avatar video.","uniqueKey":"data.session.source_image_id","typeLabel":"string"}},"required":["mode","active_avatar_id"],"isRequired":true,"uniqueKey":"data.session","typeLabel":"object"},"control":{"type":"object","description":"Connection details for the session control channel.","properties":{"url":{"type":"string","description":"Absolute WSS URL for the control channel, carrying client control events and server state events. The path is `/v1/realtime-avatar/control` and the session is identified by the `session_id` query parameter; always connect to the exact URL returned in this field.","isRequired":true,"uniqueKey":"data.control.url","typeLabel":"string"},"client_secret":{"type":"string","description":"Control-channel credential for this session. Browsers send it as the `token` query parameter; server clients may use a Bearer header. Valid until the session ends, including for reconnects. See [Connection example](/streaming-avatar/api-references/sessions#connect-and-control).","isRequired":true,"uniqueKey":"data.control.client_secret","typeLabel":"string"}},"required":["url","client_secret"],"isRequired":true,"uniqueKey":"data.control","typeLabel":"object"},"output":{"type":"object","description":"Effective avatar video output settings after defaults and limits are applied. Present when `session.mode` is `video_avatar`.","properties":{"aspect_ratio":{"type":"string","description":"Effective avatar video aspect ratio, either `9:16` or `16:9`.","isRequired":true,"uniqueKey":"data.output.aspect_ratio","typeLabel":"string"},"resolution":{"type":"string","description":"Effective avatar video resolution, either `480p` or `720p`.","isRequired":true,"uniqueKey":"data.output.resolution","typeLabel":"string"}},"required":["aspect_ratio","resolution"],"isRequired":true,"uniqueKey":"data.output","typeLabel":"object"},"conversation":{"type":"object","description":"Effective conversation defaults after server limits and defaults are applied. Same structure and meaning as the `conversation` request field.","properties":{"tools":{"type":"array","description":"Tools available to responses in the session.","items":{"type":"object","description":"One tool definition. Only function tools are documented for v1.","properties":{"type":{"type":"string","description":"Use `function`.","isRequired":true,"uniqueKey":"data.conversation.tools.items.[INDEX].type","typeLabel":"string"},"name":{"type":"string","description":"Function name available to the response planner.","isRequired":true,"uniqueKey":"data.conversation.tools.items.[INDEX].name","typeLabel":"string"},"description":{"type":"string","description":"Human-readable description of when the tool should be used.","uniqueKey":"data.conversation.tools.items.[INDEX].description","typeLabel":"string"},"parameters":{"type":"object","description":"JSON Schema object describing function arguments.","uniqueKey":"data.conversation.tools.items.[INDEX].parameters","typeLabel":"object"}},"required":["type","name"],"uniqueKey":"data.conversation.tools.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data.conversation.tools","typeLabel":"object[]"},"response_defaults":{"type":"object","description":"Default response-generation settings for later turns.","properties":{"temperature":{"type":"number","description":"Sampling temperature for generated response text. Supported range is `0` to `2`.","uniqueKey":"data.conversation.response_defaults.temperature","typeLabel":"number"},"max_output_tokens":{"type":"integer","description":"Maximum generated text tokens for a response.","uniqueKey":"data.conversation.response_defaults.max_output_tokens","typeLabel":"integer"}},"uniqueKey":"data.conversation.response_defaults","typeLabel":"object"},"turn_detection":{"type":"object","description":"Default turn handling for real-time user input.","properties":{"type":{"type":"string","description":"`manual` means the client starts responses explicitly. `server_vad` means the server detects turn boundaries from incoming user audio.","isRequired":true,"uniqueKey":"data.conversation.turn_detection.type","typeLabel":"string"},"silence_duration_ms":{"type":"integer","description":"Compatibility field. Do not use it to tune actual end-of-utterance timing. See [Speech recognition configuration](/streaming-avatar/integrate/speech-recognition) for recognition and turn-detection settings.","uniqueKey":"data.conversation.turn_detection.silence_duration_ms","typeLabel":"integer"}},"required":["type"],"uniqueKey":"data.conversation.turn_detection","typeLabel":"object"},"input_audio_transcription":{"type":"object","description":"Default transcription settings for user audio input.","properties":{"enabled":{"type":"boolean","description":"Whether user audio should be transcribed.","uniqueKey":"data.conversation.input_audio_transcription.enabled","typeLabel":"boolean"},"language":{"type":"string","description":"BCP-47 `language` code, or `auto` for automatic `language` detection.","uniqueKey":"data.conversation.input_audio_transcription.language","typeLabel":"string"}},"uniqueKey":"data.conversation.input_audio_transcription","typeLabel":"object"}},"isRequired":true,"uniqueKey":"data.conversation","typeLabel":"object"},"avatars":{"type":"array","description":"Effective avatar definitions in the session. Same structure and meaning as the `avatars` request field.","items":{"type":"object","properties":{"avatar_id":{"type":"string","description":"Caller-defined avatar identifier, unique within the session.","isRequired":true,"uniqueKey":"data.avatars.items.[INDEX].avatar_id","typeLabel":"string"},"persona":{"type":"string","description":"Describe the character's identity, personality, speaking style, response habits, movement preferences, and listening behavior in plain language or Markdown. Vivix uses this Persona to prepare the character's behavior automatically. See [Write a Persona](/streaming-avatar/character/persona).","uniqueKey":"data.avatars.items.[INDEX].persona","typeLabel":"string"},"voice":{"type":"object","description":"Optional per-avatar TTS configuration for multi-avatar sessions that require different voices. Provide `provider`, `provider_voice_id`, and `model`. For the normal session-wide voice path, omit this object and configure `pipeline_config.tts_config`. A session TTS configuration takes precedence over every per-avatar voice.","properties":{"provider":{"type":"string","description":"TTS backend, such as `qwen-audio-3.0-tts-flash_ws`, `elevenlabs`, or `qwen3tts`. Required with `provider_voice_id` and `model`.","isRequired":true,"uniqueKey":"data.avatars.items.[INDEX].voice.provider","typeLabel":"string"},"provider_voice_id":{"type":"string","description":"Provider-side voice or style id. Required with `provider` and `model`.","isRequired":true,"uniqueKey":"data.avatars.items.[INDEX].voice.provider_voice_id","typeLabel":"string"},"model":{"type":"string","description":"Provider TTS model ID. Required with `provider` and `provider_voice_id`.","isRequired":true,"uniqueKey":"data.avatars.items.[INDEX].voice.model","typeLabel":"string"},"speed":{"type":"number","description":"Speech speed multiplier. The valid range is `0.7` to `1.2`.","uniqueKey":"data.avatars.items.[INDEX].voice.speed","typeLabel":"number"}},"required":["provider","provider_voice_id","model"],"uniqueKey":"data.avatars.items.[INDEX].voice","typeLabel":"object"},"visual":{"type":"object","description":"Visual rendering settings. Required when this avatar is used for video rendering.","properties":{"source_images":{"type":"array","description":"Registered source images available for this avatar. Required when image-based avatar video rendering is used.","items":{"type":"object","description":"One source image that can be selected for avatar video rendering.","properties":{"source_image_id":{"type":"string","description":"Caller-defined source image identifier, unique within the avatar.","isRequired":true,"uniqueKey":"data.avatars.items.[INDEX].visual.source_images.items.[INDEX].source_image_id","typeLabel":"string"},"url":{"type":"string","description":"URL of the starting image used by the session.","isRequired":true,"uniqueKey":"data.avatars.items.[INDEX].visual.source_images.items.[INDEX].url","typeLabel":"string"},"media_type":{"type":"string","description":"Image media type, such as `image/png` or `image/jpeg`.","isRequired":true,"uniqueKey":"data.avatars.items.[INDEX].visual.source_images.items.[INDEX].media_type","typeLabel":"string"},"description":{"type":"string","description":"Optional description of the person, pose, and scene.","uniqueKey":"data.avatars.items.[INDEX].visual.source_images.items.[INDEX].description","typeLabel":"string"},"opening":{"type":"object","description":"Optional opening speech or action. Supply `dialogue`, `action`, or both. It runs when this image is selected and begins rendering.","properties":{"dialogue":{"type":"string","description":"Exact opening words to synthesize.","uniqueKey":"data.avatars.items.[INDEX].visual.source_images.items.[INDEX].opening.dialogue","typeLabel":"string"},"action":{"type":"object","properties":{"prompt":{"type":"string","description":"Visual motion prompt for the opening action.","isRequired":true,"uniqueKey":"data.avatars.items.[INDEX].visual.source_images.items.[INDEX].opening.action.prompt","typeLabel":"string"},"duration_ms":{"type":"integer","minimum":1,"description":"Opening action duration in milliseconds.","isRequired":true,"uniqueKey":"data.avatars.items.[INDEX].visual.source_images.items.[INDEX].opening.action.duration_ms","typeLabel":"integer"}},"required":["prompt","duration_ms"],"description":"Opening movement, described by a prompt and duration.","uniqueKey":"data.avatars.items.[INDEX].visual.source_images.items.[INDEX].opening.action","typeLabel":"object"},"starting_at":{"type":"integer","minimum":0,"default":0,"description":"Delay in milliseconds before the opening begins, measured from the first frame becoming available.","uniqueKey":"data.avatars.items.[INDEX].visual.source_images.items.[INDEX].opening.starting_at","typeLabel":"integer"}},"uniqueKey":"data.avatars.items.[INDEX].visual.source_images.items.[INDEX].opening","typeLabel":"object"}},"required":["source_image_id","media_type","url"],"uniqueKey":"data.avatars.items.[INDEX].visual.source_images.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"data.avatars.items.[INDEX].visual.source_images","typeLabel":"object[]"},"default_source_image_id":{"type":"string","description":"Default image ID. Omit when the avatar has one source image; otherwise set this or `session.source_image_id`.","uniqueKey":"data.avatars.items.[INDEX].visual.default_source_image_id","typeLabel":"string"}},"required":["source_images"],"uniqueKey":"data.avatars.items.[INDEX].visual","typeLabel":"object"}},"required":["avatar_id"],"uniqueKey":"data.avatars.items.[INDEX]","typeLabel":"object"},"minItems":1,"isRequired":true,"uniqueKey":"data.avatars","typeLabel":"object[]"},"model":{"type":"string","description":"The model from the request.","isRequired":true,"uniqueKey":"data.model","typeLabel":"string"},"assets":{"type":"object","description":"Reusable image references, audio, speech text, and motion prompts. Use `images` for props or products in [object interaction](/streaming-avatar/interaction/object-interaction); put the character’s starting images in `avatars[].visual.source_images`. Asset IDs must be unique across all asset types.","properties":{"images":{"type":"array","description":"Reference images for props or products. These preserve the object’s appearance; they do not replace the character’s starting image or place the object in the scene by themselves.","items":{"type":"object","properties":{"asset_id":{"type":"string","description":"Object reference ID, unique across session assets. Use `OBJ_0`, `OBJ_1`, and so on.","isRequired":true,"uniqueKey":"data.assets.images.items.[INDEX].asset_id","typeLabel":"string"},"url":{"type":"string","description":"Publicly accessible HTTPS image URL.","isRequired":true,"uniqueKey":"data.assets.images.items.[INDEX].url","typeLabel":"string"},"mime_type":{"type":"string","description":"Image MIME type, such as `image/png` or `image/jpeg`.","uniqueKey":"data.assets.images.items.[INDEX].mime_type","typeLabel":"string"},"description":{"type":"string","description":"Optional visual description. If provided, include the matching reference tag, such as `a dark gray cylindrical speaker\u003cOBJ_0>` for `asset_id: \"OBJ_0\"`. See [Object interaction](/streaming-avatar/interaction/object-interaction).","uniqueKey":"data.assets.images.items.[INDEX].description","typeLabel":"string"}},"required":["asset_id","url"],"uniqueKey":"data.assets.images.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data.assets.images","typeLabel":"object[]"},"audio":{"type":"array","description":"Reusable audio assets for `response.script.vocal.type: \"audio_asset\"`.","items":{"type":"object","description":"One reusable audio asset.","properties":{"asset_id":{"type":"string","description":"Caller-defined audio asset id.","isRequired":true,"uniqueKey":"data.assets.audio.items.[INDEX].asset_id","typeLabel":"string"},"url":{"type":"string","description":"HTTPS URL for the audio file. The URL must be directly fetchable by Vivix without custom request headers.","isRequired":true,"uniqueKey":"data.assets.audio.items.[INDEX].url","typeLabel":"string"},"mime_type":{"type":"string","description":"Audio MIME type. Supported values are `audio/wav` and `audio/mpeg`.","uniqueKey":"data.assets.audio.items.[INDEX].mime_type","typeLabel":"string"}},"required":["asset_id","url"],"uniqueKey":"data.assets.audio.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data.assets.audio","typeLabel":"object[]"},"speech_text":{"type":"array","description":"Reusable exact speech text assets for `response.script.vocal.type: \"speech_asset\"`.","items":{"type":"object","description":"One reusable speech text asset.","properties":{"asset_id":{"type":"string","description":"Caller-defined speech text asset id.","isRequired":true,"uniqueKey":"data.assets.speech_text.items.[INDEX].asset_id","typeLabel":"string"},"text":{"type":"string","description":"Exact text to synthesize and stream through output text events when used in `response.script`.","isRequired":true,"uniqueKey":"data.assets.speech_text.items.[INDEX].text","typeLabel":"string"}},"required":["asset_id","text"],"uniqueKey":"data.assets.speech_text.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data.assets.speech_text","typeLabel":"object[]"},"visual_prompts":{"type":"array","description":"Reusable visual prompt assets for `response.script.visual.visual_prompt_asset_id`.","items":{"type":"object","description":"One reusable visual prompt asset.","properties":{"asset_id":{"type":"string","description":"Caller-defined visual prompt asset id.","isRequired":true,"uniqueKey":"data.assets.visual_prompts.items.[INDEX].asset_id","typeLabel":"string"},"prompt":{"type":"string","description":"Instruction for avatar movement, posture, gaze, gesture, or presentation.","isRequired":true,"uniqueKey":"data.assets.visual_prompts.items.[INDEX].prompt","typeLabel":"string"}},"required":["asset_id","prompt"],"uniqueKey":"data.assets.visual_prompts.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data.assets.visual_prompts","typeLabel":"object[]"}},"uniqueKey":"data.assets","typeLabel":"object"},"delivery":{"type":"object","description":"Media connection details returned by the server. Present when `session.mode` is `video_avatar`.","properties":{"media":{"type":"object","description":"Temporary media connection details. Present when avatar video media is available. Exactly one media variant is returned, selected by `transport`. These details are scoped to this session and are not `provider` account credentials.","properties":{"transport":{"type":"string","description":"Discriminator that selects which media variant is returned. Supported values are `trtc` and `agora`.","isRequired":true,"uniqueKey":"data.delivery.media.transport","typeLabel":"string"},"trtc":{"type":"object","description":"TRTC room join details for the `trtc` media variant.","properties":{"sdk_app_id":{"type":"string","description":"TRTC application id used by the client SDK. Returned as a string, consistent with the convention that 64-bit integers may be returned as strings.","isRequired":true,"uniqueKey":"data.delivery.media.trtc.sdk_app_id","typeLabel":"string"},"room_id":{"type":"string","description":"TRTC room id for this session.","isRequired":true,"uniqueKey":"data.delivery.media.trtc.room_id","typeLabel":"string"},"user_id":{"type":"string","description":"TRTC user id assigned to the client.","isRequired":true,"uniqueKey":"data.delivery.media.trtc.user_id","typeLabel":"string"},"user_sig":{"type":"string","description":"Session-scoped signature for joining the TRTC room.","isRequired":true,"uniqueKey":"data.delivery.media.trtc.user_sig","typeLabel":"string"},"publisher_user_id":{"type":"string","description":"User id of the avatar video publisher in the TRTC room. Subscribe only to this user id to receive the avatar stream.","isRequired":true,"uniqueKey":"data.delivery.media.trtc.publisher_user_id","typeLabel":"string"}},"required":["sdk_app_id","room_id","user_id","user_sig","publisher_user_id"],"uniqueKey":"data.delivery.media.trtc","typeLabel":"object"},"agora":{"type":"object","description":"Agora channel join details for the `agora` media variant.","properties":{"app_id":{"type":"string","description":"Agora application id used by the client SDK.","isRequired":true,"uniqueKey":"data.delivery.media.agora.app_id","typeLabel":"string"},"channel_name":{"type":"string","description":"Agora channel name for this session.","isRequired":true,"uniqueKey":"data.delivery.media.agora.channel_name","typeLabel":"string"},"token":{"type":"string","description":"Session-scoped token for joining the Agora channel.","isRequired":true,"uniqueKey":"data.delivery.media.agora.token","typeLabel":"string"},"user_id":{"type":"string","description":"Agora user id assigned to the client.","isRequired":true,"uniqueKey":"data.delivery.media.agora.user_id","typeLabel":"string"},"publisher_user_id":{"type":"string","description":"User id of the avatar video publisher in the Agora channel. Subscribe only to this user id to receive the avatar stream.","isRequired":true,"uniqueKey":"data.delivery.media.agora.publisher_user_id","typeLabel":"string"}},"required":["app_id","channel_name","token","user_id","publisher_user_id"],"uniqueKey":"data.delivery.media.agora","typeLabel":"object"}},"required":["transport"],"uniqueKey":"data.delivery.media","typeLabel":"object"}},"uniqueKey":"data.delivery","typeLabel":"object"},"expires_at":{"type":"string","format":"date-time","description":"Time at which the session and its control credential expire. Present when the server returns a fixed expiration; otherwise omitted.","uniqueKey":"data.expires_at","typeLabel":"string\u003cdate-time>"},"recording_mode":{"type":"string","description":"Effective recording mode: `on` or `off`.","uniqueKey":"data.recording_mode","typeLabel":"string"}},"required":["session_id","status","auto_close","session","control","conversation","avatars","model","output"],"isRequired":true,"uniqueKey":"data","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"code":0,"message":"success","data":{"session_id":"avatar-session-123","status":"active","session":{"mode":"video_avatar","active_avatar_id":"companion","source_image_id":"front"},"control":{"url":"wss://api.vivix.ai/v1/realtime-avatar/control?session_id=avatar-session-123","client_secret":"ctl_..."},"output":{"aspect_ratio":"9:16","resolution":"720p"},"delivery":{"media":{"transport":"trtc","trtc":{"sdk_app_id":"1400000000","room_id":"avatar-session-123","user_id":"viewer","user_sig":"...","publisher_user_id":"publisher_xxx"}}},"model":"vivix-a1-stream","expires_at":"2026-07-16T10:05:00Z","recording_mode":"off","auto_close":{"disconnected_timeout_seconds":0,"interaction_idle_timeout_seconds":0},"conversation":{"tools":[],"turn_detection":{"type":"server_vad","silence_duration_ms":500}},"avatars":[{"avatar_id":"companion","persona":"You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.","visual":{"source_images":[{"source_image_id":"front","url":"https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png","media_type":"image/png"}]}}]}},"examples":{"Example":{"title":"Example","value":{"code":0,"message":"success","data":{"session_id":"avatar-session-123","status":"active","session":{"mode":"video_avatar","active_avatar_id":"companion","source_image_id":"front"},"control":{"url":"wss://api.vivix.ai/v1/realtime-avatar/control?session_id=avatar-session-123","client_secret":"ctl_..."},"output":{"aspect_ratio":"9:16","resolution":"720p"},"delivery":{"media":{"transport":"trtc","trtc":{"sdk_app_id":"1400000000","room_id":"avatar-session-123","user_id":"viewer","user_sig":"...","publisher_user_id":"publisher_xxx"}}},"model":"vivix-a1-stream","expires_at":"2026-07-16T10:05:00Z","recording_mode":"off","auto_close":{"disconnected_timeout_seconds":0,"interaction_idle_timeout_seconds":0},"conversation":{"tools":[],"turn_detection":{"type":"server_vad","silence_duration_ms":500}},"avatars":[{"avatar_id":"companion","persona":"You are a warm, curious conversation companion. Speak in relaxed English and keep everyday replies brief. Acknowledge corrections without making excuses. Use small smiles and gentle nods, then let your hands rest while listening.","visual":{"source_images":[{"source_image_id":"front","url":"https://static.vivi-x.ai/images/2026/07/20/b9b8e89651cd24ad.png","media_type":"image/png"}]}}]}}}},"exampleType":"examples"}},"exampleType":"examples"},"699688ee-3341-4f36-8405-4ba83a572cb2":{"description":"The selected opening image did not meet a video session image requirement.","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","enum":[20021,20022],"isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cinteger>"},"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"data":{"type":"null","isRequired":true,"uniqueKey":"data","typeLabel":"null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"faceTooSmall":{"title":"faceTooSmall","summary":"Use a closer opening image","value":{"code":20021,"message":"The avatar's face is too small in the opening image. Use a closer shot with the full face clearly visible. See the first-image guide: https://docs.vivix.ai/streaming-avatar/character/first-image","data":null}},"solidBackground":{"title":"solidBackground","summary":"Choose an image with background detail","value":{"code":20022,"message":"For better results, use an opening image with a background that has some detail, such as a room or outdoor scene. See the first-image guide: https://docs.vivix.ai/streaming-avatar/character/first-image","data":null}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"42b210fd-35b9-4d7a-9d11-bc61cb5f168d":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your Vivix API key. Keep it on your server.","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"e8dd2a0a-f29f-4e25-ac5c-3463a23bc70e":{"url":"https://api.vivix.ai"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Your Vivix API key. Keep it on your server.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Your Vivix API key. Keep it on your server.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"streaming-avatar/api-references/openapi.json"},"subdomain":"vivix-20d305ce","siteName":"Vivix API Platform","title":"Create Session - Vivix API Platform","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-06T16:37:24.956Z","originalFileLocation":"streaming-avatar/api-references/sessions/create.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create a live session from an image, a Persona, and a voice. Returns session settings, a WebSocket control credential, and RTC media credentials. For a minimal working request, see the Quickstart.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Vivix API Platform\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/vivix-20d305ce/4XVG5hka1siEhate/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/vivix-20d305ce/4XVG5hka1siEhate/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/vivix-20d305ce/4XVG5hka1siEhate/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/vivix-20d305ce/4XVG5hka1siEhate/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/vivix-20d305ce/4XVG5hka1siEhate/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/vivix-20d305ce/4XVG5hka1siEhate/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/vivix-20d305ce/4XVG5hka1siEhate/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/vivix-20d305ce/4XVG5hka1siEhate/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/vivix-20d305ce/4XVG5hka1siEhate/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create Session - Vivix API Platform\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create a live session from an image, a Persona, and a voice. Returns session settings, a WebSocket control credential, and RTC media credentials. For a minimal working request, see the Quickstart.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Vivix API Platform\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.vivix.ai/streaming-avatar/api-references/sessions/create\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://vivix-20d305ce.mintlify.site/_mintlify/api/og/v2?division=Sessions\u0026amp;title=Create+Session\u0026amp;description=Create+a+live+session+from+an+image%2C+a+Persona%2C+and+a+voice.+Returns+session+settings%2C+a+WebSocket+control+credential%2C+and+RTC+media+credentials.+For+a+minimal+\u0026amp;theme=c0ba66fadb8405a2f081edcf\u0026amp;signature=7211f1328c13d10dc09b3cca107faf372df2f73d4b9dfe67e033381356be59b1\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create Session - Vivix API Platform\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create a live session from an image, a Persona, and a voice. Returns session settings, a WebSocket control credential, and RTC media credentials. For a minimal working request, see the Quickstart.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://vivix-20d305ce.mintlify.site/_mintlify/api/og/v2?division=Sessions\u0026amp;title=Create+Session\u0026amp;description=Create+a+live+session+from+an+image%2C+a+Persona%2C+and+a+voice.+Returns+session+settings%2C+a+WebSocket+control+credential%2C+and+RTC+media+credentials.+For+a+minimal+\u0026amp;theme=c0ba66fadb8405a2f081edcf\u0026amp;signature=7211f1328c13d10dc09b3cca107faf372df2f73d4b9dfe67e033381356be59b1\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/vivix-20d305ce/4XVG5hka1siEhate/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Vivix API Platform\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#202124\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.vivix.ai/streaming-avatar/api-references/sessions/create\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/streaming-avatar/api-references/sessions/create.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.vivix.ai/#organization\",\"name\":\"Vivix API Platform\",\"url\":\"https://docs.vivix.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/vivix-20d305ce/_pH0P9NPGXmrYjpb/logo/light.svg?fit=max\u0026auto=format\u0026n=_pH0P9NPGXmrYjpb\u0026q=85\u0026s=baf0ff5242cbe15c7109578472ce97da\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.vivix.ai#website\",\"name\":\"Vivix API Platform\",\"url\":\"https://docs.vivix.ai\",\"publisher\":{\"@id\":\"https://docs.vivix.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.vivix.ai/streaming-avatar/api-references/sessions/create#webpage\",\"url\":\"https://docs.vivix.ai/streaming-avatar/api-references/sessions/create\",\"name\":\"Create Session\",\"description\":\"Create a live session from an image, a Persona, and a voice. Returns session settings, a WebSocket control credential, and RTC media credentials. For a minimal working request, see the Quickstart.\",\"dateModified\":\"2026-11-06T16:37:24.956Z\",\"isPartOf\":{\"@id\":\"https://docs.vivix.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.vivix.ai/streaming-avatar/api-references/sessions/create#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.vivix.ai/streaming-avatar/api-references/sessions/create#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"A1: Streaming Avatar\",\"item\":\"https://docs.vivix.ai/streaming-avatar/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sessions\",\"item\":\"https://docs.vivix.ai/streaming-avatar/api-references/sessions\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Create Session\",\"item\":\"https://docs.vivix.ai/streaming-avatar/api-references/sessions/create\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.vivix.ai/streaming-avatar/api-references/sessions/create#apireference\",\"headline\":\"Create Session\",\"name\":\"Create Session\",\"description\":\"Create a live session from an image, a Persona, and a voice. Returns session settings, a WebSocket control credential, and RTC media credentials. For a minimal working request, see the Quickstart.\",\"url\":\"https://docs.vivix.ai/streaming-avatar/api-references/sessions/create\",\"mainEntityOfPage\":{\"@id\":\"https://docs.vivix.ai/streaming-avatar/api-references/sessions/create#webpage\"},\"dateModified\":\"2026-11-06T16:37:24.956Z\",\"publisher\":{\"@id\":\"https://docs.vivix.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.vivix.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Vivix API Platform\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Vivix API Platform\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/streaming-avatar/api-references/sessions/create.md","siteName":"Vivix API Platform","nav":{"global":null,"tabs":[{"tab":"API","icon":"code","groups":[{"group":"Overview","pages":[{"title":"Introduction","href":"/overview/introduction"},{"title":"Models","href":"/overview/models"}]},{"group":"A1: Streaming Avatar","pages":[{"title":"Streaming Avatar overview","sidebarTitle":"Overview","href":"/streaming-avatar/overview"},{"group":"Get started","pages":[{"title":"Avatar Playground","href":"/streaming-avatar/get-started/avatar-playground"},{"title":"Quickstart","href":"/streaming-avatar/get-started/quickstart"}]},{"group":"Define the character","pages":[{"title":"Prepare the first image","href":"/streaming-avatar/character/first-image"},{"title":"Choose a voice","href":"/streaming-avatar/character/voice"},{"title":"Write a Persona","sidebarTitle":"Persona","href":"/streaming-avatar/character/persona"},{"title":"Add tools to the character","href":"/streaming-avatar/character/tools"}]},{"group":"Interaction and performance","pages":[{"title":"Conversation and interruptions","href":"/streaming-avatar/interaction/conversation"},{"title":"Script speech and performances","href":"/streaming-avatar/interaction/scripted-performances"},{"title":"Change outfits and scenes","href":"/streaming-avatar/interaction/outfits-and-scenes"},{"title":"Object interaction","href":"/streaming-avatar/interaction/object-interaction"},{"title":"Respond quickly with short vocal cues","sidebarTitle":"Short vocal cues","href":"/streaming-avatar/interaction/acknowledgement"}]},{"group":"Integrate your app","pages":[{"title":"Create, manage, and close sessions","href":"/streaming-avatar/integrate/sessions"},{"title":"Connect with TRTC","href":"/streaming-avatar/integrate/trtc"},{"title":"Connect with Agora","href":"/streaming-avatar/integrate/agora"},{"title":"Configure speech recognition","href":"/streaming-avatar/integrate/speech-recognition"},{"title":"Configure the dialogue model","href":"/streaming-avatar/integrate/dialogue-model"},{"title":"Configure speech synthesis","href":"/streaming-avatar/integrate/speech-synthesis"},{"title":"Pure rendering mode","href":"/streaming-avatar/integrate/pure-rendering"}]},{"group":"API reference","pages":[{"group":"Sessions","root":{"title":"Sessions","description":"Create, inspect, and close a live Streaming Avatar session.","href":"/streaming-avatar/api-references/sessions"},"pages":[{"title":"Create Session","openapi":"streaming-avatar/api-references/openapi.json POST /v1/realtime-avatar/sessions","href":"/streaming-avatar/api-references/sessions/create"},{"title":"Create Session from Character","openapi":"streaming-avatar/api-references/openapi.json POST /v1/realtime-avatar/character-sessions","description":"Start a session from a saved `character_id`. Returns the same session and connection fields as Create Session.","href":"/streaming-avatar/api-references/sessions/create-from-character"},{"title":"Get Session","openapi":"streaming-avatar/api-references/openapi.json GET /v1/realtime-avatar/sessions/{session_id}","href":"/streaming-avatar/api-references/sessions/get"},{"title":"List Sessions","openapi":"streaming-avatar/api-references/openapi.json GET /v1/realtime-avatar/sessions","href":"/streaming-avatar/api-references/sessions/list"},{"title":"Close Session","openapi":"streaming-avatar/api-references/openapi.json POST /v1/realtime-avatar/sessions/{session_id}/close","href":"/streaming-avatar/api-references/sessions/close"}]},{"group":"Voices","root":{"title":"Voices","href":"/streaming-avatar/api-references/voices"},"pages":[{"title":"Upload Audio","openapi":"streaming-avatar/api-references/openapi.json POST /v1/files/audios","href":"/streaming-avatar/api-references/voices/upload-audio"},{"title":"Clone Voice","openapi":"streaming-avatar/api-references/openapi.json POST /v1/voices","href":"/streaming-avatar/api-references/voices/clone"},{"title":"Design Voice","openapi":"streaming-avatar/api-references/openapi.json POST /v1/voices/design","href":"/streaming-avatar/api-references/voices/design"},{"title":"List Voices","openapi":"streaming-avatar/api-references/openapi.json GET /v1/voices","href":"/streaming-avatar/api-references/voices/list"},{"title":"Get Voice","openapi":"streaming-avatar/api-references/openapi.json GET /v1/voices/{voice_id}","href":"/streaming-avatar/api-references/voices/get"}]},{"group":"Client events","root":{"title":"Client events","href":"/streaming-avatar/api-references/client-events"},"pages":[{"title":"session.update","href":"/streaming-avatar/api-references/client-events/session-update"},{"title":"asset.add","href":"/streaming-avatar/api-references/client-events/asset-add"},{"title":"avatar.add","href":"/streaming-avatar/api-references/client-events/avatar-add"},{"title":"conversation.item.create","href":"/streaming-avatar/api-references/client-events/conversation-item-create"},{"title":"conversation.item.retrieve","href":"/streaming-avatar/api-references/client-events/conversation-item-retrieve"},{"title":"conversation.item.delete","href":"/streaming-avatar/api-references/client-events/conversation-item-delete"},{"title":"response.create","href":"/streaming-avatar/api-references/client-events/response-create"},{"title":"response.cancel","href":"/streaming-avatar/api-references/client-events/response-cancel"}]},{"group":"Server events","root":{"title":"Server events","href":"/streaming-avatar/api-references/server-events"},"pages":[{"title":"error","href":"/streaming-avatar/api-references/server-events/error"},{"title":"session.closed","href":"/streaming-avatar/api-references/server-events/session-closed"},{"title":"session.updated","href":"/streaming-avatar/api-references/server-events/session-updated"},{"title":"session.update.done","href":"/streaming-avatar/api-references/server-events/session-update-done"},{"title":"session.bootstrap.opening.done","href":"/streaming-avatar/api-references/server-events/session-bootstrap-opening-done"},{"title":"asset.added","href":"/streaming-avatar/api-references/server-events/asset-added"},{"title":"avatar.added","href":"/streaming-avatar/api-references/server-events/avatar-added"},{"title":"conversation.item.created","href":"/streaming-avatar/api-references/server-events/conversation-item-created"},{"title":"conversation.item.retrieved","href":"/streaming-avatar/api-references/server-events/conversation-item-retrieved"},{"title":"conversation.item.deleted","href":"/streaming-avatar/api-references/server-events/conversation-item-deleted"},{"title":"input_audio.speech_started","href":"/streaming-avatar/api-references/server-events/input-audio-speech-started"},{"title":"input_audio.speech_stopped","href":"/streaming-avatar/api-references/server-events/input-audio-speech-stopped"},{"title":"conversation.item.input_audio_transcription.delta","href":"/streaming-avatar/api-references/server-events/conversation-item-input-audio-transcription-delta"},{"title":"conversation.item.input_audio_transcription.completed","href":"/streaming-avatar/api-references/server-events/conversation-item-input-audio-transcription-completed"},{"title":"conversation.item.input_audio_transcription.failed","href":"/streaming-avatar/api-references/server-events/conversation-item-input-audio-transcription-failed"},{"title":"response.created","href":"/streaming-avatar/api-references/server-events/response-created"},{"title":"response.done","href":"/streaming-avatar/api-references/server-events/response-done"},{"title":"response.render.started","href":"/streaming-avatar/api-references/server-events/response-render-started"},{"title":"response.render.stopped","href":"/streaming-avatar/api-references/server-events/response-render-stopped"},{"title":"response.output_item.done","href":"/streaming-avatar/api-references/server-events/response-output-item-done"},{"title":"response.output_text.delta","href":"/streaming-avatar/api-references/server-events/response-output-text-delta"},{"title":"response.output_text.done","href":"/streaming-avatar/api-references/server-events/response-output-text-done"}]},{"group":"Characters","root":{"title":"Characters","href":"/streaming-avatar/api-references/characters"},"pages":[{"title":"Create Character","openapi":"streaming-avatar/api-references/openapi.json POST /v1/characters","href":"/streaming-avatar/api-references/characters/create"},{"title":"List Characters","openapi":"streaming-avatar/api-references/openapi.json GET /v1/characters","href":"/streaming-avatar/api-references/characters/list"},{"title":"Get Character","openapi":"streaming-avatar/api-references/openapi.json GET /v1/characters/{character_id}","href":"/streaming-avatar/api-references/characters/get"},{"title":"Update Character","openapi":"streaming-avatar/api-references/openapi.json PUT /v1/characters/{character_id}","href":"/streaming-avatar/api-references/characters/update"},{"title":"Delete Character","openapi":"streaming-avatar/api-references/openapi.json DELETE /v1/characters/{character_id}","href":"/streaming-avatar/api-references/characters/delete"}]}]}]},{"group":"W1: Streaming World","pages":[{"title":"W1: Streaming World","href":"/streaming-world/configuration"},{"title":"Streaming Control","href":"/streaming-world/control"},{"group":"API References","pages":[{"title":"Sessions","href":"/streaming-world/api-references/sessions"},{"title":"Client Messages","sidebarTitle":"Client messages","href":"/streaming-world/api-references/client-events"},{"title":"Server Events","sidebarTitle":"Server events","href":"/streaming-world/api-references/server-events"}]}]},{"group":"Blazing Fast Video Generation","pages":[{"title":"Avatar Video Generation","sidebarTitle":"A1: Avatar Video Generation","href":"/video-generation/avatar-video-generation"},{"title":"World Video Generation","sidebarTitle":"W1: World Video Generation","href":"/video-generation/world-video-generation"}]}]},{"tab":"Agent","icon":"robot","pages":[{"title":"Agent","href":"/agent/overview"}]}]},"basePath":"","title":"Create Session - Vivix API Platform","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DdEMm2kG.js","utils-BMo572L7.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C-4m9KAx.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DPLK2Oq9.js","snippetPresets-BKjfJMC9.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-DTsgtCEj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C8vmhyQM.js","shallow-r9w8LQGS.js","getApiPlaygroundDisplay-DjPI64HQ.js","CodeSnippet-C8Bvhl16.js","CodeSnippets-BtWUwcMy.js","Page-BIYvYBgk.js","getPastedJson-Dcm_3Pgl.js","icon-BXwrTpjc.js","MethodPill-CcjfVmmy.js","DuplicateIcon-BuKIbXAQ.js","createIcon-DaL9yXsO.js","DynamicMarkdown-Co5nikxh.js","SectionHeading-P4UNTsMZ.js","axios-vUo_bRtp.js","Markdown-CEfymfIH.js","clsx-Dq9TQuNi.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-D2J8knkn.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BgZ2ThuU.js"]}