v1

latestOpenAPI 3.0.32026-07-26214565.6 KB
Session Management

Create Session

Create a new streaming avatar session

post/api/open/v4/liveAvatar/session/create

Request body

avatar_idstring required

Digital human model in real-time avatar. If you want to use a custom uploaded video, you need to call the avatar/create interface to create a template. This process takes some time to process. You can check the processing status through the avatar/detail interface. When status=3, you can use the avatar_id field to pass it in.

durationnumber

Session duration in seconds (max: 3600). Credits are pre-charged for the full duration, but any unused credits will be refunded after the session ends. Rates depend on your subscription plan.

knowledge_idstring

Knowledge base ID to provide context for AI responses. Create and manage knowledge bases using the Knowledge Base API. When provided, the AI will use documents and URLs from the knowledge base to enhance response accuracy.

voice_idstring

Voice ID to change avatar's voice. Get valid IDs from Voice List API. Note that voice IDs from Akool Multilingual 2 cannot be used with Streaming Avatar.

voice_urlstring

Custom voice model URL. Get valid URLs from Voice List API

languagestring

Language code to use for the session. Get valid codes from Language List API

mode_type1 | 2

Avatar interaction mode that determines how the avatar responds to input:

  • 1: Retelling mode - Avatar repeats the provided content verbatim
  • 2: Dialogue mode - Avatar engages in conversational interaction
scene_mode'fast_dialogue'

Scene mode for the session.

  • fast_dialogue: Low-latency dialogue mode. Optimized for realtime voice interaction and voice input only.
e2e_type'openai'

End-to-end (E2E) pipeline provider. Only applicable when scene_mode is fast_dialogue.

  • openai: OpenAI
background_urlstring

URL of background image/video for avatar scene

stream_type'agora' | 'livekit' | 'trtc'

Stream type to use for the session. "agora" = Agora (default), "livekit" = Livekit, "trtc" = TRTC

Example request

{
  "voice_params": {
    "minimax_settings": {
      "model": "speech-2.8-turbo",
      "language_boost": "auto",
      "voice_setting": {
        "voice_id": "English_Gentle-voiced_man",
        "speed": 1,
        "vol": 1,
        "emotion": "angry"
      }
    }
  }
}

Response

Session created successfully

codeinteger required

Interface returns business status code (1000: success)

msgstring required

Interface returns status information

Example response

{
  "code": 1000,
  "msg": "OK"
}