For the complete documentation index, see llms.txt. This page is also available as Markdown.

Wan 3.0 Video

This documentation is valid for the following list of our models:

  • alibaba/wan-3-0-video

Model Overview

Wan 3.0 — an all-in-one reference-based video generation model by Alibaba Cloud. It supports text-to-video, image-to-video (first/last frame), and reference-based generation from images, videos, audio, documents, and web links, producing videos up to 30 seconds long.

Setup your API Key

If you don't have an API key yet, use our Quickstart guide.

How to Make a Call

Step-by-Step Instructions

Generating a video involves sequentially calling two endpoints:

  • Create and submit a video generation task. The response contains a generation ID.

  • Poll the retrieval endpoint with that generation ID until the status is completed.

API Schemas

Create a video generation task and send it to the server

post
Body
modelstring · enumRequiredPossible values:
promptstring · max: 20000Required

The text description of the scene, subject, or action to generate in the video.

image_urlstring · uriOptional

The URL of the image strictly used as the first frame of the video. Cannot be used together with reference media, file_url, or link_url.

last_image_urlstring · uriOptional

The URL of the image strictly used as the last frame of the video. Requires image_url.

reference_image_urlsstring · uri[] · max: 10Optional

Array of image URLs for multi-image-to-video generation.

video_urlsstring · uri[] · max: 5Optional

Reference video URLs. Up to 5 clips with a total duration of no more than 15 seconds.

audio_urlsstring · uri[] · max: 5Optional

Reference audio URLs. Up to 5 clips with a total duration of no more than 15 seconds.

file_urlstring · uriOptional

The URL of a document (docx, doc, xlsx, xls, pptx, ppt, pdf, txt, key, pages, numbers, md) the model uses to generate the video. Cannot be used together with link_url.

link_urlstring · uriOptional

The URL of a publicly accessible web page the model uses to generate the video. Cannot be used together with file_url.

aspect_ratiostring · enumOptional

The aspect ratio of the generated video.

Default: adaptivePossible values:
resolutionstring · enumOptional

An enumeration where the short side of the video frame determines the resolution.

Default: 1080pPossible values:
durationintegerOptional

The length of the output video in seconds, from 2 to 30. When reference videos are provided, the total input video duration plus the output video duration must not exceed 30 seconds.

Default: 5
generate_audiobooleanOptional

Specifies whether the output video contains audio.

Default: true
seedintegerOptional

Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen.

watermarkbooleanOptional

Whether the video contains a watermark.

Default: false
Responses
200

Successful response.

application/json
idstringRequired

The ID of the generated video.

Example: 60ac7c34-3224-4b14-8e7d-0aa0db708325
statusstring · enumRequired

The current status of the generation task.

Example: completedPossible values:
videoany ofOptional
or
or
any · nullableOptional
post/v2/video/generations
curl --request POST \
  --url 'https://api.aimlapi.com/v2/video/generations' \
  --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{"model": "alibaba/wan-3-0-video", "prompt": "Describe what you want the model to generate.", "image_url": "https://example.com/input.jpg", "duration": 5}'
200

Successful response.

{
  "id": "60ac7c34-3224-4b14-8e7d-0aa0db708325",
  "status": "completed",
  "video": {
    "url": "https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"
  },
  "error": {
    "name": "text",
    "message": "text"
  },
  "meta": {
    "usage": {
      "credits_used": 120000,
      "usd_spent": 0.06
    }
  }
}

Retrieve the generated video from the server

Poll this endpoint with the generation_id returned by the submit request. When the status is completed, the response includes the generated video URL.

get
Authorizations
AuthorizationstringRequired

Bearer key

Query parameters
generation_idstringRequiredExample: <REPLACE_WITH_YOUR_GENERATION_ID>
Responses
200Success
application/json
idstringRequired

The ID of the generated video.

Example: 60ac7c34-3224-4b14-8e7d-0aa0db708325
statusstring · enumRequired

The current status of the generation task.

Example: completedPossible values:
get/v2/video/generations
curl -L \
  --request GET \
  --url 'https://api.aimlapi.com/v2/video/generations?generation_id=<REPLACE_WITH_YOUR_GENERATION_ID>' \
  --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>'
200Success
{
  "id": "60ac7c34-3224-4b14-8e7d-0aa0db708325",
  "status": "completed",
  "video": {
    "url": "https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"
  },
  "error": {
    "name": "text",
    "message": "text"
  },
  "meta": {
    "usage": {
      "credits_used": 120000
    }
  }
}

Code Example

The examples submit a generation task and poll every 15 seconds until the final result is available.

Response

Last updated

Was this helpful?