One continuous five-second low water-level camera push through a large natural sea arch. A single turquoise swell enters a shadowed basalt sea cave and curls into white foam around the rocks while sunlight glows through the arch ahead. Keep the arch geometry fixed and the water physically coherent. Gradual forward motion, no cuts. Natural surf ambience. No text, lettering, captions, logos, watermarks, brands, advertising or product packaging.
Wan 2.7 Text to Video API
alibaba/wan-2.7/text-to-videoWan 2.7 Text to Video turns written prompts into 5–15 second videos at 720p or 1080p, featuring Thinking Mode prompt reasoning, native audio synchronization, and natural physical motion. It maintains scene coherence and cinematic camera movement across multiple aspect ratios while following detailed narrative instructions.
Examples
REST API Reference
Quick Start
Submit a task and query its status.
Step 1: Set up authentication
Create an API key in the dashboard and attach Authorization: Bearer <API_KEY> when submitting a task.
- Submit Endpoint
- POST
https://api.vidgo.ai/api/generate/submit - Authorization Header
- Authorization: Bearer VIDGO_API_KEY
Step 2: Submit a task
POST /api/generate/submit · alibaba/wan-2.7/text-to-video
REQUEST_BODY=$(cat <<'JSON'
{
"model": "alibaba/wan-2.7/text-to-video",
"input": {
"resolution": "720p",
"duration": 5,
"prompt": "Describe the scene or edit",
"aspect_ratio": "16:9"
}
}
JSON
)
RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
CODE=$(printf '%s' "$RESPONSE" | jq -r '.code // empty')
if [ "$CODE" != "0" ] && [ "$CODE" != "200" ]; then
printf 'API error: %s
' "$RESPONSE" >&2
exit 1
fi
printf '%s
' "$RESPONSE"Step 3: Poll for completion
Poll with task_id while status is not_started or running, and stop at finished or failed. On success, read data.files[].file_url; on failure, read data.error_message.
Status Endpoint
GET https://api.vidgo.ai/api/generate/status/{task_id}Poll with task_id while status is not_started or running, and stop at finished or failed. On success, read data.files[].file_url; on failure, read data.error_message.
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-example",
"status": "running",
"created_time": "2026-09-21T08:00:00Z"
}
}{
"code": 200,
"data": {
"task_id": "task-unified-...",
"status": "finished",
"files": [
{
"file_url": "https://storage.vidgo.ai/generated/video.mp4",
"file_type": "video"
}
],
"created_time": "2026-08-22T10:00:00Z",
"progress": 100,
"error_message": null
}
}Complete executable script
Expand to review an end-to-end script with automatic polling, error handling, and timeout safeguards.
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "alibaba/wan-2.7/text-to-video",
"input": {
"resolution": "720p",
"duration": 5,
"prompt": "Describe the scene or edit",
"aspect_ratio": "16:9"
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
BUSINESS_CODE=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Submit failed:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
START_TIME=$(date +%s)
POLL_DELAY=2
while true; do
if [ $(( $(date +%s) - START_TIME )) -ge 600 ]; then
printf 'Timed out after 600 seconds
' >&2
exit 1
fi
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
BUSINESS_CODE=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Status request failed:
%s
' "$STATUS_RESPONSE" >&2
exit 1
fi
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep "$POLL_DELAY"
if [ "$POLL_DELAY" -lt 10 ]; then POLL_DELAY=$((POLL_DELAY + 1)); fi
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
doneRequest Parameters (input object)
Supported generation parameters inside the input object when submitting to /api/generate/submit:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| prompt | string | Yes | — | Prompt, trimmed; maximum 5,000 Unicode characters. Optional for image-to-video. |
| audio_url | string | No | — | Optional public HTTP(S) audio URL. |
| aspect_ratio | string | No | 16:9 | 16:9, 9:16, 1:1, 4:3 or 3:4. Default: 16:9. |
| resolution | string | No | 720p | 720p or 1080p. Default: 720p. |
| duration | integer | No | 5 | 5, 10 or 15 seconds; default 5. |
| seed | integer | No | — | Optional integer from 0 to 2147483647. |
| enable_safety_checker | boolean | No | — | Optional safety checker setting; omitted by default. |
Response Fields (Status Query)
Details returned by GET /api/generate/status/{task_id}:
| Field | Type | Description |
|---|---|---|
| code | integer | HTTP/business response status code (200 indicates success). |
| data.task_id | string | Globally unique task identifier. |
| data.status | string | Task lifecycle state: not_started, running, finished, or failed. |
| data.files | array | Array of output assets containing file_url and file_type upon completion. |
| data.error_message | string | null | Error diagnostic details if the task status is failed. |
Task Lifecycle
Clients should poll status until reaching either the finished or failed terminal state:
not_startedQueued
runningGenerating
finishedReady
failedFailed
Polling & Error Handling
- Polling frequencyStart polling with a 2 to 3-second interval, gradually increasing to 5 seconds for extended takes.
- Network resiliencyTransient 5xx responses or timeouts do not signify task failure; retry status requests after a short backoff.
- Webhook callbacksProvide a top-level callback_url in your submission payload to receive completion notifications automatically.
Specifications
| Specification | Value | Description |
|---|---|---|
| Model | alibaba/wan-2.7/text-to-video | |
| Resolution | 720p / 1080p | Default: 720p |
| Duration | 5, 10 or 15 seconds; default 5. |
Wan 2.7 Text to Video Overview
Wan 2.7 Text to Video translates natural language instructions into high-fidelity video sequences up to 15 seconds. Built on Alibaba Tongyi Lab's Diffusion Transformer architecture with Wan-VAE temporal compression, it analyzes complex descriptive prompts through Thinking Mode to render coherent scene physics, lighting transitions, and precise camera choreography without requiring input media.
Why Choose Wan 2.7 Text to Video?
Generate from text prompts directlyCompose subjects, lighting, perspective, and motion dynamics entirely through text without preparing prior visual assets.
Leverage Thinking Mode reasoningThe integrated reasoning engine interprets complex multi-sentence scene descriptions and preserves spatial-temporal consistency.
Select 5, 10, or 15-second durationsChoose the exact clip duration required for your production timeline with consistent pacing and no frame stutter.
Adapt to five native aspect ratiosOutput in widescreen 16:9, social 9:16, square 1:1, or classic 4:3 and 3:4 formats to match target viewing channels.
Connect synchronized audio tracksProvide an optional audio URL to coordinate background music or sound effects with visual beats and camera cuts.
Parameters
| Parameter | Requirement | Description |
|---|---|---|
| prompt | Yes | Prompt, trimmed; maximum 5,000 Unicode characters. Optional for image-to-video. Default — |
| audio_url | No | Optional public HTTP(S) audio URL. Default — |
| aspect_ratio | No | 16:9, 9:16, 1:1, 4:3 or 3:4. Default: 16:9. Default 16:9 |
| resolution | No | 720p or 1080p. Default: 720p. Default 720p |
| duration | No | 5, 10 or 15 seconds; default 5. Default 5 |
| seed | No | Optional integer from 0 to 2147483647. Default — |
| enable_safety_checker | No | Optional safety checker setting; omitted by default. Default — |
How to Use Wan 2.7 Text to Video
Write a detailed scene promptDescribe the primary subject, camera movement, environment lighting, and temporal sequence clearly in the prompt.
Configure duration and formatChoose the duration (5, 10, or 15 seconds), resolution (720p or 1080p), and aspect ratio matching your target distribution channel.
Submit task and fetch outputExecute the generation request via API or Playground, monitor the asynchronous task status, and retrieve your final MP4 video.
Pricing
Credits = output seconds × resolution rate. Failed tasks are refunded automatically.
| Usage | Rate | Details |
|---|---|---|
| 720p | 12 credits/s ($0.06/s) | All four workflows use the same rate. |
| 1080p | 18 credits/s ($0.09/s) | All four workflows use the same rate. |
Best Use Cases
Cinematic pre-visualizationPrototype lighting, camera blocking, and scene transitions directly from screenplay excerpts before physical production.
Commercial concept teasersGenerate visual mood boards and rapid campaign proofs-of-concept for advertising pitches and client presentations.
Social media content creationProduce punchy 9:16 vertical video narratives and attention-grabbing social media visuals with crisp 1080p clarity.
Creative storytelling & fictionBring fantasy, sci-fi, and historical narrative sequences to life from descriptive writing without 3D animation pipelines.
Pro Tips for Wan 2.7 Text to Video
- Separate subject and camera instructions:Structure your prompt with subject action in the opening clause, followed by camera angle, movement speed, and lighting tone.
- Use temporal cues for pacing:Specify pacing markers such as slow-motion, smooth pan, or gradual zoom to guide the Diffusion Transformer backbone smoothly.
- Match resolution to output requirements:Use 720p for rapid iterative prototyping and switch to 1080p for final broadcast-quality rendering to balance credit costs.
- Fix the seed for creative variations:Keep the seed number constant while modifying specific adjectives or camera verbs to observe controlled composition changes.
Notes
- Prompt character capacity:Prompts support up to 5,000 Unicode characters. Ensure descriptions are focused on visual elements rather than abstract concepts.
- Duration selection:Text to Video supports 5, 10, or 15 seconds. Requests with other values will fail schema validation.
- Automatic credit refund:If a task fails during generation or media processing, all deducted credits are refunded immediately to your account.
Wan 2.7 Text to Video API frequently asked questions
What is the Wan 2.7 Text to Video API?
Wan 2.7 Text to Video is an Alibaba Tongyi Lab model for text-to-video generation. It creates 5 to 15-second high-definition videos at 720p or 1080p directly from text prompts, featuring Thinking Mode prompt reasoning, native audio coordination, and natural physical motion. Built on a Diffusion Transformer backbone with Wan-VAE 3D causal temporal compression, it preserves scene coherence and cinematic camera movement while following detailed narrative prompts. You can call it programmatically or try it from the playground above.
How long can Wan 2.7 Text to Video generate in a single request?
Wan 2.7 Text to Video supports three discrete duration options: 5 seconds, 10 seconds, and 15 seconds. You can select the duration tier directly in your request payload to balance narrative pacing and generation credits.
Does Wan 2.7 Text to Video support synchronized audio generation?
Yes, Wan 2.7 Text to Video supports audio integration by accepting an optional audio_url parameter. When provided with a public audio track, the model aligns visual pacing and cinematic beats with the supplied sound.
What resolutions does Wan 2.7 Text to Video offer?
Wan 2.7 Text to Video provides 720p and 1080p native video resolutions. The default tier is 720p at 12 credits per second, while 1080p delivers crisper textures and enhanced sharpness at 18 credits per second.
Which aspect ratios does Wan 2.7 Text to Video support?
Wan 2.7 Text to Video supports five native aspect ratios: 16:9 widescreen, 9:16 vertical, 1:1 square, 4:3 standard, and 3:4 portrait. The canvas composition is generated natively according to the selected ratio without letterboxing.
How does Thinking Mode improve Wan 2.7 Text to Video generation?
Thinking Mode allows Wan 2.7 to deeply analyze the semantic hierarchy of prompts before generation. It resolves spatial layout, object relationships, and sequential actions over time to produce accurate physical interactions and smooth transitions.
How does Wan 2.7 Text to Video billing work for failed tasks?
Generation credits are charged based on the requested output seconds and resolution rate. If a task fails validation or encounters an execution error during processing, all deducted credits are immediately and fully refunded to your account.