xAI
Create an xAI video edit
Use POST /grok/v1/videos/edits to edit a source video with a text prompt, preserve motion, and get a request_id for async polling results.
POST
cURL
Use this endpoint to edit an existing MP4 with a text instruction. The output stays closer to the source clip’s timing and composition than a fresh generation request.
Before you send the request
- Provide a reachable
video.url - Keep the source clip short; xAI’s own guidance caps edits at about 8.7 seconds
- Use a focused instruction that describes one clear change
- Save the returned
request_id, because edits use the same polling flow as generation
Editing flow
Poll for the final result
Call Get xAI video results until the job is finished.
What changes on CometAPI
xAI documents video editing as the same async lifecycle as generation, just with a source video instead of an optional source image. CometAPI keeps that behavior and the same polling endpoint, so your edit workflow is still start -> poll -> download.Authorizations
Bearer token authentication. Use your CometAPI key.
Body
application/json
Edit instruction describing the change you want.
Example:
"Add snow to the scene."
Source video to edit. xAI documents an input limit of about 8.7 seconds.
xAI video model id.
Example:
"grok-imagine-video"
Optional output delivery configuration.
Optional end-user identifier.
Response
200 - application/json
Request accepted.
Deferred request id used for polling.