Skip to content

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

  1. Bind the API Key to a Grok group, or to a Composite group that resolves the video model to Grok.
  2. Enable image and media generation for the group.
  3. 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

bash
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:

json
{
  "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

bash
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

bash
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:

bash
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

bash
curl -L https://quotarouter.ai/v1/videos/VIDEO_REQUEST_ID/content \
  -H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
  --output result.mp4

The 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

MethodPathPurpose
POST/v1/videos/generationsText-to-video or image-to-video
POST/v1/videos/editsEdit an existing video from a prompt
POST/v1/videos/extensionsExtend an existing video
GET/v1/videos/{request_id}Poll task status
GET/v1/videos/{request_id}/contentDownload the completed video

Error handling

StatusMeaning
400Invalid body, model, duration, resolution, or media URL
401Invalid API Key
403Media generation is disabled or inaccessible for the group
404Unsupported group, missing task, or task owned by another Key
429User, account, or media concurrency limit reached
503No schedulable Grok account is currently available

Available models, durations, and resolutions follow the current console configuration. See the compatibility matrix for platform boundaries.

QuotaAPI is an AI API relay service for developers and teams.