Wan 2.6 Text To Video Serverless API
Transforms text and audio into high-quality cinematic videos with seamless storytelling and synchronization.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/wan-2.6-t2v"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "size": "1280*720",
12 "prompt": "Humorous but premium mini-trailer: a rugged caveman explorer sparks \"evolution\" by grunting simple commands that instantly upgrade his world and morph his own form through the ages. Extreme photoreal 4K, cinematic lighting, subtle film grain, smooth camera. No subtitles, no UI, no watermark.\nShot 1 [0-3s] Macro close-up on the caveman's weathered face and hairy knuckles clutching a jagged stone axe in a misty prehistoric dawn. He grunts deeply: \"Better!\"\nShot 2 [3-6s] Hard cut: Bustling ancient forge at golden hour, sparks flying. The caveman, now in leather tunic with a bronze sword, hammers metal confidently. Camera dollies in as he bellows: \"Faster!\"\nShot 3 [6-10s] Hard cut: Steampunk factory amid rainy industrial night, gears whirring. He transforms into a suited inventor with goggles, cranking a massive machine that hums to life. Slow zoom on his evolving eyes as he commands: \"Smarter!\"\nShot 4 [10-15s] Hard cut: Futuristic AI lab bathed in neon glow, holographic interfaces pulsing. The caveman, sleek in neural-linked exosuit, interfaces with a glowing orb; his form subtly digitizes. He smiles knowingly: \"Evolved. What's next?\"",
13 "duration": 5,
14 "multi_shots": false,
15 "negative_prompt": "low resolution, error, worst quality, low quality, defects",
16 "enable_prompt_expansion": true
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22 result = response.json()
23 print(json.dumps(result, indent=2))
24else:
25 print(f"Error: {response.status_code}")
26 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/wan-2.6-t2v"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "size": "1280*720",
12 "prompt": "Humorous but premium mini-trailer: a rugged caveman explorer sparks \"evolution\" by grunting simple commands that instantly upgrade his world and morph his own form through the ages. Extreme photoreal 4K, cinematic lighting, subtle film grain, smooth camera. No subtitles, no UI, no watermark.\nShot 1 [0-3s] Macro close-up on the caveman's weathered face and hairy knuckles clutching a jagged stone axe in a misty prehistoric dawn. He grunts deeply: \"Better!\"\nShot 2 [3-6s] Hard cut: Bustling ancient forge at golden hour, sparks flying. The caveman, now in leather tunic with a bronze sword, hammers metal confidently. Camera dollies in as he bellows: \"Faster!\"\nShot 3 [6-10s] Hard cut: Steampunk factory amid rainy industrial night, gears whirring. He transforms into a suited inventor with goggles, cranking a massive machine that hums to life. Slow zoom on his evolving eyes as he commands: \"Smarter!\"\nShot 4 [10-15s] Hard cut: Futuristic AI lab bathed in neon glow, holographic interfaces pulsing. The caveman, sleek in neural-linked exosuit, interfaces with a glowing orb; his form subtly digitizes. He smiles knowingly: \"Evolved. What's next?\"",
13 "duration": 5,
14 "multi_shots": false,
15 "negative_prompt": "low resolution, error, worst quality, low quality, defects",
16 "enable_prompt_expansion": true
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22 result = response.json()
23 print(json.dumps(result, indent=2))
24else:
25 print(f"Error: {response.status_code}")
26 print(response.text)API Endpoint
https://api.segmind.com/v1/wan-2.6-t2vParameters
promptrequiredstringText prompt for video generation
audiooptionalstring (uri)Audio file (wav/mp3, 3-30s, ≤15MB) for voice/music synchronization
nulldurationoptionalintegerAn enumeration.
551015enable_prompt_expansionoptionalbooleanIf set to true, the prompt optimizer will be enabled
truemulti_shotsoptionalbooleanEnable intelligent multi-shot segmentation (only active when enable_prompt_expansion is enabled). True enables multi-shot segmentation, false generates single-shot content.
falsenegative_promptoptionalstringNegative prompt to avoid certain elements
""seedoptionalintegerRandom seed for reproducible generation
nullsizeoptionalstringAn enumeration.
"1280*720""1280*720""720*1280""1920*1080""1080*1920"Response Type
Returns: Video
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out