ModelSell Docs
VideosGrok Video

Grok Video Generation

Submit Grok video generation tasks with /v1/videos, then poll by task ID.

Grok video generation uses the OpenAI-compatible async /v1/videos endpoint. Store the returned id, then call GET /v1/videos/{task_id} to read progress and video_url.

CapabilityEndpoint
Create taskPOST /v1/videos
Poll taskGET /v1/videos/{task_id}
Modelsgrok-imagine-video, grok-imagine-video-1.5-preview

Create Video

curl -X POST "$MODELSELL_BASE_URL/v1/videos" \
  -H "Authorization: Bearer $MODELSELL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-video",
    "prompt": "The prompt to send is shown here",
    "seconds": "6",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "custom_domain": "true",
    "reference_images": [
      {
        "url": "http://38.145.220.6:9000/preview/reference.png"
      }
    ],
    "video": {
      "url": "http://38.145.220.6:9000/preview/reference.mp4"
    }
  }'

Send the request body as application/json. Use reference_images for reference image URLs and video.url for a reference video URL. Omit either field when that reference type is not needed.

The response is an async task object:

{
  "id": "video_55c77134-3fbe-4d5d-839f-c9af4556405b",
  "object": "video",
  "model": "grok-imagine-video",
  "status": "queued",
  "progress": 0,
  "created_at": 1762600200,
  "seconds": "6",
  "size": "720p"
}

Poll Result

curl "$MODELSELL_BASE_URL/v1/videos/video_55c77134-3fbe-4d5d-839f-c9af4556405b" \
  -H "Authorization: Bearer $MODELSELL_API_KEY"

When the task is complete, read video_url:

{
  "id": "video_55c77134-3fbe-4d5d-839f-c9af4556405b",
  "object": "video",
  "model": "grok-imagine-video",
  "status": "completed",
  "progress": 100,
  "created_at": 1762600200,
  "completed_at": 1762600260,
  "expires_at": 1762686660,
  "seconds": "6",
  "size": "720p",
  "remixed_from_video_id": "",
  "error": null,
  "video_url": "https://example.com/result.mp4"
}

Poll at a fixed interval. If status indicates failure, read error.message and error.code. After success, download or store video_url promptly.

On this page