Edit video
Endpoint: POST https://tkhub.lol/v1/videos/edits
Grok Imagine video editing via the xAI native JSON API. Only grok-imagine-video is supported; the 1.5 models and channel aliases such as grok-1.5-video cannot be used for editing. The response contains a request_id; poll GET /v1/videos/{request_id} for the result. Billed per second; see the model marketplace for prices.
Parameters
Content-Type(header, string): Request body Content-Type, usually application/jsonAuthorization(header, string): Bearer API Key
Request body (application/json)
model(string, required): Model name: grok-imagine-video onlyprompt(string, required): Editing instructionresolution(string, required): Resolution: 480p, 720pvideo(object, required): Video to editaspect_ratio(string): Aspect ratio: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 5:2. If omitted, follows the input video
Request example
{
"model": "grok-imagine-video",
"prompt": "Give the woman a silver necklace",
"resolution": "480p",
"video": {
"url": "https://example.com/source-video.mp4"
}
}