---
title: "POST /paas/v4/videos/generations"
method: POST
path: "/paas/v4/videos/generations"
---

# POST /paas/v4/videos/generations

`POST /paas/v4/videos/generations`

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.

Vidu: A high-performance video large model that combines high consistency and high dynamism, with precise semantic understanding and exceptional reasoning speed.

## Headers

- `Accept-Language` 'en-US,en' — Config desired response language for HTTP requests.

## Request body

- union
  - CogVideoX3Request
    - `model` 'cogvideox-3', required — The model code to be called.
    - `prompt` string — Text description of the video, maximum input length of 512 characters. Either image_url or prompt must be provided, or both.
    - `quality` 'speed' | 'quality' — Output mode, default is `speed`. - `quality`: Prioritizes quality, higher generation quality. - `speed`: Prioritizes speed, faster generation time, relatively lower quality.
    - `with_audio` boolean — Whether to generate AI sound effects. Default: `false` (no sound effects).
    - `image_url` union[] — 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
      - union
        - string, uri
        - string, byte
    - `size` '1280x720' | '720x1280' | '1024x1024' | '1920x1080' | '1080x1920' | '2048x1080' | '3840x2160' — 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"
    - `fps` 30 | 60 — Video frame rate (FPS), optional values are `30` or `60`. Default: `30`.
    - `duration` 5 | 10 — Video duration, default is 5 seconds, supports `5` and `10` seconds.
    - `request_id` string — Passed by the user side, needs to be unique; used to distinguish each request, 6–64 characters. If not provided by the user side, the platform will generate one by default.
    - `user_id` string — Unique ID of the end-user, assists the platform in intervening in end-user violations, generating illegal or inappropriate information, or other abusive behaviors. ID length requirement: minimum `6` characters, maximum `128` characters.
  - ViduText2VideoRequest
    - `model` 'viduq1-text', required — The model code to be called.
    - `prompt` string, required — Text description of the video, maximum input length of 512 characters.
    - `style` 'general' | 'anime' — Style Default: `general` Optional values: `general` , `anime` - `general`: General style, can be controlled using prompts to define the style. - `anime`: Anime style, optimized for anime-specific visuals. The style can be controlled using different anime-themed prompts.
    - `duration` 5 — Video duration parameter. Default: `5` , Optional: `5`.
    - `aspect_ratio` '16:9' | '9:16' | '1:1' — Aspect ratio Default: `16:9`, Optional values: `16:9`, `9:16`, `1:1`
    - `size` '1920x1080' — Resolution parameter Default: `1920x1080`, Optional: `1920x1080`
    - `movement_amplitude` 'auto' | 'small' | 'medium' | 'large' — Motion amplitude Default: `auto` , Optional values: `auto` ,`small` ,`medium` ,`large`
    - `request_id` string — Passed by the user side, needs to be unique; used to distinguish each request, 6–64 characters. If not provided by the user side, the platform will generate one by default.
    - `user_id` string — Unique ID of the end-user, assists the platform in intervening in end-user violations, generating illegal or inappropriate information, or other abusive behaviors. ID length requirement: minimum `6` characters, maximum `128` characters.
  - ViduImage2VideoRequest
    - `model` 'viduq1-image' | 'vidu2-image', required — The model code to be called.
    - `prompt` string — Text description of the video, maximum input length of 512 characters. Either image_url or prompt must be provided, or both.
    - `image_url` union — The model will use the image provided in this parameter as the first frame to generate the video. Only `1` image is supported. Supported formats: `png` , `jpeg` , `jpg` , `webp` . Image aspect ratio must be less than `1:4` or `4:1`. Image file size must not exceed `50MB`. Note: After Base64 decoding, the byte length must be less than 50 MB, and the encoding must include the appropriate content type string (e.g., `data:image/png;base64,{base64_encode}`).
      - string, uri
      - string, byte
    - `duration` union
      - 5 — Video duration parameter. Default: `5` , Optional: `5`.
      - 4 — Video duration parameter. Default: `4` , Optional: `4`.
    - `size` union
      - '1920x1080' — Resolution parameter Default: `1920x1080`, Optional: `1920x1080`
      - '1280x720' — Resolution parameter Default: `1280x720`, Optional: `1280x720`
    - `movement_amplitude` 'auto' | 'small' | 'medium' | 'large' — Motion amplitude Default: `auto` , Optional values: `auto` ,`small` ,`medium` ,`large`
    - `with_audio` boolean — Add background music to the generated video.
    - `request_id` string — Passed by the user side, needs to be unique; used to distinguish each request, 6–64 characters. If not provided by the user side, the platform will generate one by default.
    - `user_id` string — Unique ID of the end-user, assists the platform in intervening in end-user violations, generating illegal or inappropriate information, or other abusive behaviors. ID length requirement: minimum `6` characters, maximum `128` characters.
  - ViduFrames2VideoRequest
    - `model` 'viduq1-start-end' | 'vidu2-start-end', required — The model code to be called.
    - `prompt` string — Text description of the video, maximum input length of 512 characters. Either image_url or prompt must be provided, or both.
    - `image_url` string[] — Images Supports input of two images: the first uploaded image will be treated as the first frame, and the second image as the last frame. The model will use the images provided in this parameter to generate a video. The resolutions of the two input images (first and last frame) must be similar, with the ratio between the resolution of the first frame and the resolution of the last frame falling within `0.8–1.25`. Additionally, the image aspect ratio must be less than `1:4` or `4:1`. Supports image URLs or images encoded in Base64 (ensure accessibility; using image URLs is recommended). Supported formats: `png`, `jpeg`, `.jpg`, `webp`. Image file size must not exceed `50 MB`. Note: After Base64 decoding, the byte length must be less than 50 MB, and the encoding must include the appropriate content type string, such as `data:image/png;base64,{base64_encode}`.
    - `duration` union
      - 5 — Video duration parameter. Default: `5` , Optional: `5`.
      - 4 — Video duration parameter. Default: `4` , Optional: `4`.
    - `size` union
      - '1920x1080' — Resolution parameter Default: `1920x1080`, Optional: `1920x1080`
      - '1280x720' — Resolution parameter Default: `1280x720`, Optional: `1280x720`
    - `movement_amplitude` 'auto' | 'small' | 'medium' | 'large' — Motion amplitude Default: `auto` , Optional values: `auto` ,`small` ,`medium` ,`large`
    - `with_audio` boolean — Add background music to the generated video.
    - `request_id` string — Passed by the user side, needs to be unique; used to distinguish each request, 6–64 characters. If not provided by the user side, the platform will generate one by default.
    - `user_id` string — Unique ID of the end-user, assists the platform in intervening in end-user violations, generating illegal or inappropriate information, or other abusive behaviors. ID length requirement: minimum `6` characters, maximum `128` characters.
  - ViduReference2VideoRequest
    - `model` 'vidu2-reference', required — The model code to be called.
    - `prompt` string — Text description of the video, maximum input length of 512 characters. Either image_url or prompt must be provided, or both.
    - `image_url` string[] — Image reference Supports input of 1 to 3 images. The model will use the themes from the images provided in this parameter as references to generate a video with consistent subjects. 1. Supports image URLs or images encoded in Base64 (ensure accessibility; it is recommended to prioritize using image URLs). 2. Supported formats: `png`, `jpeg`, `.jpg`, `webp`. 3. Image resolution must not be smaller than `128x128`, and the aspect ratio must be less than `1:4` or `4:1`. 4. Image file size must not exceed `50 MB`. 5. Note: After Base64 decoding, the byte length must be less than 50 MB, and the encoding must include the proper content-type string, such as `data:image/png;base64,{base64_encode}`.
    - `duration` 4 — Video duration parameter. Default: `4` , Optional: `4`.
    - `aspect_ratio` '16:9' | '9:16' | '1:1' — Aspect ratio Default: `16:9`, Optional values: `16:9`, `9:16`, `1:1`
    - `size` '1280x720' — Resolution parameter Default: `1280x720`, Optional: `1280x720`
    - `movement_amplitude` 'auto' | 'small' | 'medium' | 'large' — Motion amplitude Default: `auto` , Optional values: `auto` ,`small` ,`medium` ,`large`
    - `with_audio` boolean — Add background music to the generated video.
    - `request_id` string — Passed by the user side, needs to be unique; used to distinguish each request, 6–64 characters. If not provided by the user side, the platform will generate one by default.
    - `user_id` string — Unique ID of the end-user, assists the platform in intervening in end-user violations, generating illegal or inappropriate information, or other abusive behaviors. ID length requirement: minimum `6` characters, maximum `128` characters.

## Response `200`

Processing successful.

- VideoResponse
  - `model` string — Model name used in this call.
  - `id` string — Task order number generated by the Z.AI, use this order number when calling the request result interface.
  - `request_id` string — Task number submitted by the user during the client request or generated by the platform.
  - `task_status` string — Processing status, `PROCESSING (processing)`,` SUCCESS (success)`, `FAIL (failure)`. Results need to be obtained via query.

## Other responses

- `default` — The request has failed.

---

[API](https://skmtc.net/z/apis/z-ai-api.md) · [All operations](https://skmtc.net/z/apis/z-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/z/z-ai-api/revisions/242a797fa80b/schema)
