Skip to content
Dashboard

Link to headingThree ways to get started

import { experimental_generateVideo as generateVideo } from 'ai';
const { videos } = await generateVideo({
model: 'xai/grok-imagine-video',
prompt: 'A golden retriever catching a frisbee mid-air at the beach',
});

Link to headingAvailable Model

Link to headingSimple: Text-to-Video

import { experimental_generateVideo as generateVideo } from 'ai';
const { videos } = await generateVideo({
model: 'xai/grok-imagine-video',
prompt:
`Two elegant white swans gliding on a misty lake at dawn, soft golden light,
reflections on still water, romantic atmosphere, cinematic`,
aspectRatio: '16:9',
resolution: '1280x720',
duration: 3,
});

Link to headingAdvanced: Reference-to-Video

import { experimental_generateVideo as generateVideo } from 'ai';
const { videos } = await generateVideo({
model: 'xai/grok-imagine-video',
prompt:
'Transform into anime style, soft hand-painted look, warm dreamy atmosphere',
providerOptions: {
xai: {
videoUrl: sourceVideo,
},
},
});

Link to headingLearn More

Ready to deploy?