1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const axios = require('axios');
const fs = require('fs');
const path = require('path');
async function toB64(imgPath) {
const data = fs.readFileSync(path.resolve(imgPath));
return Buffer.from(data).toString('base64');
}
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/grok-imagine-video-1.5-image-to-video";
const data = {
"image": "toB64('https://segmind-resources.s3.amazonaws.com/input/grok-imagine-video-1.5-image-to-video-input-coast-sunset.jpeg')",
"prompt": "The camera slowly pushes in as a towering wave crests and crashes against the dark rocks, sheets of sea spray drifting through warm golden sunset light, the deep roar and hiss of the ocean, distant gulls calling.",
"duration": 6,
"resolution": "720p",
"aspect_ratio": "16:9"
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();Source still animated as the first frame; accepts a public URL or base64. Match its orientation to your chosen aspect ratio.
Optional text directing motion, camera moves and sound. Describe action and audio together, and put key beats first.
Clip length in seconds, 1 to 15. Use 6 for quick social clips, 10 to 15 for cinematic shots.
min : 1,
max : 15
Output resolution: 480p, 720p or 1080p. Draft at 480p, publish at 720p, reserve 1080p for hero shots.
Allowed values:
Frame shape of the output. 16:9 for landscape, 9:16 for Reels and Shorts, 1:1 for feeds.
Allowed values:
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Grok Imagine Video 1.5 Image to Video is xAI's image-to-video model that animates a single still image into a fluid, cinematic clip with natively synchronized audio, at up to 1080p.
Grok Imagine Video 1.5 takes a starting image and a short motion prompt and turns them into a short video with sound generated in the same pass. Built on xAI's Aurora engine, it treats your image as the literal first frame and animates forward from there, holding the subject's identity, lighting, color, and texture instead of reinventing the scene. Because picture and audio are produced together, ambient sound, sound effects, and scene-matched audio arrive already in sync, removing a separate dubbing or alignment step. It excels at product shots, portraits, concept frames, and social-native clips where you already have the hero visual and simply want it to move.
Animate a product photo into a rotating hero shot, bring a character illustration or AI portrait to life with subtle expression and a breeze, or turn concept art and storyboards into cinematic teaser shots. The model is ideal for vertical social clips for Reels, Shorts, and TikTok, where built-in audio cuts post-production overhead, and for rapid A/B testing of several motion directions from the same still. In testing, a landscape coastal frame animated cleanly into a 6-second 720p clip with convincing wave motion, rising spray, and a matching ocean-roar audio track.
Describe both the action and the audio in one prompt, for example a slow push-in with the deep roar of the ocean. Order matters: actions written early render early in the clip. Match the aspect ratio to your image orientation, keep the source clean and high resolution, and reserve 1080p for final hero shots while drafting at 480p.
Does it generate audio? Yes. Dialogue, ambient sound, sound effects, and music are generated in the same pass and stay in sync with the motion.
What resolutions are supported? 480p, 720p, and 1080p at 24fps, selectable per generation.
How long can clips be? Any length from 1 to 15 seconds; 6 seconds is a good social default.
Do I need a prompt? No, the prompt is optional, but describing motion and sound gives far more control over the result.
Does the aspect ratio have to match the image? For best results yes; align the aspect ratio to your source orientation to avoid cropping or padding.
Is it text-to-video or image-to-video? This endpoint is image-to-video: it always animates a supplied starting image.