Wan 3.0 Video API
Model Introduction
Wan 3.0 generates video from text, first-frame or first-and-last-frame images, and reference images, videos, or audio. Files and web pages can also supply source material. The same endpoint handles text-to-video, image-to-video, and reference-to-video requests.
| Model | Description |
|---|---|
wan3.0-video | Standard version |
wan3.0-video-prime | Faster version with the same request format |
Generation is asynchronous: create a task, save output.task_id, then query its status. Once it succeeds, retrieve the video from output.video_url.
API Overview
| Item | Value |
|---|---|
| Base URL | https://api.exchangetoken.ai |
| Create task | POST /api/v1/services/aigc/video-generation/video-synthesis |
| Query task | GET /api/v1/tasks/{task_id} |
| Authentication | Authorization: Bearer YOUR_API_KEY |
| Create request format | Content-Type: application/json |
Replace YOUR_API_KEY with an API key from the Exchange Token console. Use the same API key to create and query a task.
Create a Video Generation Task
POST https://api.exchangetoken.ai/api/v1/services/aigc/video-generation/video-synthesisRequest Fields
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | wan3.0-video or wan3.0-video-prime |
input | object | Yes | Provide at least one of prompt or media |
input.prompt | string | Conditional | Describe the scene, action, camera movement, or sound |
input.media | object[] | Conditional | Media items, each with type and url |
parameters | object | No | Generation settings, listed below |
Generation Parameters
Place these fields inside the parameters object.
The values and defaults below describe Bailian's parameter contract; the upstream service validates them. Exchange Token retains model routing permissions and billing configuration checks.
| Field | Type | Default | Description |
|---|---|---|---|
resolution | string | 1080P | 480P, 720P, or 1080P; uppercase P |
duration | integer | 5 | Output seconds: 2–30, or -1 for automatic duration |
ratio | string | adaptive | adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, or 9:16 |
audio | boolean | true | Generate sound |
prompt_extend | boolean | true | Rewrite the prompt; required for file or link |
seed | integer | -1 | Random (-1) or 0–2147483647; results may vary |
watermark | boolean | false | Add a watermark |
Input and output video must total at most 30 seconds. For automatic duration, read the actual duration from the query response.
Media and Generation Scenarios
| Scenario | type in input.media | Usage |
|---|---|---|
| Text-to-video | Omit media | Describe the video in input.prompt |
| First-frame image-to-video | first_frame | One starting image |
| First-and-last-frame image-to-video | first_frame + last_frame | One image per endpoint |
| Reference-to-video | reference_image, reference_video, reference_audio | Combine reference media |
| File or web page | file or link | Choose one; references allowed; enable prompt_extend |
Do not mix frame inputs with references, files, or links. Use publicly accessible HTTP(S) URLs; images also accept Base64 Data URLs. For format, size, count, and duration limits, see the official media parameter reference.
Text-to-Video Example
Replace YOUR_API_KEY with your Exchange Token API key. This example requests a five-second 720P video with sound.
curl -sS -X POST "https://api.exchangetoken.ai/api/v1/services/aigc/video-generation/video-synthesis" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "A white sailboat glides along the coast at sunrise. The camera follows smoothly as sunlight catches the water, with gentle sounds of waves."
},
"parameters": {
"resolution": "720P",
"duration": 5,
"ratio": "16:9",
"audio": true
}
}'To use the faster version, change model to wan3.0-video-prime.
First-and-Last-Frame Example
Replace the https://example.com/... placeholders with publicly accessible media URLs that meet the input limits. For a first-frame-only request, remove the last_frame item.
curl -sS -X POST "https://api.exchangetoken.ai/api/v1/services/aigc/video-generation/video-synthesis" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "The camera slowly moves closer as the flower bud opens, transitioning naturally into the full bloom shown in the last frame.",
"media": [
{"type": "first_frame", "url": "https://example.com/first-frame.jpg"},
{"type": "last_frame", "url": "https://example.com/last-frame.jpg"}
]
},
"parameters": {
"resolution": "720P",
"duration": 5,
"ratio": "adaptive"
}
}'Reference-to-Video Example
This example supplies an image, a video, and an audio reference. The prompt uses 图1, 视频1, and 音频1 to refer to the first image, video, and audio item respectively; each media type is numbered independently.
curl -sS -X POST "https://api.exchangetoken.ai/api/v1/services/aigc/video-generation/video-synthesis" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video-prime",
"input": {
"prompt": "Animate the character in 图1 using the movement from 视频1 and the voice from 音频1. Keep the character appearance consistent.",
"media": [
{"type": "reference_image", "url": "https://example.com/character.jpg"},
{"type": "reference_video", "url": "https://example.com/motion.mp4"},
{"type": "reference_audio", "url": "https://example.com/voice.mp3"}
]
},
"parameters": {
"resolution": "720P",
"duration": 5,
"ratio": "16:9",
"audio": true
}
}'Create Response
{
"output": {
"task_id": "sg_vid_xxxxxxxxxxxxxxxx",
"task_status": "PENDING"
},
"request_id": "request_xxxxxxxxxxxxxxxx"
}Save output.task_id and start querying. request_id is for troubleshooting and cannot replace the task ID. Once you have a task ID, query that task: repeating the create request creates another task.
Query a Task and Retrieve the Result
Replace the ID in the path with output.task_id from the create response. Use the API key that created the task.
curl -sS "https://api.exchangetoken.ai/api/v1/tasks/sg_vid_xxxxxxxxxxxxxxxx" \
-H "Authorization: Bearer YOUR_API_KEY"Poll every 15 seconds and set an application waiting limit. Continue while the status is PENDING or RUNNING. If your waiting limit is reached, keep the task ID to resume querying later.
Task Statuses
output.task_status | Meaning and action |
|---|---|
PENDING | Queued; continue polling |
RUNNING | Generating; continue polling |
SUCCEEDED | Complete; read output.video_url |
FAILED | Failed; inspect output.code, if present, and output.message |
CANCELED | Canceled; stop polling |
UNKNOWN | The provider reports a missing task or unknown state; stop polling and investigate |
HTTP 200 means the query succeeded. Check output.task_status to determine whether video generation succeeded.
Successful Response Example
This example includes 2.25 seconds of input reference video and 5 seconds of output video.
{
"request_id": "request_xxxxxxxxxxxxxxxx",
"output": {
"task_id": "sg_vid_xxxxxxxxxxxxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://example.com/generated-video.mp4"
},
"usage": {
"video_count": 1,
"duration": 7.25,
"input_video_duration": 2.25,
"output_video_duration": 5,
"SR": 720,
"fps": 30,
"ratio": "16:9"
}
}Responses may also include output.submit_time, output.scheduled_time, output.end_time, and output.orig_prompt. The video URL is temporary; download or copy the result to your storage promptly.
Usage and Billing
The usage object in a successful result contains actual video usage. Usage may be unavailable while a task is pending or running.
| Field | Description |
|---|---|
usage.video_count | Number of generated videos |
usage.duration | Total billable seconds, including input reference video and output video; fractional values are supported |
usage.input_video_duration | Input reference video seconds; 0 without video input |
usage.output_video_duration | Actual output video seconds |
usage.SR | Actual resolution tier, such as 480, 720, or 1080; the field name is uppercase |
usage.fps | Output frame rate |
usage.ratio | Output aspect ratio |
Only successful tasks are billed. Querying a task adds no generation charge. Charges use the selected model, actual resolution, and usage.duration; the audio toggle does not change the unit price. Do not substitute the requested parameters.duration for actual usage or add input video seconds to usage.duration again. The example above has 7.25 billable seconds.
Failed Task Example
{
"output": {
"task_id": "sg_vid_xxxxxxxxxxxxxxxx",
"task_status": "FAILED",
"message": "Video generation failed."
}
}Task failure details appear inside output. An output.code field is also returned when a specific error code is available.
Request Errors
Platform Validation Errors
Errors generated by Exchange Token, such as an invalid platform API key, insufficient balance, or missing billing configuration, use this format. This example is returned with HTTP 503:
{
"error": {
"type": "billing_unavailable",
"message": "media billing configuration unavailable for routed model"
}
}For HTTP 404, check the full task ID and confirm you are using the API key that created the task. For parameter errors, check the model name, resolution capitalization, duration, and media combination.
Upstream Task Creation Errors
The current Wan 3.0 create endpoint also wraps Bailian request errors in an error object: the upstream code becomes error.type, and message becomes error.message. For example, a rate limit error can produce:
{
"error": {
"type": "Throttling",
"message": "rate limited"
}
}Non-2xx upstream HTTP status codes are preserved. An upstream 2xx response containing an error code is returned as HTTP 502. Missing or unparseable error fields use platform fallback values. Other top-level upstream fields, such as request_id, are not passed through in this error response.
This differs from generation failure after task creation: query responses report that through output.task_status, output.code, and output.message, as shown in the failed task example above.
Reference
For model parameters and media limits, see the official Bailian Wan 3.0 API reference. When integrating through Exchange Token, use the domain, platform API key, and task query flow on this page.
