Skip to content
xAI logo

Grok Imagine Video 1.5 Preview

Image-to-Video • xAI

View as MarkdownAgent setup

Model ID

Use with the Workers AI binding, the AI Gateway REST API, or the Unified API.

Calling the provider directly? Use the provider's model name instead, including with provider-native endpoints or the provider's own SDK. For example, Anthropic's name for anthropic/claude-opus-4.8 is claude-opus-4-8.

  • Third-party
  • Zero data retention

xAI's next-generation video generation model. Generates, edits, and extends videos from text and image inputs. Supports multiple aspect ratios and resolutions with improved quality over the previous generation.

Model Info
Terms and Licenselink ↗
More informationlink ↗
Zero data retentionYes
Pricing
  • @480p (per second)$0.08
  • @720p (per second)$0.14
  • Default (per second)$0.08
  • @1080p (per second)$0.25

Usage

const response = await env.AI.run(
  'xai/grok-imagine-video-1.5-preview',
  {
    prompt: 'Generate a slow and serene time-lapse',
    image: { url: 'https://docs.x.ai/assets/api-examples/video/milkyway-still.png' },
    duration: 12,
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "xai/grok-imagine-video-1.5-preview",
  "input": {
    "prompt": "Generate a slow and serene time-lapse",
    "image": {
      "url": "https://docs.x.ai/assets/api-examples/video/milkyway-still.png"
    },
    "duration": 12
  }
}'
{
  "state": "Completed",
  "result": {
    "video": "https://examples.aig.cloudflare.com/xai/grok-imagine-video-1.5-preview/image-to-video.mp4"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

Parameters

_operation
stringenum: generate, edit, extend
prompt
string
duration
integerminimum: 1maximum: 15
aspect_ratio
stringenum: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3
resolution
stringenum: 480p, 720p, 1080p
size
stringenum: 848x480, 1696x960, 1280x720, 1920x1080
user
string
video
string

API Schemas (Raw)

Input
Output

Was this helpful?