Overview
Video generation using xAI's Grok model. Suitable for creative and coherent video synthesis from descriptive text prompts.
Primary Endpoint
POST
/api/v1/grokVideo/startStart Grok Imagine video generation
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | No | Name of the video generation task (optional, for identifying the task) |
| model_type | enum: text-to-video | image-to-video | No | Generation mode. `text-to-video` generates video from text prompt, `image-to-video` generates video from a reference image. |
| model_version | enum: legacy | 1.5 | No | Model version. `1.5` uses Grok Imagine Video 1.5 and only supports image-to-video. |
| prompt | string | No | Text prompt describing the video content. Required for text-to-video mode, optional for image-to-video mode. |
| mode | enum: fun | normal | spicy | No | Generation style mode. For image-to-video, upstream may fallback spicy to normal. |
| image_urls | array<string> | No | Array of reference image URLs for image-to-video mode. At least one image is required when `model_type` is `image-to-video`. |
| image_url | string | No | Single reference image URL (alternative to `image_urls`). Will be prepended to `image_urls` array. |
| aspect_ratio | enum: auto | 1:1 | 16:9 | 9:16 | 4:3 | 3:4 | 3:2 | 2:3 | No | Video aspect ratio. Legacy text-to-video supports 1:1/16:9/9:16; legacy image-to-video can additionally accept 4:3/3:4/3:2/2:3 depending on the selected generation path. Grok 1.5 accepts the full list including auto. |
| duration | enum: 6 | 10 | 15 | No | Video duration in seconds. |
| nsfw_checker | boolean | No | Whether to enable additional NSFW checking for Grok 1.5. |
| webhook_url | string | No | HTTPS URL to receive task.completed / task.failed notifications. Best-effort delivery, single attempt, no retries; clients should treat the detail API as the source of truth. |
| webhook_token | string | No | Optional plaintext token returned in the X-A2e-Webhook-Token header so receivers can verify the request originated from a2e. |
Request Example
curl -X POST "https://www.a2e.com.cn/api/v1/grokVideo/start" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My Grok Video",
"model_type": "text-to-video",
"model_version": "1.5",
"prompt": "A cat playing with a ball of yarn in a cozy living room, warm lighting, cinematic style",
"mode": "normal",
"image_urls": [
"https://example.com/reference.jpg"
],
"image_url": "https://example.com/image.jpg",
"aspect_ratio": "16:9",
"duration": "6",
"nsfw_checker": false,
"webhook_url": "https://your-server.example.com/a2e/webhook",
"webhook_token": "a-shared-secret"
}'Related Endpoints
POST
/api/v1/grokVideo/startStart Grok Imagine video generation
GET
/api/v1/grokVideo/allRecordsGet Grok Video task list
POST
/api/v1/grokVideo/batchDetailBatch query task details
GET
/api/v1/grokVideo/{_id}Get Grok Video task detail
DELETE
/api/v1/grokVideo/{_id}Delete Grok Video task
Responses
200
Video generation task started successfully
400
Bad Request - Invalid parameters
401
Unauthorized - Invalid or missing bearer token