Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xingchaoyiqing.com/llms.txt

Use this file to discover all available pages before exploring further.

Submit an asynchronous video generation task using xAI’s Grok video models. The API accepts a prompt plus optional duration, aspect ratio, resolution, and reference images — then immediately returns a task id for polling. Grok supports both text-to-video and image-to-video modes, with four distinct model variants offering different duration ranges, resolution caps, and reference image constraints.

Base URL

https://zcbservice.aizfw.cn/kyyReactApiServer

Endpoint

POST /v1/grok/videos

Authentication

Authorization: Bearer YOUR_API_KEY

Models

Choose the model that best fits your duration, resolution, and billing needs:
ModelDurationAspect RatiosResolutionReference ImagesBilling
grok_video36–30s (default 10s)16:9 / 9:16 / 1:1 / 3:2 / 2:3480p / 720p (default 720p)Up to 7Per second
grok_video3_proFixed 10s16:9 (default)720p (default)SupportedPer call
grok_video3_max6 / 10 / 12 / 16 / 20 / 30s (default 10s)16:9 / 9:16 / 1:1480p / 720p (default 720p)Up to 5 (public URL only)Per second
grok_video3_stable6 or 10s (default 10s)16:9 / 9:16 / 3:2 / 2:3 / 1:1480p / 720p (default 720p)Up to 7 (public URL only)Per call
grok_video3_max and grok_video3_stable require reference images to be publicly accessible URLs — base64-encoded images are not supported for these models.

Request Parameters

model
string
required
The Grok model to use. See the model table above for capabilities.Supported values:
  • grok_video3
  • grok_video3_pro
  • grok_video3_max
  • grok_video3_stable
prompt
string
required
Text description of the video you want to generate. Include subject, action, camera movement, and visual style for best results.Example: "A cat dancing in the rain, cinematic style"
duration
integer
Output video duration in seconds. Behavior varies by model:
ModelSupported ValuesDefault
grok_video3Any integer 63010
grok_video3_proFixed 10 — do not set10
grok_video3_max6, 10, 12, 16, 20, 3010
grok_video3_stable6 or 1010
aspect_ratio
string
Output video aspect ratio. Defaults to 16:9 for all models.
ModelSupported Ratios
grok_video316:9, 9:16, 1:1, 3:2, 2:3
grok_video3_pro16:9
grok_video3_max16:9, 9:16, 1:1
grok_video3_stable16:9, 9:16, 3:2, 2:3, 1:1
resolution
string
Output resolution. Defaults to 720p for all models.
ModelSupported Resolutions
grok_video3480p, 720p
grok_video3_pro720p
grok_video3_max480p, 720p
grok_video3_stable480p, 720p
image_urls
array
Array of reference image URLs for image-to-video generation. When omitted, the request is treated as text-to-video.Constraints by model:
  • grok_video3 — up to 7 images
  • grok_video3_pro — reference images supported
  • grok_video3_max — up to 5 images; must be public URLs
  • grok_video3_stable — up to 7 images; must be public URLs
Example: ["https://example.com/ref1.jpg", "https://example.com/ref2.jpg"]
Passing image_urls switches the request to image-to-video mode. Do not pass image_urls for pure text-to-video generation.

Response Fields

id
string
Unique task identifier. Save this — you’ll use it to poll the Query Video Task endpoint.
object
string
Object type. Always "video".
created
integer
Unix timestamp of when the task was created.
model
string
The model name used for this task.
status
string
Task status at creation. Always "queued" on successful submission.
error
string
Error message. null on successful submission.

Code Examples

curl --request POST \
  --url https://zcbservice.aizfw.cn/kyyReactApiServer/v1/grok/videos \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "grok_video3_max",
    "prompt": "A cat dancing in the rain, cinematic style",
    "duration": 10,
    "aspect_ratio": "16:9",
    "resolution": "720p"
  }'

Example Response

{
  "id": "video_grok_1234567890",
  "object": "video",
  "created": 1774836724,
  "model": "grok_video3_max",
  "status": "queued",
  "error": null
}

Key Constraints

  • Omit image_urls for text-to-video; include it for image-to-video
  • For grok_video3_max: only the enumerated duration values are accepted — do not pass arbitrary seconds
  • For grok_video3_stable: reference images must be publicly accessible URLs (no base64)
  • More reference images generally means longer queue and generation time
  • grok_video3_pro has a fixed 10-second duration — do not set the duration field

Next Steps

Use the returned id to poll the Query Video Task endpoint for status updates and to retrieve video_url when generation completes.