Wan 2.7 Text to Video Serverless API
Generate cinematic 1080P videos from text with audio sync, multi-shot control, and 15-second duration via Wan 2.7.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/wan2.7-t2v"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A majestic golden eagle soaring over snow-capped mountain peaks at sunrise, cinematic wide angle shot, dramatic lighting, ultra HD, slow motion",
12 "negative_prompt": "blurry, low quality, distorted, watermark",
13 "resolution": "720P",
14 "duration": 5,
15 "ratio": "16:9",
16 "seed": 42
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/wan2.7-t2v"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A majestic golden eagle soaring over snow-capped mountain peaks at sunrise, cinematic wide angle shot, dramatic lighting, ultra HD, slow motion",
12 "negative_prompt": "blurry, low quality, distorted, watermark",
13 "resolution": "720P",
14 "duration": 5,
15 "ratio": "16:9",
16 "seed": 42
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/wan2.7-t2vParameters
promptrequiredstringDescribe the scene, subjects, motion, and camera style (e.g., cinematic drone shot, slow pan). Include lighting and mood for richer outputs. Max 5,000 characters.
"A majestic golden eagle soaring over snow-capped mountain peaks at sunrise, cinematic wide angle shot, dramatic lighting, ultra HD, slow motion"audio_urloptionalstring (uri)URL to an audio file (MP3/WAV) to synchronize with the video.
nulldurationoptionalintegerLength of the generated video in seconds (2-15).
5negative_promptoptionalstringList elements to exclude from the output (e.g., blurry, watermark, distorted faces).
"blurry, low quality, distorted, watermark"ratiooptionalstringAspect ratio of the output video.
"16:9""16:9""9:16""1:1""4:3""3:4"resolutionoptionalstringOutput resolution tier.
"720P""720P""1080P"seedoptionalintegerInteger seed for reproducible outputs.
42Response 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