Generate Videos/Images
Generate Video with Avatar
The resources (image, video) generated by our API are valid for 7 days. Please save the relevant resources as soon as possible to prevent expiration.
Generate video from avatar
Start with the API
POST https://devapi.vidnoz.com/v2/task/avatar-to-video
Request Headers
Parameter | Required | Type | Description |
---|---|---|---|
Content-Type | true | string | Data Tranmission Type: multipart/form-data |
Request Attributes
Parameter | Required | Type | Description |
---|---|---|---|
name | false | string | Specify the video name. If not specified, it will be randomly generated. |
aspect | false | int | Specify the aspect ratio: 1=16:9 (default); 2=9:16; 3=1:1 |
avatar | true | obj | Avatar Settings |
avatar.id | true | string | Avatar ID |
avatar.style | false | int | Avatar display mode: 1 = distant view/full body (default); 2 = close view/half body; 3 = close view/round |
avatar.circle_bgcolor | false | string | When the avatar display mode is 3, the background color inside the circle, default: #ffffff |
avatar.scale | false | float | Scale the avatar based on the default size: the default is 1.0; greater than 1.0 is enlarged; less than 1.0 is reduced |
avatar.offset | false | obj | Adjust the avatar offset based on the default position (center of the screen) |
avatar.offset.x | false | int | Horizontal offset value (unit: pixel): the default is 0; less than 0 means offset to the left; greater than 0 means offset to the right |
avatar.offset.y | false | int | Vertical offset value (unit: pixel): The default is 0; less than 0 means upward offset; greater than 0 means downward offset |
voice | true | obj | Voice settings, choose one of the following three modes (voice.tts;voice.file;voice.silence) |
voice.tts | false | obj | Synthesize speech via TTS |
voice.tts.id | false | string | Specify the voice ID |
voice.tts.text | false | string | Enter text |
voice.tts.speed | false | float | Adjustable speech speed, range: 0.5~1.5, default: 1.0 |
voice.tts.pitch | false | int | Adjustable tone, range: -50~50, default: 0 |
voice.tts.emotion | false | string | Optional emotions, such as:normal,happy,sad,cheerful,chat...... |
voice.file | false | obj | Directly provide audio files |
voice.file.asset_id | false | string | Specify the attachment ID |
voice.file.url | false | string | Specify the file link |
voice.silence | false | obj | No Voice |
voice.silence.duration | false | int | Specify duration, unit: second, range: 1~99, default: 1 |
backround | true | obj | Background Settings |
backround.color | false | string | Background color value, default: #ffffff. If background.media is set at the same time, the background color will be overwritten. |
backround.media | false | obj | Use a picture or a video as background |
backround.media.asset_id | false | string | Specify the attachment ID (either asset_id or url) |
backround.media.url | false | string | Specify the file link (either asset_id or url) |
backround.media.fit | false | int | Fitting mode: 0=contain (fill in proportion and leave blank, default); 1=cover (fill in proportion and leave blank) |
backround.media.loop | false | bool | Whether to loop the video, default: false |
Response Attributes
Parameter | Type | Description |
---|---|---|
code | int | 200 |
message | string | Task Remark |
data | obj | Task Object |
data.task_id | string | Task ID |
Example
Request Attributes
curl --request POST \
--url https://devapi.vidnoz.com/v2/task/avatar-to-video \
--header "accept: application/json" \
--header "content-type: multipart/form-data" \
--header "Authorization: Bearer $API_KEY" \
--form 'name="YmUxSTFBcVA1V1A3N2Y3L2hxMHhGQT09"' \
--form 'aspect=1' \
--form 'avatar[id]="Rk1nN090NnZQWXlSZW5oSHJlSlhWdz09";type=application/json' \
--form 'avatar[style]=3;type=application/json' \
--form 'avatar[circle_bgcolor]="#ffffff";type=application/json' \
--form 'avatar[scale]=1.0;type=application/json' \
--form 'avatar[offset][x]=0;type=application/json' \
--form 'avatar[offset][y]=0;type=application/json' \
--form 'voice[tts][id]="d0VWUk5SU056NEwwMlRsem5vNVROYlpCc3FGY25CY0xBa3VIeWtLUkRyMD0=";type=application/json' \
--form 'voice[tts][text]="voice text to speech text";type=application/json' \
--form 'voice[tts][speed]=1.0;type=application/json' \
--form 'voice[tts][pitch]=0;type=application/json' \
--form 'voice[tts][emotion]="normal";type=application/json' \
--form 'voice[file][asset_id]="154";type=application/json' \
--form 'voice[file][url]="https://static-alter1.vidnoz.com/system/asset/202308/64db429bb8f6f.wav";type=application/json' \
--form 'voice[silence][duration]=1;type=application/json' \
--form 'background[color]="#ffffff";type=application/json' \
--form 'background[media][asset_id]="cHpWR3VKRGhMamtrc05XWGRLUmpwQT09";type=application/json' \
--form 'background[media][url]="https://r2-aivid-000-prod.214dcedd27630abef236dcb67de0ce92.r2.cloudflarestorage.com/10/asset/202503/67ca53930a553.jpg?response-content-disposition=attachment%3B%20filename%3Ddowsssn55.jpg&response-content-type=image%2Fjpeg&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=91ac9d3ee865be05c575d38c9bdd1275%2F20250313%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250313T031916Z&X-Amz-SignedHeaders=host&X-Amz-Expires=604800&X-Amz-Signature=aebd39f82b2970644fe2394f39d6a71ec7ea7a0a71c438d82d52ceede84f34d0";type=application/json' \
--form 'background[media][fit]=1;type=application/json' \
--form 'background[media][loop]="false";type=application/json' \
Response Attributes
{
"code": 200,
"message": "ok",
"data": {
"task_id": "OFZ2WS8wNWF6cGNURWVOVnpTUWNPdz09"
}
}