Wan v2.7 Text-to-Video
Wan v2.7 Text-to-Video is the Wan 2.7 text-to-video model from Alibaba Cloud, generating clips of 2 to 15 seconds at 720p or 1080p with native audio and multi-shot narrative control through prompt language.
View API reference- Price
- $0.10, Per secondLowest available configuration
import { experimental_generateVideo as generateVideo } from 'ai';
const result = await generateVideo({ model: 'alibaba/wan-v2.7-t2v', prompt: 'A serene mountain lake at sunrise.'});Copy link to headingPlayground
Try out Wan v2.7 Text-to-Video by Alibaba Cloud. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.
Your generated video will appear here.
Copy link to headingProviders
Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.
| Provider |
|---|
Getting started
Generate videos with Wan v2.7 Text-to-Video using the experimental_generateVideo function from AI SDK 6 or later. AI Gateway handles routing and polls until the video is ready.
Install the AI SDK (pnpm add ai dotenv), create an API key from the API Keys page, and set it as AI_GATEWAY_API_KEY in your environment. Full setup is covered in the video generation quickstart.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'alibaba/wan-v2.7-t2v', prompt: 'A chicken flying into the sunset in the style of 90s anime', });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Top-level parameters
Drive the output with the top-level resolution and duration parameters. Wan uses resolution, not aspectRatio.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'alibaba/wan-v2.7-t2v', prompt: 'A chicken flying into the sunset in the style of 90s anime', resolution: '1280x720', duration: 5, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text description of the video to generate. Max 5000 characters. |
duration | number | No | Video length in seconds. 2-15 seconds. |
resolution | string | No | Resolution ('1280x720', '1920x1080'). |
aspectRatio | string | No | Aspect ratio ('16:9', '9:16', '1:1', '4:3', '3:4'). |
generateAudio | boolean | No | Generate synchronized audio with the video. |
Input limits
| Input | Formats | Sources | Max count | Max size | Limits |
|---|---|---|---|---|---|
| Text | — | — | — | — | Up to 5000 characters |
| Audio | wav, mp3 | url | — | 15 MB | 2-30s |
Provider options
Load the version-agnostic Wan options under providerOptions.alibaba. shotType (v2.6 only) and audioUrl (v2.5 only) are version-specific and documented in the table below.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'alibaba/wan-v2.7-t2v', prompt: 'A chicken flying into the sunset in the style of 90s anime', resolution: '1280x720', duration: 5, providerOptions: { alibaba: { promptExtend: true, negativePrompt: 'blurry, low quality', watermark: false, pollIntervalMs: 5000, pollTimeoutMs: 600000, }, }, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Pass Wan-specific options under providerOptions.alibaba in your generateVideo call.
| Parameter | Type | Required | Description |
|---|---|---|---|
promptExtend | boolean | No | Enhance prompt for better quality. Defaults to true. |
negativePrompt | string | No | What to avoid in the video. Max 500 characters. |
ratio | '16:9' | '9:16' | '1:1' | '4:3' | '3:4' | No | Aspect ratio of the generated video. v2.7 text-to-video and reference-to-video only. |
watermark | boolean | No | Add watermark to the video. Defaults to false. |
pollIntervalMs | number | No | How often to check task status. Defaults to 5000. |
pollTimeoutMs | number | No | Maximum wait time. Defaults to 600000 (10 minutes). |
Copy link to headingAbout Wan v2.7 Text-to-Video
Wan v2.7 Text-to-Video is the text-to-video member of Alibaba Cloud's Wan 2.7 release. You provide a text prompt describing a scene, and Wan v2.7 Text-to-Video returns a finished clip of 2 to 15 seconds, with a default of 5 seconds, at 720p or 1080p. Five aspect ratio options cover landscape, portrait, square, and broadcast formats: 16:9, 9:16, 1:1, 4:3, and 3:4.
Multi-shot narrative control works directly through prompt language. Describe a sequence of events spanning multiple moments or locations, and Wan v2.7 Text-to-Video structures the clip with scene cuts and transitions rather than forcing everything into one continuous take. Audio generates natively in the same pass, and an optional audio input can drive the generation, which is useful when a soundtrack or voice line should shape the motion.
Compared to the 2.6 generation, the 2.7 line delivers smoother, more coherent motion, so subjects and camera moves hold together more reliably across the frame. That improvement compounds in multi-shot output, where consistency across cuts determines whether a generated sequence reads as one cohesive piece.
Copy link to headingWhat To Consider When Choosing a Provider
- Configuration: Pricing is per second of generated video and varies by resolution, so duration and output size are your two main cost levers. A 15-second 1080p clip sits at the top of the range; shorter 720p clips are the economical draft tier.
- Configuration: Run a few test prompts in the AI Gateway playground before full integration to calibrate generation times and confirm the output style matches your production bar.
- Zero Data Retention: Zero Data Retention is available for this model. It is offered on a per-provider and model basis. See the documentation for details.
- Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.
Copy link to headingWhen to Use Wan v2.7 Text-to-Video
Best for
- Production Short-Form Video: Advertising, social content, and product demos generated from a prompt alone
- Multi-Scene Narrative Prompts: Scene cuts and transitions structured by prompt language instead of manual editing
- Audio-Led Generation: Clips where a supplied soundtrack or voice line should drive the motion
- Vertical and Broadcast Formats: Deliverables across the five supported aspect ratios from 9:16 to 4:3
Consider alternatives when
- Reference-Based Identity: Wan-v2.7-r2v carries a real subject's appearance and voice from reference material into the output
- Animating an Existing Image: The Wan image-to-video models are built for image-driven workflows
- Previous-Generation Pipelines: Wan-v2.6-t2v remains available for workflows already tuned to the earlier release
Copy link to headingConclusion
Wan v2.7 Text-to-Video is Alibaba Cloud's current production tier for text-to-video work in the Wan family. Clips up to 15 seconds, native audio, prompt-driven multi-shot structure, and smoother motion than the 2.6 line make Wan v2.7 Text-to-Video a solid default for teams shipping video generation features on AI Gateway.
Copy link to headingFrequently Asked Questions
What durations and resolutions does Wan v2.7 Text-to-Video support?
Clips run 2 to 15 seconds, with a default of 5 seconds, at 720p or 1080p. Five aspect ratios are available: 16:9, 9:16, 1:1, 4:3, and 3:4.
How does multi-shot narrative control work in Wan v2.7 Text-to-Video?
You control shot structure through prompt language. Describe a sequence spanning multiple moments or locations, and Wan v2.7 Text-to-Video introduces scene cuts and transitions to match the narrative rather than rendering one continuous take.
Does Wan v2.7 Text-to-Video generate audio?
Yes. Audio generates natively in the same pass as the video. You can also supply an optional audio input to drive the generation when a soundtrack or voice line should shape the motion.
How does Wan v2.7 Text-to-Video differ from the previous Wan text-to-video model?
Wan v2.7 Text-to-Video delivers smoother, more coherent motion than the 2.6 generation and supports audio input to drive generation. Resolution and aspect ratio coverage carry over, and duration is adjustable anywhere from 2 to 15 seconds.
How do I use Wan v2.7 Text-to-Video through AI Gateway?
Call Wan v2.7 Text-to-Video with
generateVideofrom the AI SDK, passing your prompt plus optional resolution and duration settings. You can also try prompts first in the playground on this page.Does AI Gateway offer Zero Data Retention for Wan v2.7 Text-to-Video?
Yes, Zero Data Retention is available for this model. Zero Data Retention is offered on a per-provider basis. See https://vercel.com/docs/ai-gateway/capabilities/zdr for details.
Your use is subject to Alibaba Cloud's Terms & Privacy Policies.