Vidu Generic Video Format
Call Vidu Q2 and Q3 with /v1/videos, map images, seconds, size, and metadata.vidu_operation, and query generic results.
Create JSON tasks with POST /v1/videos or POST /v1/video/generations, using your ModelSell Bearer API Key. See the overview for enabled models and operations.
Q3 image to video
curl --max-time 300 "$MODELSELL_BASE_URL/v1/videos" \
-H "Authorization: Bearer $MODELSELL_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "viduq3-turbo",
"prompt": "The camera slowly pulls back as the person in the reference image waves.",
"images": ["https://example.com/first-frame.png"],
"seconds": "5",
"size": "720p",
"metadata": {
"vidu_operation": "img2video",
"audio": false,
"is_rec": false,
"watermark": false,
"seed": 0
}
}'Set environment variables as shown in Base URL and Authentication, then replace the image URL. Generic creation returns the public task ID in id:
{
"id": "task_example_vidu",
"object": "video",
"model": "viduq3-turbo",
"status": "queued"
}Common field mapping
| Generic field | Vidu upstream field | Notes |
|---|---|---|
model | model | Use an authorized model name |
prompt | prompt | Video description; required for reference generation |
images | images | Image URL / data URI array; preserve first/last-frame order |
seconds | duration | Examples use string "5", converted to integer seconds |
size | resolution | A supported tier such as 720p |
Listed metadata fields | Corresponding top-level fields | See below |
Native duration is an integer; generic examples use a string seconds. Do not mix response formats or use pixel dimensions such as 1920x1080 for this resolution tier.
Select an operation explicitly
Set metadata.vidu_operation:
| Value | Images | Requirement |
|---|---|---|
text2video | None | Model supports text to video |
img2video | One first frame | Model supports image to video |
start-end2video | Two images, first then last | Model supports first/last frames |
reference2video | Reference images | Model and channel support reference generation |
When omitted, routing generally follows image count: one image selects image-to-video, two select first/last frames, and more images select references. Multiple Q4 images select references. Automatic selection does not add model capabilities. Set the operation explicitly, especially for a single viduq2 reference image or two images intended as references.
A single Q2 reference image
This model supports reference generation; choose reference2video explicitly:
{
"model": "viduq2",
"prompt": "Keep the reference teapot's design and create a product video in warm morning light.",
"images": ["https://example.com/teapot.png"],
"seconds": "5",
"size": "720p",
"metadata": {
"vidu_operation": "reference2video",
"aspect_ratio": "16:9",
"audio": false,
"watermark": false
}
}For text generation, remove images, choose a text-capable model, and select text2video. For first/last frames, provide two images and select start-end2video. Q4 examples apply only after model and channel access is enabled; changing the operation cannot bypass model limits.
Vidu extension parameters
Generic requests map these fields from metadata:
resolution, aspect_ratio, audio, is_rec, seed, off_peak, watermark, wm_position, wm_url, payload, meta_data, callback_url, sounds, subjects, auto_subjects.
vidu_operation selects the path. When size is omitted, metadata.resolution can specify the resolution. Explicit false and 0 values retain their meaning; meta_data must remain a JSON-encoded string. See Request Parameters for types, ranges, and availability. Do not use off_peak: true on current channels; use is_rec: false for Q3.
metadata is not an arbitrary provider-field pass-through. For Q2 bgm, movement_amplitude, voice_id, or new native fields, use the /ent/v2/... native format and confirm model and channel support.
Query the generic result
Use the actual id from creation:
export TASK_ID="<returned-task-id>"
curl --max-time 300 "$MODELSELL_BASE_URL/v1/videos/$TASK_ID" \
-H "Authorization: Bearer $MODELSELL_API_KEY"Generic status is queued, in_progress, completed, or failed. On success, read video_url or metadata.url; the cover is metadata.cover_url, and complete creations are in metadata.creations:
{
"id": "task_example_vidu",
"object": "video",
"model": "viduq3-turbo",
"status": "completed",
"progress": 100,
"video_url": "https://example.com/generated-video.mp4",
"metadata": {
"url": "https://example.com/generated-video.mp4",
"cover_url": "https://example.com/cover.jpg",
"credits": 35
}
}Credits are metering information; the illustrative value is not a fixed price. Queries do not incur another generation charge. Download results before their URLs expire. If a task fails, retain its error information and public ID; do not recreate it merely because generation takes longer than expected.
Query Task
传入创建响应中的 ModelSell 公共 task_id,使用创建任务的同一 ModelSell API Key。不能替换为供应商内部 ID 或回调中的 ID。 查询响应的顶层任务 ID 字段为 id;创建响应则为 task_id。state 为 success 时,从 creations[].url 读取视频地址;failed 时读取 err_code。 created、queueing、processing 为未完成状态,建议每 10–15 秒有界轮询。视频、封面和水印视频链接通常有效 24 小时,请及时下载或转存。 查询不重复收费。callback_url 由供应商执行,回调 ID 不保证与公共 ID 一致;仍以公共 ID 的查询结果为准。
Python Polling and Download
Next Page