Detailed Parameters
Version History
| Date | Update Summary |
|---|---|
| 2026-10-16 | Added the offline video editing endpoint description: create a task via POST /ent/s_editing/offline, query the task and output, and error codes. |
Create a Task
Submit a source video together with a set of scene switches arranged along the video timeline, and asynchronously generate an MP4. The output resolution is 540p, 24fps; width/height and orientation match the source video; the output duration equals the source video duration (it is neither padded nor truncated).
Request example
Response example
Request Parameters
modelstringModel identifier, defaults to
vidu-s2-editingvideostringRequiredRequired. Source video address (an HTTP(S) GET URL or an
ssuploadid); base64 is not supported. Must be MP4 / H.264, 540p (short side 540 px), 24fps, ≤1 GiB, ≤30 minutes.actionsobject[]RequiredRequired. List of scene switches, 1–64 items; see “
actions[] Object Fields” below.watermarkboolOptionalOptional. Whether to add a watermark, defaults to true.
wm_positionenumPosition of the “AI-generated content” label in the frame; only effective when watermark=true. Options: top_left, top_right, bottom_left, bottom_right; default: bottom_right. Note: this field controls the position of the AI-generated compliance label; the Vidu brand watermark is fixed in the bottom-right corner and is not affected by this field. An invalid enum value causes the request to return 400; when omitted, the default position is used.
wm_urlstringOptionalOptional. Custom watermark image URL (HTTP(S)).
callback_urlstringOptionalOptional. Callback URL for the result.
payloadstringOptionalOptional. Pass-through field, returned as-is in the callback.
meta_datastringOptionalOptional. Pass-through metadata.
actions[] Object Fields
time_snumberThe time, in seconds (decimals allowed), on the source video timeline at which the switch is triggered. The first item must be 0, and subsequent items must strictly increase.
image_uristringThe reference image address for this scene (an HTTP(S) URL, an
ssuploadid, or a base64 data URI).editing_typeenumOptionalOptional; the scene type. See “
editing_type Enum Values” below; defaults to style_transfer when omitted.editing_type Enum Values
| Value | Scenario | Reference Image Meaning |
|---|---|---|
style_transfer | Style transfer | Target visual style |
virtual_tryon | Virtual try-on | Target garment |
subject_replacement | Subject replacement | Target subject |
background_replacement | Background replacement | Target background |
Rules:
actionsmust have 1–64 items; a non-zero firsttime_s, a non-strictly-increasing sequence, or an emptyimage_uriall return 400. Whenediting_typeis omitted or defaults tounspecified, it is treated asstyle_transfer; an unknown value returns 400.time_smarks the moment the switch is triggered; the moment it actually takes effect in the output may be slightly later (roughly 1–2 seconds), and frame-exact timing is not guaranteed.- An item whose trigger time is ≥ the output duration is ignored (it does not affect task success); a new scene replaces the current one and persists until the next item or the end of the output.
Response Parameters
| Field | Description |
|---|---|
task_id | Task ID. |
state | State; created on successful creation. |
model | Model echoed back. |
credits | Returns 0 at creation time; the actual deduction happens within the task workflow, based on source video duration × 1.5, and is reflected when querying the task. |
payload | Pass-through value echoed back. |
created_at | Creation time. |
resolution | Output resolution (fixed at 540p). |
Query the Task and Retrieve the Output
- Task status:
GET /ent/v2/tasks(can be filtered by task ID); terminal states aresuccess/failed. - Output:
GET /ent/v2/tasks/{task_id}/creations, returns the output video address (plus cover/last-frame images).
Error Codes
| Scenario | HTTP | Description |
|---|---|---|
actions structure invalid | 400 | Returns the specific field error. |
Missing video | 400 | video is required. |
model invalid | 400 | The model is not registered. |
| Insufficient credits | 402 | INSUFFICIENT_CREDIT |
| Source video does not meet spec / asset not downloadable / inference or upload failed | 200 on creation, failed on polling | err_code is OFFLINE_EDITING_* |
| Input asset or output failed moderation | 200 on creation, failed on polling / output moderation failure | — |
Pricing
- Billed by video duration: 1 credit per second (RMB 0.03125), with the duration rounded up from the actual duration of the input video.
- A task cannot be initiated when the balance falls below 45 credits (about RMB 1.4).
- When credits are deducted: the create endpoint only performs a balance pre-check and does not deduct credits; once the task enters the queue, credits are pre-deducted in one go based on the estimated duration. If the task fails or produces no output, the unconsumed portion is refunded automatically; the final deduction is the
creditsvalue returned by the query endpoint (0whenfailed).