Skip to content

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.

ModelDescription
wan3.0-videoStandard version
wan3.0-video-primeFaster 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 ​

ItemValue
Base URLhttps://api.exchangetoken.ai
Create taskPOST /api/v1/services/aigc/video-generation/video-synthesis
Query taskGET /api/v1/tasks/{task_id}
AuthenticationAuthorization: Bearer YOUR_API_KEY
Create request formatContent-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 ​

http
POST https://api.exchangetoken.ai/api/v1/services/aigc/video-generation/video-synthesis

Request Fields ​

FieldTypeRequiredDescription
modelstringYeswan3.0-video or wan3.0-video-prime
inputobjectYesProvide at least one of prompt or media
input.promptstringConditionalDescribe the scene, action, camera movement, or sound
input.mediaobject[]ConditionalMedia items, each with type and url
parametersobjectNoGeneration 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.

FieldTypeDefaultDescription
resolutionstring1080P480P, 720P, or 1080P; uppercase P
durationinteger5Output seconds: 2–30, or -1 for automatic duration
ratiostringadaptiveadaptive, 21:9, 16:9, 4:3, 1:1, 3:4, or 9:16
audiobooleantrueGenerate sound
prompt_extendbooleantrueRewrite the prompt; required for file or link
seedinteger-1Random (-1) or 0–2147483647; results may vary
watermarkbooleanfalseAdd 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 ​

Scenariotype in input.mediaUsage
Text-to-videoOmit mediaDescribe the video in input.prompt
First-frame image-to-videofirst_frameOne starting image
First-and-last-frame image-to-videofirst_frame + last_frameOne image per endpoint
Reference-to-videoreference_image, reference_video, reference_audioCombine reference media
File or web pagefile or linkChoose 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.

bash
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.

bash
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.

bash
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 ​

json
{
  "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.

bash
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_statusMeaning and action
PENDINGQueued; continue polling
RUNNINGGenerating; continue polling
SUCCEEDEDComplete; read output.video_url
FAILEDFailed; inspect output.code, if present, and output.message
CANCELEDCanceled; stop polling
UNKNOWNThe 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.

json
{
  "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.

FieldDescription
usage.video_countNumber of generated videos
usage.durationTotal billable seconds, including input reference video and output video; fractional values are supported
usage.input_video_durationInput reference video seconds; 0 without video input
usage.output_video_durationActual output video seconds
usage.SRActual resolution tier, such as 480, 720, or 1080; the field name is uppercase
usage.fpsOutput frame rate
usage.ratioOutput 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 ​

json
{
  "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:

json
{
  "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:

json
{
  "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.