4Z API

创建视频

接口: POST https://4zapi.com/v1/videos/generations

Grok Imagine 文生/图生视频(POST /v1/videos/generations)。xAI 官方原生 JSON 入口,模型如 grok-imagine-video。 提交后通过 GET /v1/videos/{id} 轮询。

参数

  • Content-Type (header, string): 请求体 Content-Type,一般为 application/json
  • Authorization (header, string): Bearer API Key

请求体 (application/json)

  • aspect_ratio (string, 必填): ("1:1" | "16:9" | "9:16")
  • duration (integer, 必填): [1, 15]
  • model (string, 必填): 支持模型:grok-imagine-video、grok-imagine-video-1.5-preview、grok-imagine-video-1.5-lite,grok-1.5-video模型请使用POST /v1/videos
  • prompt (string, 必填): 提示词
  • resolution (string, 必填): ("480p" | "720p")
  • image (object): 不能和reference_images一起用
  • reference_images (array): 不能和reference_images一起用