Extend a previously generated video using xAI’s Grok Imagine model via HTTP streaming. Provide the task_id of a completed video generation and choose between preset mode or custom mode.

Model

xai/grok-imagine-video-extend

Modes

There are two mutually exclusive modes:
ModeHow to activateBehaviour
PresetProvide video_presetThe preset controls the video style. prompt, extend_at, and extend_duration are ignored
CustomOmit video_presetYou control timing and prompt. prompt, extend_at, and extend_duration are required

Parameters

ParameterTypeRequiredDescription
task_idstringYesTask ID of a completed video generation
video_presetstringNo"spicy" or "normal". Enables preset mode
promptstringNoText prompt to guide the extension. Required in custom mode
extend_atfloatNoSecond in the source video to start the extension from. Required in custom mode
extend_durationintNoLength of the extension: 6 or 10 seconds. Required in custom mode

Example Requests

Preset Mode

curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "xai/grok-imagine-video-extend",
    "input": {
      "task_id": "abc123def456",
      "video_preset": "spicy"
    }
  }'

Custom Mode

curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "xai/grok-imagine-video-extend",
    "input": {
      "task_id": "abc123def456",
      "prompt": "The camera continues panning right to reveal a mountain range",
      "extend_at": 8.5,
      "extend_duration": 10
    }
  }'

Response

{
  "code": 200,
  "success": true,
  "data": {
    "task_id": "xyz789ghi012",
    "status": "pending"
  }
}