Skip to main content
POST
Create Session
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.
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.
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.

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
image_fit
object

How Vivix fits each starting image to the video avatar session frame. A session value overrides the saved character setting.

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.

pipeline_config
object

Session-wide speech recognition, speech synthesis, dialogue model, and audio rendering settings. These settings are fixed at session creation.

conversation
object

Initial conversational defaults for tools, turn handling, and response generation.

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.

delivery
object

Media transport and delivery settings. Defaults to TRTC when omitted.

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.

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