Grok Video Generation, Editing, and Downloads
QuotaAPI provides compatible endpoints for Grok video tasks. Video uses an asynchronous workflow: submit a job to receive a request_id, poll its status, and download the completed result through the protected content endpoint.
Requirements
- Bind the API Key to a Grok group, or to a Composite group that resolves the video model to Grok.
- Enable image and media generation for the group.
- Use a video model name currently exposed in the console.
Generation, editing, and extension submissions require a Grok target. Status and content requests must use the same user and API Key that submitted the task. QuotaAPI binds the request_id to the original upstream account so later polls do not drift to another account.
Text-to-video and image-to-video
curl https://quotarouter.ai/v1/videos/generations \
-H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5",
"prompt": "Slow ocean waves at sunrise, stable camera.",
"resolution": "720p",
"duration": 8
}'For image-to-video, include an input image in the same endpoint:
{
"model": "grok-imagine-video-1.5",
"prompt": "Animate the subject with subtle natural motion.",
"image": {
"url": "https://example.com/input.png"
}
}Save the returned request_id. Video generation is long-running: the submission response is not the final video, and a processing status is not a reason to create a duplicate task.
Video editing
curl https://quotarouter.ai/v1/videos/edits \
-H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video",
"prompt": "Use a cooler color grade and preserve the camera movement.",
"video": {
"url": "https://example.com/source.mp4"
},
"duration": 8
}'The target platform must be able to fetch the video URL. A signed URL should remain valid for the entire processing period.
Video extension
curl https://quotarouter.ai/v1/videos/extensions \
-H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video",
"prompt": "Continue the scene with the same movement and lighting.",
"video": {
"url": "https://example.com/source.mp4"
},
"duration": 6
}'Polling status
Replace the parameter in /v1/videos/{request_id} with the actual task ID:
curl https://quotarouter.ai/v1/videos/VIDEO_REQUEST_ID \
-H "Authorization: Bearer YOUR_QUOTAAPI_KEY"Use backoff while a task is processing, for example starting at 3 seconds and increasing to 10 seconds. Honor the response Retry-After header after a 429. When complete, use the URL provided by the status response or request the protected content endpoint.
Downloading the video
curl -L https://quotarouter.ai/v1/videos/VIDEO_REQUEST_ID/content \
-H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
--output result.mp4The parameterized routes are:
GET /v1/videos/{request_id}GET /v1/videos/{request_id}/content
The content endpoint requires the API Key and is not a public permanent link. Download completed media into your own storage when the application needs long-term retention.
Endpoint reference
| Method | Path | Purpose |
|---|---|---|
POST | /v1/videos/generations | Text-to-video or image-to-video |
POST | /v1/videos/edits | Edit an existing video from a prompt |
POST | /v1/videos/extensions | Extend an existing video |
GET | /v1/videos/{request_id} | Poll task status |
GET | /v1/videos/{request_id}/content | Download the completed video |
Error handling
| Status | Meaning |
|---|---|
400 | Invalid body, model, duration, resolution, or media URL |
401 | Invalid API Key |
403 | Media generation is disabled or inaccessible for the group |
404 | Unsupported group, missing task, or task owned by another Key |
429 | User, account, or media concurrency limit reached |
503 | No schedulable Grok account is currently available |
Available models, durations, and resolutions follow the current console configuration. See the compatibility matrix for platform boundaries.
