Grok Imagine Video 1.5 (Preview) Serverless API
Image-to-video with native synchronized audio, up to 720p.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/grok-imagine-video-1.5-preview"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A cat surfing a wave at sunset, cinematic slow motion",
12 "image": "https://segmind-resources.s3.amazonaws.com/input/grok-imagine-video-1.5-preview-input-cat-surf.jpeg",
13 "duration": 6,
14 "resolution": "480p",
15 "aspect_ratio": "16:9"
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21 result = response.json()
22 print(json.dumps(result, indent=2))
23else:
24 print(f"Error: {response.status_code}")
25 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/grok-imagine-video-1.5-preview"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A cat surfing a wave at sunset, cinematic slow motion",
12 "image": "https://segmind-resources.s3.amazonaws.com/input/grok-imagine-video-1.5-preview-input-cat-surf.jpeg",
13 "duration": 6,
14 "resolution": "480p",
15 "aspect_ratio": "16:9"
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21 result = response.json()
22 print(json.dumps(result, indent=2))
23else:
24 print(f"Error: {response.status_code}")
25 print(response.text)API Endpoint
https://api.segmind.com/v1/grok-imagine-video-1.5-previewParameters
imagerequiredstring (uri)Image to animate, URL or base64. Match aspect ratio to image orientation.
"https://segmind-resources.s3.amazonaws.com/input/grok-imagine-video-1.5-preview-input-cat-surf.jpeg"promptrequiredstringDescribe motion, camera moves and sound. Keep it short and motion-focused.
"A cat surfing a wave at sunset, cinematic slow motion"aspect_ratiooptionalstringOutput aspect ratio. 16:9 landscape, 9:16 social verticals, 1:1 square.
"16:9""16:9""9:16""1:1""4:3""3:4""3:2""2:3"durationoptionalintegerVideo length, 1-15 seconds, billed per output second. Use 6-10s for most clips.
6Range: 1 - 15resolutionoptionalstringOutput resolution, 480p or 720p; higher costs more. Use 720p for hero assets.
"480p""480p""720p"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