curl --request POST \
--url https://api.z.ai/api/paas/v4/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "cogvideox-3",
"prompt": "A cat is playing with a ball.",
"quality": "quality",
"with_audio": true,
"size": "1920x1080",
"fps": 30
}
'{
"model": "<string>",
"id": "<string>",
"request_id": "<string>",
"task_status": "<string>"
}{
"code": 123,
"message": "<string>"
}Generate Video(Async)
CogVideoX is a video generation large model developed by Z.AI, equipped with powerful video generation capabilities. Simply inputting text or images allows for effortless video creation.
curl --request POST \
--url https://api.z.ai/api/paas/v4/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "cogvideox-3",
"prompt": "A cat is playing with a ball.",
"quality": "quality",
"with_audio": true,
"size": "1920x1080",
"fps": 30
}
'{
"model": "<string>",
"id": "<string>",
"request_id": "<string>",
"task_status": "<string>"
}{
"code": 123,
"message": "<string>"
}Headers
Body
Provide an image based on which content will be generated. If this parameter is passed, the system will operate based on this image. Supports passing images via URL or Base64 encoding. Image requirements: images support .png, .jpeg, .jpg formats; image size: no more than 5M. Either image_url and prompt can be used, or both can be passed simultaneously.
First and last frames: supports inputting two images. The first uploaded image is regarded as the first frame, and the second image is regarded as the last frame. The model will generate the video based on the images passed in this parameter.
First and last frame mode only supports speed mode
"https://example.com/image.png"
Default value: if not specified, the short side of the generated video is 1080 by default, and the long side is determined according to the original image ratio. Maximum support for 4K resolution. Resolution options: "1280x720", "720x1280", "1024x1024", "1080x1920", "2048x1080", "3840x2160"
1280x720, 720x1280, 1024x1024, 1920x1080, 1080x1920, 2048x1080, 3840x2160 "1920x1080"
Response
Processing successful.
Was this page helpful?