POST /paas/v4/videos/generations

Changed on

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.

Request

  • Base URL
    https://api.z.ai/api
  • URL
    https://api.z.ai/api/paas/v4/videos/generations
  • Auth
    HTTP bearer

Headers

Accept-Language'en-US,en'

Config desired response language for HTTP requests.

Example:en-US,en

Request body

model'cogvideox-3' required

The model code to be called.

promptstring

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_audioboolean

Whether to generate AI sound effects. Default: false (no sound effects).

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"

fps30 | 60

Video frame rate (FPS), optional values are 30 or 60. Default: 30.

duration5 | 10

Video duration, default is 5 seconds, supports 5 and 10 seconds.

request_idstring

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_idstring

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.

Example request

{
  "quality": "speed",
  "image_url": [
    "https://example.com/image.png"
  ],
  "size": "1920x1080",
  "fps": 30,
  "duration": 5
}

Response

Processing successful.

modelstring

Model name used in this call.

idstring

Task order number generated by the Z.AI, use this order number when calling the request result interface.

request_idstring

Task number submitted by the user during the client request or generated by the platform.

task_statusstring

Processing status, PROCESSING (processing), SUCCESS (success), FAIL (failure). Results need to be obtained via query.

Changes

    • breaking

      the ///// request property's minLength was increased from 0 to 6

    • breaking

      the ///// request property's minLength was increased from 0 to 6

    • breaking

      the ///// request property's minLength was increased from 0 to 6

    • breaking

      the ///// request property's minLength was increased from 0 to 6

    • breaking

      the ///// request property's minLength was increased from 0 to 6

    • warning

      the ///// request property's maxLength was set to 64

    • warning

      the ///// request property's maxLength was set to 64

    • warning

      the ///// request property's maxLength was set to 64

    • warning

      the ///// request property's maxLength was set to 64

    • warning

      the ///// request property's maxLength was set to 64