Other Generating
POST https://api.vidu.com/ent/v2/replace
Field
value
Description
Content-Type
application/json
Data Exchange Format
Authorization
Token {your api key}
Replace {} with your API key
Field
Type
Required
Description
video_url
String
Required
URL of the source video in which the main object will be replaced.
Notes:
1. Video duration must be between 2–10 seconds.(duration < 10s)
2. Video resolution should be between 480p–1080p.
object
String
Required
Description of the original subject to be replaced in the video.
Maximum 100 characters, e.g. "blue dress".
image
String
Required
URL of the replacement subject image.
Note:
- Only accepts 1 image
- Accepts public URL or Base64 format.
- Supported formats: png, jpeg, jpg, webp
- The aspect ratio of the images must be less than 1:4 or 4:1,image is limited to 50MB
- Image resolution should be between 360p–1080p.
- The post body of the HTTP request should not exceed 20MB, and it must include an appropriate content type string. For instance,
data:image/png;base64,{base64_encode}
prompt
String
Optional
Description of the desired generated video content.
Maximum 2000 characters.
start_from
Int
Optional
The second (in seconds) from which to start generating the replacement video.
payload
String
Optional
Pass-through parameter.
No processing applied; used only for data transfer.
Maximum 1,048,576 characters.
callback_url
String
Optional
Callback
When creating a task, you need to actively set the callback_url with a POST request. When the video generation task changes its status, Vidu will send a callback request to this URL, containing the latest status of the task. The structure of the callback request content will be the same as the return body of the GET Generation API.
The "status" in the callback response includes the following states:
- processing: Task is being processed.
- success: Task is completed (if sending fails, it will retry the callback three times).
- failed: Task failed (if sending fails, it will retry the callback three times).
Vidu uses a callback signature algorithm for verification, check out the details here: Callback Signature
Field
Type
Description
task_id
String
Task ID
state
String
It will be returned to a specific processing state:
- created created task successfully
- queueing task in queue
- processing processing
- success generation successful
- failedtask failed
video_url
String
The original video URL used for this replacement call.
object
String
The subject description used for this replacement call.
image
String
The image used for this call.
prompt
String
Prompt text used for this call.
duration
Int
Duration of the resulting video.
payload
String
Pass-through parameter content.
credits
Int
Credits used for this call.
created_at
String
Task creation time.
{
    "task_id": "your_task_id",
    "state": "success",
    "video_url": "your_video_url",
    "object": "your_object",
    "image": "your_images",
    "prompt": "your_prompt",
    "duration": 7,
    "credits": 6,
    "created_at": "2025-01-01T06:48:29.368745805Z",
    "payload": ""
}