Skip to main content
POST
/
ai
/
xai
/
video
/
generate
xai generate video
curl --request POST \
  --url https://ai.pmock.com/api/ai/xai/video/generate \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "model": "grok-imagine-video",
  "duration": "6",
  "aspectRatio": "2:3",
  "resolution": "720P",
  "images": [
    "<string>"
  ]
}
'
{
  "code": 200,
  "message": "<string>",
  "data": {
    "taskId": "<string>"
  },
  "traceId": "<string>"
}

Body

application/json
prompt
string
required

Video generated prompt words, currently only supporting English explanations

Minimum string length: 1
model
enum<string>
required

video model

Available options:
grok-imagine-video
duration
enum<string>
default:6

video duration

Available options:
6,
10,
15
aspectRatio
enum<string>

video aspectRatio

Available options:
2:3,
3:2,
1:1,
9:16,
16:9
resolution
enum<string>
default:720P

video resolution

Available options:
480P,
720P
images
string[]

Reference image URL (Image generated video, up to 5 images); After providing the video size following the image, aspect ratio and resolution will be ignored

Response

200 - */*

OK

Unified return structure for response results

code
integer<int32>

Response status code

Example:

200

message
string

Response message

data
object

Response result

traceId
string

Response traceId