Grok Imagine Video 1.5
Grok Imagine Video 1.5 is SpaceXAI's image-to-video generation model. It animates a starting image and generates synchronized audio in a single pass, available through Vercel AI Gateway. Your use is subject to SpaceXAI's Terms & Privacy Policies.
View API reference- Price
- $0.08, Per secondLowest available configuration
import { experimental_generateVideo as generateVideo } from 'ai';
const result = await generateVideo({ model: 'spacexai/grok-imagine-video-1.5', prompt: 'A serene mountain lake at sunrise.'});Copy link to headingPlayground
Try out Grok Imagine Video 1.5 by SpaceXAI. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.
Your generated video will appear here.
Copy link to headingProviders
Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.
| Provider |
|---|
Getting started
Generate videos with Grok Imagine Video 1.5 using the experimental_generateVideo function from AI SDK 6 or later. AI Gateway handles routing and polls until the video is ready.
Install the AI SDK (pnpm add ai dotenv), create an API key from the API Keys page, and set it as AI_GATEWAY_API_KEY in your environment. Full setup is covered in the video generation quickstart.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'spacexai/grok-imagine-video-1.5', prompt: { image: 'https://example.com/cat.png', text: 'The cat slowly turns its head and blinks', }, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Top-level parameters
Load the supported top-level parameters: prompt.image, prompt.text, duration, and aspectRatio.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'spacexai/grok-imagine-video-1.5', prompt: { image: 'https://example.com/cat.png', text: 'The cat slowly turns its head and blinks', }, duration: 5, aspectRatio: '16:9', });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | No | Text description of the video to generate. |
duration | number | No | Video length in seconds. 1-15 seconds. |
resolution | string | No | Resolution ('854x480', '1280x720', '1920x1080'). |
aspectRatio | string | No | Aspect ratio ('1:1', '16:9', '9:16', '4:3', '3:4', '3:2', '2:3'). |
frameImages | Array<{ image: string | Buffer; frameType: 'first_frame' }> | No | Opening frame of the clip, as a single first_frame entry. Replaces prompt.image and wins when both are set. Grok does not interpolate to an ending image, so a last_frame entry is ignored with a warning. |
inputReferences | Array<string | Buffer> | No | One to seven reference images that Grok builds a new scene from rather than animating. Passing them selects reference-to-video mode automatically. Images only — a video reference is ignored with a warning, so use mode: 'extend-video' to continue from a video. |
Input limits
| Input | Formats | Sources | Max count | Max size | Limits |
|---|---|---|---|---|---|
| Image | — | url, base64 | 7 | — | — |
| Audio | — | url | — | — | — |
Provider options
Pass every Grok image-to-video option under providerOptions.xai.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'spacexai/grok-imagine-video-1.5', prompt: { image: 'https://example.com/cat.png', text: 'The cat slowly turns its head and blinks', }, duration: 5, providerOptions: { xai: { resolution: '720p', pollIntervalMs: 5000, pollTimeoutMs: 600000, }, }, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Pass Grok-specific options under providerOptions.xai in your generateVideo call.
| Parameter | Type | Required | Description |
|---|---|---|---|
referenceImageUrls | string[] | No | One to seven reference image URLs for reference-to-video, which generates a new scene from the references rather than animating them. Legacy alternative to the top-level inputReferences, used only when inputReferences is omitted. |
resolution | '480p' | '720p' | No | Video resolution. Defaults to 480p. |
pollIntervalMs | number | No | How often to check task status. Defaults to 5000. |
pollTimeoutMs | number | No | Maximum wait time. Defaults to 600000 (10 minutes). |
Mode selection and frames
Editing, extension, and reference-to-video are mutually exclusive. Passing providerOptions.xai.videoUrl selects editing, and passing inputReferences selects reference-to-video; set providerOptions.xai.mode to choose explicitly.
The top-level parameters win over their provider-option equivalents: a first_frame in frameImages overrides prompt.image, and inputReferences overrides providerOptions.xai.referenceImageUrls.
Grok does not interpolate between a first and last frame. A last_frame entry in frameImages is ignored with a warning — use mode: 'extend-video' to continue from the end of an existing clip instead.
frameImages takes priority over references: when it is set, reference-to-video is not auto-selected.
Image to video
Animate a static image by passing prompt.image (a URL) with an optional prompt.text describing the motion. The output defaults to the input image’s aspect ratio; setting aspectRatio overrides it and stretches the image.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'spacexai/grok-imagine-video-1.5', prompt: { image: 'https://example.com/cat.png', text: 'The cat slowly turns its head and blinks', }, duration: 5, providerOptions: { xai: { pollTimeoutMs: 600000, }, }, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Reference to video
Generate a new scene from reference images passed through the top-level inputReferences. The references guide visual elements in the output rather than becoming the first frame, and passing them selects reference-to-video mode automatically. Refer to each one in the prompt with <IMAGE_1>, <IMAGE_2>, and so on.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'spacexai/grok-imagine-video-1.5', prompt: 'The comic cat from <IMAGE_1> and the comic dog from <IMAGE_2> ' + 'are having a playful chase through a sunlit park. ' + 'Cinematic slow-motion, warm afternoon light.', inputReferences: [ 'https://example.com/comic-cat.png', 'https://example.com/comic-dog.png', ], duration: 8, aspectRatio: '16:9', providerOptions: { xai: { pollTimeoutMs: 600000, }, }, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Copy link to headingAbout Grok Imagine Video 1.5
Grok Imagine Video 1.5 is SpaceXAI's image-to-video model, released June 22, 2026 and available through AI Gateway. You provide a starting image and describe the motion you want. Grok Imagine Video 1.5 animates the scene and generates synchronized audio, including sound effects, ambience, and speech, in the same pass. Compared with the earlier Grok Imagine Video model, the 1.5 generation improves audio quality, prompt following, and photorealism. Face accuracy and character consistency hold across longer sequences, with better lighting and physical realism. Expanded reference image support gives more control over visual style and subject. Grok Imagine Video 1.5 debuted at the top of crowd-sourced image-to-video arena rankings.
Integration runs through the AI SDK's generateVideo function, imported as experimental_generateVideo from AI SDK 6 or later. Pass a prompt object with an image and a text motion description. You control duration, aspect ratio, and resolution through parameters, with output available at 480p, 720p, and 1080p. Billing is per second of generated video, with rates by resolution shown on this page.
Grok Imagine Video 1.5 pairs well with grok-imagine-image: generate a still with generateImage, then animate that frame in the same flow. If you built against the preview, grok-imagine-video-1.5-preview remains in the catalog, and Grok Imagine Video 1.5 is the variant to target for production.
Copy link to headingWhat To Consider When Choosing a Provider
- Configuration: Video generation through AI Gateway requires AI SDK 6 or later and uses
experimental_generateVideo, an experimental API that may change between releases. Generation can take minutes for longer or higher-resolution clips. In Node.js, extend fetch timeouts so requests don't fail before the video finishes. - Configuration: Output is billed per second of generated video, and rates vary by resolution. Estimate clip length and resolution before scaling a workload, and iterate at lower resolutions before rendering final assets at 1080p.
- Zero Data Retention: Zero Data Retention is offered on a per-provider and model basis. See the documentation for details.
- Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.
Copy link to headingWhen to Use Grok Imagine Video 1.5
Best for
- Animating Product and Brand Stills: Turn existing key art or product shots into short clips with motion and sound
- Social and Marketing Video: Produce short-form clips with synchronized audio and no separate sound pass
- Character-Driven Scenes: Face accuracy and character consistency hold across longer sequences
- Image-First Creative Pipelines: Chain
grok-imagine-imagestills into video inside one AI SDK flow - Style-Controlled Generation: Reference image support steers visual style and subject
Consider alternatives when
- Existing Preview Integrations: Workloads validated on
grok-imagine-video-1.5-previewcan stay pinned while you migrate - Text-Only Prompting:
grok-imagine-videogenerates clips straight from text descriptions without a source image - Static Visuals:
grok-imagine-imageorgrok-imagine-image-procovers stills without video cost - Long-Form Production: Traditional editing tools give more control over extended content
Copy link to headingConclusion
Grok Imagine Video 1.5 is the production release of SpaceXAI's Imagine Video 1.5 line. You send a starting image and a motion prompt, and receive a finished clip with synchronized audio at up to 1080p. Wire Grok Imagine Video 1.5 up through the AI SDK's generateVideo function.
Copy link to headingFrequently Asked Questions
What inputs does Grok Imagine Video 1.5 take?
Grok Imagine Video 1.5 is an image-to-video model. Pass a prompt object with an
imageand atextmotion description to the AI SDK'sgenerateVideofunction. Expanded reference image support gives extra control over style and subject.Does Grok Imagine Video 1.5 generate audio?
Yes. Sound effects, ambience, and speech render in the same pass as the video, synchronized to the action.
What resolutions does Grok Imagine Video 1.5 support?
Output is available at 480p, 720p, and 1080p. Billing is per second of generated video, with rates by resolution listed on this page.
How does Grok Imagine Video 1.5 differ from
grok-imagine-video-1.5-preview?Grok Imagine Video 1.5 is the stable release of the Imagine Video 1.5 generation. The preview variant reached AI Gateway first and remains in the catalog; target the stable model for production work.
How do I integrate Grok Imagine Video 1.5 with the AI SDK?
Use
experimental_generateVideofrom AI SDK 6 or later. Generation can take minutes, so extend fetch timeouts in Node.js and save the returned video bytes fromresult.videos.How do I authenticate with Grok Imagine Video 1.5 through Vercel AI Gateway?
Use your Vercel AI Gateway API key with
spacexai/grok-imagine-video-1.5as the model identifier.Does Vercel AI Gateway support Zero Data Retention for Grok Imagine Video 1.5?
Zero Data Retention is not currently available for this model. Zero Data Retention is offered on a per-provider basis. See https://vercel.com/docs/ai-gateway/capabilities/zdr for details.