Grok Imagine Video 1.5 (Preview) Serverless API

Image-to-video with native synchronized audio, up to 720p.

~41.52s
 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

POSThttps://api.segmind.com/v1/grok-imagine-video-1.5-preview

Parameters

imagerequired
string (uri)

Image to animate, URL or base64. Match aspect ratio to image orientation.

Default: "https://segmind-resources.s3.amazonaws.com/input/grok-imagine-video-1.5-preview-input-cat-surf.jpeg"
promptrequired
string

Describe motion, camera moves and sound. Keep it short and motion-focused.

Default: "A cat surfing a wave at sunset, cinematic slow motion"
aspect_ratiooptional
string

Output aspect ratio. 16:9 landscape, 9:16 social verticals, 1:1 square.

Default: "16:9"
Allowed values :
"16:9""9:16""1:1""4:3""3:4""3:2""2:3"
durationoptional
integer

Video length, 1-15 seconds, billed per output second. Use 6-10s for most clips.

Default: 6Range: 1 - 15
resolutionoptional
string

Output resolution, 480p or 720p; higher costs more. Use 720p for hero assets.

Default: "480p"
Allowed values :
"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.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out