4Z API

Create video

Endpoint: POST https://4zapi.com/v1/videos/generations

Grok Imagine text/image-to-video (POST /v1/videos/generations). xAI native JSON entry; poll via GET /v1/videos/{id}.

Parameters

  • Content-Type (header, string): Request body Content-Type, usually application/json
  • Authorization (header, string): Bearer API Key

Request body (application/json)

  • aspect_ratio (string, required): ("1:1" | "16:9" | "9:16")
  • duration (integer, required): [1, 15]
  • model (string, required): support models:grok-imagine-video、grok-imagine-video-1.5-preview、grok-imagine-video-1.5-lite,please use POST /v1/videos for the `grok-1.5-video` model
  • prompt (string, required): Prompt
  • resolution (string, required): ("480p" | "720p")
  • image (object): Cannot be used with reference_images
  • reference_images (array): Cannot be used with reference_images