Overview
Non-real-time interactive character (video file version): Input a character image plus an audio clip (or the text to speak) to generate a talking video with aligned lip movements and body motion. The entire process is asynchronous and task-based, involving no RTC, WebSocket, or real-time streaming.
Minimal Integration Flow
Create a Task
After obtaining your API Key from the workspace, you can create a task.
Request example
image is required; at least one of audio and text must be provided. If both are provided, audio takes precedence.
timeline is the action timeline. It accepts an array of text and time ranges to control the character's movements.
Poll the Task Status
Use the task_id returned in Step 1 to query the task status:
statehas 5 possible values:created/queueing/processingare intermediate states, and polling should continue;successandfailedare terminal states. Make sure to implement thefailedbranch — the failure reason is provided inerr_codeanderr_msg.- A polling interval of 3–5 seconds to start, with gradual back-off, is recommended. Do not poll in a high-frequency busy loop, otherwise
TooManyRequestsmay be triggered. Readcreations[]only afterstate=success; reading it too early may return an empty array. - In practice, video generation takes roughly 40 seconds to 2 minutes (see "Task Duration and Polling Recommendations" in the "Detailed Parameters" document). A total timeout of 5 minutes is recommended. Do not use
progressto judge whether a task is stuck — it rises in steps and stays at 99 for a long time, and only turns 100 once the task enterssuccess/failed.
Download the Artifacts
creations[].url is the video download URL, cover_url is the cover image, and watermarked_url is the watermarked version. Artifact URLs are valid for 24 hours.
Interface Protocol Overview
End-to-End Integration Flow
- Obtain the API Key
- Prepare the character image and
audio(or thetextto speak) - Call "Create a Task" to obtain the
task_id - Poll "Query Task" until
statereaches a terminal state - When
state=success, download the video fromcreations[].url; whenstate=failed, readerr_codeanderr_msgto determine the failure reason.
API Overview
The table below lists all public APIs involved in this version. All APIs require Authorization: Token vda_xxx.
| Method | Path | Purpose |
|---|---|---|
| POST | /ent/s_avatar/offline | Create a character video generation task |
| GET | /ent/v2/tasks/{task_id}/creations | Query the task status and artifacts |
| POST | Business-provided callback_url | Optional. Vidu sends a callback notification when the task state changes |
General Conventions
| Item | Convention |
|---|---|
{host} | {host} is the domain name, excluding the protocol. It is api.vidu.cn for the mainland China environment and api.vidu.com for the overseas environment. All APIs use https://{host}. |
| Authentication | All HTTP APIs require Authorization: Token vda_xxx. |
| JSON fields | Request and response fields use snake_case, e.g., task_id, callback_url, wm_position, created_at. |
| Asset input | Both image and audio support three forms — a public URL, base64 (must include the MIME prefix), and ssupload:?id=<asset_id>. Any one of them may be used. |
| Artifact validity | url, cover_url, and watermarked_url in creations[] are valid for 24 hours and must be saved to your own storage. |