Amux

Edit xAI video

Last updated September 13, 2026

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

Rewrite an existing video from a text instruction, using the native xAI request shape.

POSThttps://gateway.amux.ai/v1/videos/edits

Authorization

header
AuthorizationstringRequired

Bearer <your Amux key> An Amux key created in the console. If you lose it, you can view it again on the keys page.

Request

application/json
modelstringRequired

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

promptstringRequired

Required: describes what the video should become.

videoobjectRequired

The source video to edit.

videoobject
urlstring

Source video address (mp4); must be a publicly reachable URL.

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.

Response

200response

The task was created.

400response

Invalid request (model does not support editing, missing prompt or source video, or source video too long).

402response

Insufficient balance to reserve the cost of this task.

Supported only on x-ai/grok-imagine-video

x-ai/grok-imagine-video-1.5 has no editing capability and returns a 400 on this endpoint. This is a capability difference of the model itself: the generation endpoint does not accept a video field either, so editing and extension cannot be performed through it. Use x-ai/grok-imagine-video when these capabilities are required.

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.

Billing

cost = output seconds × resolution tier rate
     + source video seconds × input-video per-second rate

An edit's output length always equals the source length, so the two second counts are identical. The tier follows the source video: a 1080p source is billed at the 720p tier on this model.

Official price reference

The figures below are xAI's public list prices, provided for order-of-magnitude estimation. They are not this site's charges — the authoritative rates are on the model detail and pricing pages.

TierOutput (per second)Input video (per second)
480p$0.05$0.01
720p$0.07$0.01

On that basis, editing a 5-second 480p video is roughly 5 × 0.05 + 5 × 0.01 = 0.30.

cURL
curl https://gateway.amux.ai/v1/videos/edits \
  -H "Authorization: Bearer $AMUX_API_KEY" \
  -d '{
    "model": "x-ai/grok-imagine-video",
    "prompt": "Make it start snowing",
    "video": {
      "url": "https://…/source.mp4"
    }
  }'
{
  "request_id": "<string>"
}