Extend video (xAI shape)

Continue an existing video with a newly generated segment. Supported only on x-ai/grok-imagine-video — x-ai/grok-imagine-video-1.5 returns a 400.

🔴 duration is the length of the added segment, not the total

A 3-second source with duration: 2 yields a 5-second result.

⚠️ video.duration in the response also reports the added segment (2 in that example), not the total length. Billing likewise counts the added segment, matching the upstream's own basis.

⚠️ The source video must be between 2 and 15 seconds; shorter input is rejected upstream.

post/v1/videos/extensions

Request

  • Base URL: https://gateway.amux.ai
  • URL: https://gateway.amux.ai/v1/videos/extensions
  • Auth: HTTP bearer

Request body

modelstring required

Fixed to x-ai/grok-imagine-video.

promptstring required

Required: describes what happens in the continuation.

durationinteger

Length of the added segment in seconds, 2-10, defaulting to 6.

⚠️ This is not the total length — the result is the source length plus this value.

Example request

{
  "model": "x-ai/grok-imagine-video",
  "prompt": "The boat drifts further into the distance",
  "duration": 5,
  "video": {
    "url": "https://…/source.mp4"
  }
}

Response

The task was created.

request_idstring

The Amux task id. All retrieval paths accept only this value.

Changes

No recorded changes to this operation across all 1 revision of this API.