Generate videos using xAI's Grok Imagine Video model. Supports text-to-video, image-to-video, and editing an existing short video clip.
Test this model instantly in the Console Playground โ no code required
Copy usage instructions for Claude, ChatGPT, or other AI
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "xai/grok-imagine-video",
"input": {
"prompt": "a penguin walks away from the camera, towards a large snowy mountaintop in the distance",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
}'| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | - | Text prompt for video generation |
image | string | No | - | Input image to generate video from (image-to-video). Supports jpg, jpeg, png, webp |
video | string | No | - | Input video to edit (video editing mode). Direct link, max 8.7 seconds. mp4, mov, webm |
duration | integer | No | 5 | Duration of the video in seconds (1-15). Ignored when editing a video |
resolution | string | No | 720p | Resolution of the video. Ignored when editing a video 720p480p |
aspect_ratio | string | No | auto | Aspect ratio. Defaults to 16:9 for text-to-video, or the input image's ratio for image-to-video. Ignored when editing a video auto16:94:31:19:163:43:22:3 |
There are 3 ways to provide files for the imagevideo parameters:
Attach files directly to POST /v1/predictions/upload. No separate upload step needed.
curl -X POST "https://api.core.today/v1/predictions/upload" \
-H "X-API-Key: cdt_your_api_key" \
-F "model=xai/grok-imagine-video" \
-F 'input={"prompt":"your prompt here"}' \
-F "file:image=@your_file.png"Pass a publicly accessible URL directly. You can also use file_url from the Storage API.
{
"model": "xai/grok-imagine-video",
"input": {
"prompt": "your prompt here",
"image": "https://example.com/image.jpg"
}
}Common parameters used when calling POST /v1/predictions.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model identifier |
input | object | Yes | - | Object containing the model-specific parameters from the table above |
output_folder | string | No | - | Folder path for output files (max 256 chars, '..' not allowed) |
webhook_url | string | No | - | Webhook URL to call on completion |
is_public | boolean | No | false | If true, output files are also available via permanent public URLs |
Generate a 5-second clip directly from a text prompt
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "xai/grok-imagine-video",
"input": {
"prompt": "a penguin walks away from the camera, towards a large snowy mountaintop in the distance",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
}'The maximum 15-second duration, still billed at the same flat per-second rate
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "xai/grok-imagine-video",
"input": {
"prompt": "a lone astronaut walking across a red Martian desert as twin suns set on the horizon",
"duration": 15,
"resolution": "480p",
"aspect_ratio": "21:9"
}
}'POST /v1/predictions