Alibaba Wan 2.7 Text To Video API Documentation

Alibaba Wan 2.7 Text To Video API Documentation

Playground

Try it on WaveSpeedAI!

WAN 2.7 Text-to-Video turns plain prompts into coherent, cinematic clips with crisp detail, stable motion, and strong instruction-following—great for ads, explainers, and social posts. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.

Features

Wan 2.7 is advanced text-to-video model, generating high-quality cinematic video from natural language prompts. With audio input support, negative prompt control, flexible resolution and aspect ratio options, and an optional prompt expansion mode, it delivers strong results for a wide range of creative and production workflows.


Why Choose This?

  • High-quality text-to-video generation Produces detailed, visually coherent video with accurate motion, lighting, and scene composition from text descriptions.

  • Audio input support Upload an audio track to guide the rhythm, mood, and pacing of the generated video for synchronized results.

  • Negative prompt support Specify what you don’t want in the video for more precise control over the output.

  • Prompt expansion Enable enable_prompt_expansion to let the model automatically enrich and optimize your prompt before generation.

  • Resolution options Generate at 720p or 1080p to match your delivery requirements.

  • Flexible aspect ratios Supports multiple orientations for social, cinematic, and broadcast formats.

  • Reproducible results Use the seed parameter to lock in a specific output for exact reproduction.


Parameters

ParameterRequiredDescription
promptYesText description of the scene, motion, camera style, and atmosphere.
negative_promptNoElements to exclude from the generated video.
audioNoOptional audio track to synchronize with the generated video.
resolutionNoOutput resolution: 720p (default) or 1080p.
aspect_ratioNoOutput aspect ratio. Default: 16:9.
durationNoClip length in seconds. Default: 5.
enable_prompt_expansionNoEnable automatic prompt optimization before generation. Default: off.
seedNoRandom seed for reproducible results. Use -1 for a random seed.

How to Use

  1. Write your prompt — describe the scene, characters, camera movement, lighting, and atmosphere. Use the Prompt Enhancer for better results.
  2. Add negative prompt (optional) — specify elements you want to exclude from the output.
  3. Upload audio (optional) — provide an audio file or URL to synchronize the video to a specific track.
  4. Select resolution — 720p for standard output, 1080p for higher-quality results.
  5. Select aspect ratio — choose the format that fits your target platform.
  6. Set duration — choose your desired clip length in seconds.
  7. Enable prompt expansion (optional) — let the model automatically enrich your prompt before generation.
  8. Set seed (optional) — fix the seed to reproduce a specific result in future runs.
  9. Submit — generate, preview, and download your video.

Pricing

Duration720p1080p
5s$0.50$0.75
10s$1.00$1.50
15s$1.50$2.25

Billing Rules

  • 720p: $0.10 per second
  • 1080p: $0.15 per second (1.5× base rate)

Best Use Cases

  • Cinematic Storytelling — Render atmospheric, narrative-driven scenes from detailed text descriptions.
  • Social Media Content — Generate platform-optimized video clips across multiple aspect ratios.
  • Marketing & Advertising — Produce high-quality promotional video content without a film crew.
  • Music & Audio-Visual — Synchronize generated video to a music track or voiceover for cohesive results.
  • Concept Visualization — Bring creative ideas and moods to life quickly for pitching and review.

Pro Tips

  • The more specific your prompt, the better — include camera angle, lighting style, color palette, and subject behavior.
  • Use negative_prompt to avoid common artifacts like blurry faces or unwanted motion.
  • Enable prompt expansion for shorter or less detailed prompts to get richer output automatically.
  • Providing an audio track improves rhythm and pacing alignment in the generated video.
  • Fix the seed once you find a result you like to iterate consistently across resolution and duration changes.

Notes

  • Only prompt is required; all other parameters are optional.
  • Ensure audio URLs are publicly accessible if using a link rather than a direct upload.
  • Please ensure your content complies with usage policies.

Authentication

For authentication details, please refer to the Authentication Guide.

API Endpoints

Submit Task & Query Result

set -euo pipefail

export WAVESPEED_API_KEY="your-api-key"

REQUEST_BODY=$(cat <<'JSON'
{
  "prompt": "A cinematic ocean wave at sunrise, highly detailed",
  "resolution": "720p",
  "aspect_ratio": "16:9",
  "duration": 5,
  "enable_prompt_expansion": false,
  "seed": -1
}
JSON
)

# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
  -X POST "https://api.wavespeed.ai/api/v3/alibaba/wan-2.7/text-to-video" \
  -H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "${REQUEST_BODY}")

TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
  printf 'Submission response did not contain a prediction id
' >&2
  exit 1
fi
RESULT_URL=$(printf '%s' "${TASK}" | jq -r '.urls.get // empty')
if [ -z "${RESULT_URL}" ]; then RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"; fi

# 2. Poll until the prediction finishes.
while true; do
  RESPONSE=$(curl --silent --show-error --fail-with-body \
    "${RESULT_URL}" \
    -H "Authorization: Bearer ${WAVESPEED_API_KEY}")
  RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
  STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')

  case "${STATUS}" in
    completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
    failed|cancelled|timeout) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
    created|processing) sleep 2 ;;
    *) printf 'Unexpected status: %s
' "${STATUS}" >&2; exit 1 ;;
  esac
done

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
promptstringYes-The positive prompt for the generation.
negative_promptstringNo-The negative prompt for the generation.
audiostringNo--Audio URL to guide generation (optional).
resolutionstringNo720p720p, 1080pThe resolution of the generated video.
aspect_ratiostringNo16:916:9, 9:16, 1:1, 4:3, 3:4The aspect ratio of the generated video.
durationintegerNo52 ~ 15The duration of the generated media in seconds (2-15s).
enable_prompt_expansionbooleanNofalse-If set to true, the prompt optimizer will be enabled.
seedintegerNo-1-The random seed to use for the generation. -1 means a random seed will be used.

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayOutput values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to retrieve the prediction result
data.statusstringStatus of the task: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds

Result Request Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Task ID

Result Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
dataobjectThe prediction data object containing all details
data.idstringUnique identifier for the prediction
data.modelstringModel ID used for the prediction
data.outputsarray<string | object>Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model.
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to poll for the prediction result
data.statusstringStatus: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
© 2026 WaveSpeedAI. All rights reserved.