Skip to main content
Core.Today
|
xAIMediumStandard

Grok Imagine Video Edit

Edit an existing video with xAI's Grok Imagine Video model. The output inherits the source video's duration, resolution (720p cap), and aspect ratio.

2660 credits
per 15s (billing default when duration is omitted) โ€” billed per second (186/s)
Prompt-based editing of an existing video
Output inherits source duration, resolution (720p cap), and aspect ratio
Synchronized audio preserved in output

Run it right now

Test this model instantly in the Console Playground โ€” no code required

Sign in to try

Use with AI Assistant

Copy usage instructions for Claude, ChatGPT, or other AI

Quick Start

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/edit",
  "input": {
    "prompt": "Add gentle falling snow to the scene",
    "video": "https://example.com/clip.mp4",
    "duration": 5
  }
}'

Parameters

ParameterTypeRequiredDefaultDescription
promptstringYes-Text prompt describing the edit.
videostringYes-Source video URL to edit. Output inherits its duration, resolution (720p cap) and aspect ratio.
durationintegerNo15Billing hint - the length of your source video in seconds (1-15). xAI ignores this parameter; output always matches the source length. Omitting it bills the 15-second maximum.

How to Provide File Input

There are 3 ways to provide files for the video parameter:

Recommended

Image URL

Pass a publicly accessible URL directly. With the Storage API (POST /v1/files/upload-url) the file uploads straight to S3 (50MB per file) and you pass the returned file_url.

{
  "model": "xai/grok-imagine-video/edit",
  "input": {
    "prompt": "your prompt here",
    "video": "https://example.com/image.jpg"
  }
}

Direct Upload (Multipart)

Attach files directly to POST /v1/predictions/upload. No separate upload step, but the bytes pass through the API server so the whole request is capped at 10MB.

curl -X POST "https://api.core.today/v1/predictions/upload" \
  -H "X-API-Key: cdt_your_api_key" \
  -F "model=xai/grok-imagine-video/edit" \
  -F 'input={"prompt":"your prompt here"}' \
  -F "file:video=@your_file.png"
See the File Upload docs for more upload methods including Presigned URLs.

Common Parameters

Common parameters used when calling POST /v1/predictions.

ParameterTypeRequiredDefaultDescription
modelstringYes-Model identifier
inputobjectYes-Object containing the model-specific parameters from the table above
output_folderstringNo-Folder path for output files (max 256 chars, '..' not allowed)
webhook_urlstringNo-Webhook URL to call on completion
is_publicbooleanNofalseIf true, output files are also available via permanent public URLs

Examples

Weather Effect

Add falling snow to an existing clip

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/edit",
  "input": {
    "prompt": "Add gentle falling snow to the scene",
    "video": "https://example.com/clip.mp4",
    "duration": 5
  }
}'

Tips & Best Practices

1Always pass duration matching your source video - omitting it bills the 15s maximum
2Charged at the 720p rate regardless of source resolution (output caps at 720p)
3For generating new videos, use xai/grok-imagine-video or xai/grok-imagine-video-1.5

Use Cases

Adding effects (weather, lighting, mood) to generated clips
Style transfer on short clips
Iterating on Grok Imagine Video outputs without regenerating from scratch