video_id, poll the task status, and fetch the playable video URL once the task completes. Material is uploaded first, so the whole flow touches three endpoints:
POST /v1/files/images/POST /v1/files/audios— upload the first-frame image and the audio material, and keep the returnedurl;POST /v1/videos/generations— submit a generation task;GET /v1/videos/generations/{video_id}— query the task status and result.
Model Selection
A1 video generation selects its model with themodel field of the request body:
For first-frame image sizes, see Material Upload.
Voice Source
Provide one of the two:audio or audio_data for voice audio you already have, or dialogue + voice_id to synthesize speech on the server (set the provider in tts_config). In multi-segment requests, configure the voice source inside each segment (audio_url / audio_data for a2v, or dialogue + voice_id for ta2v). For voice ids, see Choose a voice and Clone Voice.
Material Upload
Upload the first-frame image and the audio material to your workspace first, then pass theurl from the upload response in first_frame_image and audio (or segments[].audio_url in multi-segment requests).
POST /v1/files/images— the first-frame image, up to 10MB per file;POST /v1/files/audios— the driving audio, up to 10MB per file.
Multi-Segment Generation
By default,POST /v1/videos/generations generates a single video clip from the root-level fields (prompt, first_frame_image, and either audio / audio_data or dialogue + voice_id).
To combine multiple speaking turns and silent listening pauses into a single continuous output video (playback_url), pass the segments array (1 to 20 segments per request). Each item in segments defines its own mode and prompt:
Key rules when
segments is provided:
- Default vs. per-segment
first_frame_image: Setfirst_frame_imageat the root level as the default reference image for the task. Segments that omitfirst_frame_imageautomatically inherit the rootfirst_frame_image; you can also setfirst_frame_imageon a specific segment to switch to a different reference image for that segment. - No root-level speech inputs: Place all prompts (
prompt), audio (audio_url,audio_data), and dialogue (dialogue,voice_id,tts_config) inside the corresponding items ofsegments. Settingaudio,audio_data, ordialogueat the root level alongsidesegmentsreturns HTTP 422 (code = 30004). - Audio URL field name: Inside
segments[], pass the audio URL inaudio_url(whereas single-segment requests useaudioat the root level). - Voice configuration in
ta2vsegments: When a segment usesmode: "ta2v"withdialogue,voice_idis required on that segment. Pass a provider voice ID from Choose a voice along with the matchingtts_config.
Calling Conventions
The conventions below apply to every endpoint in this group.Base URL
https://api.vivix.ai
Authentication
Every request must carry an API key:Authorization: Bearer $VIVIX_API_KEY.
Response Envelope
Every REST response is wrapped in a{code, message, data} envelope, and all business fields live in data:
Response envelope
code = 0means success; any non-zero value means failure (the HTTP status code is derived from the mapping ofcode, see Error Codes).- JSON fields use
snake_case; 64-bit integers may be returned as strings, for example"cost_time_ms": "16562".
Business Errors
Business errors from task-submission endpoints usually surface as HTTP 200 withdata.error_code != 0. To decide whether a submission succeeded, check both the outer code and data.error_code. Authentication failures return HTTP 401/403 directly.
Task Lifecycle
The complete lifecycle of a generation task:- Submit:
POST /v1/videos/generations. On success the response carries avideo_idand the task entersqueued. - Poll: check the task status with
GET /v1/videos/generations/{video_id}. - Terminal state: when the status is
succeeded, fetch the video fromplayback_url; stop polling onfailed/timeout.
Submit a Generation Task
Submits a single-segment or multi-segment video generation task. POST/v1/videos/generations
Body Parameters
Main video prompt describing the shot and the performance. Required for single-segment requests; when
segments is provided, specify prompt inside each segment instead.Character first-frame image URL. Required; for the expected size see Material Upload. In multi-segment requests, this root field serves as the default reference image across all items in
segments.TTS dialogue text for a single-segment dialogue request. Cannot be combined with
segments (set dialogue inside segments[] instead).Voice id for a single-segment dialogue request; see Voice Source.
Audio URL for a single-segment audio request. Send at most one of
audio or audio_data. Cannot be combined with segments (set audio_url inside segments[] instead).Base64-encoded audio for a single-segment audio request. Send at most one of
audio or audio_data. Cannot be combined with segments (set audio_data inside segments[] instead).Ordered list of segments (
1 to 20 items) for multi-segment generation. All segments are rendered in sequence into a single output video (playback_url). When segments is provided, do not set audio, audio_data, or dialogue at the root level.Response Fields
Fields of the responsedata object:
Dialogue request (server-side TTS)
Audio request
Multi-segment request
Response
Query Task Status
Queries the status of a video generation task. See Task Lifecycle for how to interpret each status. GET/v1/videos/generations/{video_id}
Path Parameters
Response Fields
The responsedata.items is a list of tasks (an empty list means the task has not been written yet or does not exist). Each item has the following fields:
Duration of the generated video in milliseconds (for multi-segment tasks, the total duration across all segments);
0 while the task is still in progress.Request
Response
Error Codes
Error responses share a single format, withdata set to null:
Error response
code = 0 means success; any non-zero value means failure, and the HTTP status code is derived from the mapping of code. Common error codes for video generation:
Two error layers. The outer
code is an API-level error. Task-level business errors usually surface as HTTP 200 with an outer code = 0, but data.error_code != 0 (submit endpoint) or status = failed / timeout (query endpoint).X-Request-Id and X-Trace-Id response headers so the request can be located in the pipeline logs.