Skip to main content
POST
Wan 2.5 Video Generation

Introduction

Wan 2.5 is Alibaba Cloud Bailian’s video generation family, consisting of text-to-video (wan2.5-t2v-preview) and image-to-video (wan2.5-i2v-preview). It supports 480P, 720P, and 1080P output. Use GravitexAI’s unified video API: submit a task to get a task id, then query the task to poll status and get the video URL.
Wan 2.5 recommends passing underlying DashScope parameters via metadata.input and metadata.parameters. Top-level fields like prompt and duration are for compatibility; metadata.parameters takes precedence.

Authentication

string
required
Bearer Token, e.g. Bearer sk-xxxxxxxxxx

Supported models

Call flow

  1. Submit: POST /v1/video/generations with model, prompt, and Wan parameters in metadata.
  2. Poll: GET /llm-api/v1/video/generations/{id} (host maas.gravitex.ai) every 3–15 seconds until data.status is completed or failed.
  3. Result: On success, get the video URL from data.url, data.video_url, or data.metadata.output.video_url (typically a temporary link—download promptly).

Request structure

Submit response

The submit endpoint returns an OpenAI Video-style object; use id as the task ID for subsequent queries:

Query response

The query endpoint returns a wrapped structure; data.status of completed indicates success:

Use cases

Generate video from text prompts with smart prompt rewriting and custom resolution/aspect ratio.
string
required
Text prompt; keep in sync with top-level prompt
string
default:"720P"
480P, 720P, or 1080P
string
default:"16:9"
Aspect ratio: 16:9, 9:16, 1:1, 4:3, 3:4
integer
default:"5"
Video duration in seconds; common values: 3, 5, 10
boolean
default:"true"
Enable smart prompt rewriting
boolean
default:"false"
Add watermark
integer
Random seed, range [0, 2147483647]
Text-to-video example:

Parameter reference

metadata.parameters

metadata.input

Query response key fields

Status mapping

Error handling

On failure, data.status is failed; check data.metadata.output.task_status for details.

FAQ

metadata.parameters.duration wins. For production, either omit top-level duration or keep both values identical.
Keep top-level prompt and metadata.input.prompt in sync so orig_prompt in query results matches your request.
video_url is typically a temporary OSS link. Download and store it promptly after success.
Check in this order:
  1. data.status == "completed"
  2. data.video_url or data.url is non-empty
  3. data.metadata.output.task_status == "SUCCEEDED"
Wan 2.5 supports text-to-video and first-frame image-to-video only, using metadata.input.img_url instead of 2.7’s media array. Wan 2.7 adds reference-to-video, continuation, first+last frame, and more. See Wan 2.7.

Submit video task

Unified video task submission and multi-model parameters

Query video task

Poll task status and get video URL