查询会话
curl --request GET \
--url https://api.vivix.ai/v1/realtime-avatar/sessions/{session_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vivix.ai/v1/realtime-avatar/sessions/{session_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vivix.ai/v1/realtime-avatar/sessions/{session_id}', 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/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vivix.ai/v1/realtime-avatar/sessions/{session_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vivix.ai/v1/realtime-avatar/sessions/{session_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vivix.ai/v1/realtime-avatar/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"data": {
"session_id": "avatar-session-123",
"status": "closed",
"auto_close": {
"disconnected_timeout_seconds": 60,
"interaction_idle_timeout_seconds": 300
},
"session": {
"mode": "video_avatar",
"active_avatar_id": "host_a",
"source_image_id": "front"
},
"control": {
"url": "wss://api.vivix.ai/v1/realtime-avatar/control?session_id=avatar-session-123",
"client_secret": ""
},
"output": {
"aspect_ratio": "9:16",
"resolution": "480p"
},
"assets": {
"audio": [
{
"asset_id": "welcome_jingle",
"url": "https://cdn.example.com/audio/welcome-jingle.wav",
"mime_type": "audio/wav"
}
],
"speech_text": [
{
"asset_id": "welcome_line",
"text": "Welcome back. I saved your place."
}
],
"visual_prompts": [
{
"asset_id": "wave_small",
"prompt": "smile and give a small wave"
}
]
},
"conversation": {
"tools": [
{
"type": "function",
"name": "lookup_product",
"description": "Look up product details by product id.",
"parameters": {
"type": "object",
"properties": {
"product_id": {
"type": "string"
}
},
"required": [
"product_id"
]
}
}
],
"response_defaults": {
"temperature": 0.7,
"max_output_tokens": 512
},
"turn_detection": {
"type": "server_vad",
"silence_duration_ms": 500
},
"input_audio_transcription": {
"enabled": true,
"language": "auto"
}
},
"avatars": [
{
"avatar_id": "host_a",
"persona": "You are Host A, a warm livestream host who gives concise product-focused replies.",
"visual": {
"source_images": [
{
"source_image_id": "front",
"url": "https://cdn.example.com/avatars/host-a-front.png",
"description": "A woman facing the camera in a brightly lit studio, front view.",
"media_type": "image/png"
},
{
"source_image_id": "side",
"url": "https://cdn.example.com/avatars/host-a-side.png",
"description": "The same woman in the same studio, side view.",
"media_type": "image/png"
}
],
"default_source_image_id": "front"
}
},
{
"avatar_id": "host_b",
"persona": "You are Host B, a calm expert who gives brief technical explanations.",
"visual": {
"source_images": [
{
"source_image_id": "front",
"url": "https://cdn.example.com/avatars/host-b-front.png",
"description": "A man facing the camera in a brightly lit studio, front view.",
"media_type": "image/png"
}
],
"default_source_image_id": "front"
}
}
],
"model": "vivix-a1-stream",
"expires_at": "2026-07-16T10:05:00Z",
"closed_at": "2026-07-16T10:04:10Z",
"close_reason": "user_requested"
}
}会话
查询会话
获取会话的当前状态、实际生效的设置和连接信息。
GET
/
v1
/
realtime-avatar
/
sessions
/
{session_id}
查询会话
curl --request GET \
--url https://api.vivix.ai/v1/realtime-avatar/sessions/{session_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vivix.ai/v1/realtime-avatar/sessions/{session_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vivix.ai/v1/realtime-avatar/sessions/{session_id}', 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/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vivix.ai/v1/realtime-avatar/sessions/{session_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vivix.ai/v1/realtime-avatar/sessions/{session_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vivix.ai/v1/realtime-avatar/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"data": {
"session_id": "avatar-session-123",
"status": "closed",
"auto_close": {
"disconnected_timeout_seconds": 60,
"interaction_idle_timeout_seconds": 300
},
"session": {
"mode": "video_avatar",
"active_avatar_id": "host_a",
"source_image_id": "front"
},
"control": {
"url": "wss://api.vivix.ai/v1/realtime-avatar/control?session_id=avatar-session-123",
"client_secret": ""
},
"output": {
"aspect_ratio": "9:16",
"resolution": "480p"
},
"assets": {
"audio": [
{
"asset_id": "welcome_jingle",
"url": "https://cdn.example.com/audio/welcome-jingle.wav",
"mime_type": "audio/wav"
}
],
"speech_text": [
{
"asset_id": "welcome_line",
"text": "Welcome back. I saved your place."
}
],
"visual_prompts": [
{
"asset_id": "wave_small",
"prompt": "smile and give a small wave"
}
]
},
"conversation": {
"tools": [
{
"type": "function",
"name": "lookup_product",
"description": "Look up product details by product id.",
"parameters": {
"type": "object",
"properties": {
"product_id": {
"type": "string"
}
},
"required": [
"product_id"
]
}
}
],
"response_defaults": {
"temperature": 0.7,
"max_output_tokens": 512
},
"turn_detection": {
"type": "server_vad",
"silence_duration_ms": 500
},
"input_audio_transcription": {
"enabled": true,
"language": "auto"
}
},
"avatars": [
{
"avatar_id": "host_a",
"persona": "You are Host A, a warm livestream host who gives concise product-focused replies.",
"visual": {
"source_images": [
{
"source_image_id": "front",
"url": "https://cdn.example.com/avatars/host-a-front.png",
"description": "A woman facing the camera in a brightly lit studio, front view.",
"media_type": "image/png"
},
{
"source_image_id": "side",
"url": "https://cdn.example.com/avatars/host-a-side.png",
"description": "The same woman in the same studio, side view.",
"media_type": "image/png"
}
],
"default_source_image_id": "front"
}
},
{
"avatar_id": "host_b",
"persona": "You are Host B, a calm expert who gives brief technical explanations.",
"visual": {
"source_images": [
{
"source_image_id": "front",
"url": "https://cdn.example.com/avatars/host-b-front.png",
"description": "A man facing the camera in a brightly lit studio, front view.",
"media_type": "image/png"
}
],
"default_source_image_id": "front"
}
}
],
"model": "vivix-a1-stream",
"expires_at": "2026-07-16T10:05:00Z",
"closed_at": "2026-07-16T10:04:10Z",
"close_reason": "user_requested"
}
}错误
错误
会话端点可能返回的错误码请参阅会话错误。