Edit video (xAI shape)

Rewrite an existing video from a text instruction. Supported only on x-ai/grok-imagine-video — x-ai/grok-imagine-video-1.5 returns a 400.

This endpoint is asynchronous: submitting returns a task id and the result is retrieved by polling.

Differences from the generation endpoint

GenerateEdit
promptOptionalRequired (describes the change)
videoNot acceptedRequired
duration1-15sNot accepted; output length follows the source
Aspect ratio / resolution / audioAcceptedNot accepted; all follow the source

⚠️ The source video may be at most 8.7 seconds; longer input is rejected upstream.

post/v1/videos/edits

Request

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

Request body

modelstring required

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

promptstring required

Required: describes what the video should become.

moderation'low' | 'auto' | 'high'

Moderation strength. The upstream default applies when omitted.

userstring

End-user identifier for abuse tracing. Send a hash rather than the raw value.

Example request

{
  "model": "x-ai/grok-imagine-video",
  "prompt": "Make it start snowing",
  "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.