OpenAI Format

Grok Imagine Video

Use `POST /v1/videos` with the `grok-imagine-video` model to submit JSON video generation tasks.

POSThttps://zx1.deepwl.net/v1/videos
Request
curl -X POST https://zx1.deepwl.net/v1/videos \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '
{
  "model": "grok-imagine-video",
  "prompt": "A city street in the early morning, sunlight filtering through leaves, camera slowly moving forward",
  "seconds": "8",
  "aspect_ratio": "16:9",
  "resolution": "720P"
}'
Response
{
  "id": "video_abc123",
  "object": "video",
  "model": "grok-imagine-video",
  "status": "queued",
  "progress": 0,
  "created_at": 1735689600,
  "seconds": "6",
  "size": "720P",
  "video_url": ""
}

grok-imagine-video is the video generation model of the Grok Imagine series. It uses a JSON request body and supports text-to-video and reference-image video generation.

  • The endpoint path is POST /v1/videos.
  • The request format is application/json.
  • Text-to-video only requires model, prompt, seconds, aspect_ratio, and resolution.
  • For image-to-video, use image for a single image and images for multiple images.
  • resolution supports 480P and 720P.
  • prompt supports up to 4096 characters.

Request Headers

Authorizationstring必填

Authentication header. Uses a Bearer token, e.g. Bearer YOUR_API_KEY.

Content-Typestring必填

Request content type, must be application/json.

Request Body

modelstring必填

Always pass grok-imagine-video.

promptstring必填

Video generation prompt. Up to 4096 characters.

secondsstring

Target duration in seconds. Minimum is 1 second; passing it as a string is recommended, e.g. "6".

aspect_ratiostring

Aspect ratio. Supports common presets 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 19.5:9, 9:19.5, 20:9, 9:20, as well as custom number:number ratios.

resolutionstring

Output resolution. Supports 480P and 720P; numeric forms like 480 and 720 are also accepted.

imagestring

Single reference image, as a data URI such as data:image/png;base64,....

imagesarray<string>

Multiple reference images. Each array member is a data URI such as data:image/png;base64,.... Do not pass image together with images.

Request Examples

Response Examples

Response Fields

idstring

Task ID. Query the result later with GET /v1/videos/{id}.

objectstring

Object type, usually video.

modelstring

The model name actually submitted.

statusstring

Task status. Common values are queued, processing, completed, failed, cancelled.

progressinteger

Task progress percentage.

video_urlstring

Video URL after the task completes. You can also download the result with GET /v1/videos/{task_id}/content.

Differences from Grok 1.5 / 3

Itemgrok-imagine-videogrok-video-1.5 / grok-video-3
Request formatJSONmultipart/form-data
Image fieldimage / imagesinput_reference
Resolution fieldresolutionsize
Resolution values480P, 720P480P, 540P, 720P, 1080P
Duration rulesCustom seconds, min 1s10s for Pro tier, 15s for Max tier