Skip to content

Stream or run a video response · cogvideo-fast ​

POST/v1/responses

stream=true reports progress and a final video link via Responses SSE, ending with response.completed. background=true returns a resp_ ID to poll. SSE does not contain video frames.

Synchronous · direct result · This request waits for processing and returns JSON or a file directly.

Authentication

Use a customer API Key. Setup →

Authorization: Bearer YOUR_API_KEY

Choose a model

Model capabilities and limits →

Request body

Use stream=true or background=true for long video requests. Video-specific fields are site extensions; no chat/completions protocol.

Input and model rules
  • Cannot combine input_reference, image_url.
  • When model = "cogvideo-basic": seconds: 1–5 or ^[1-5]$; duration: 1–5 or ^[1-5]$; must not reference_images is present; must not metadata is present and metadata.reference_images is present.
  • When model = "cogvideo-short": seconds accepts only 8, "8"; duration accepts only 8, "8"; size must be "720x1280"; resolution must be "720p"; aspect_ratio must be "9:16"; must not input_reference is present; must not image_url is present; must not reference_images is present; must not metadata is present and metadata.reference_images is present; otherwise size accepts only "1920x1080", "1080x1920", "1080x1080", "1440x1080", "1080x1440"; resolution must be "1080p".
  • Choose exactly one input option: input or prompt.
modelstringrequired

"cogvideo-fast""cogvideo-pro""cogvideo-basic""cogvideo-short"
promptstring

Non-blank prompt, at most 4096 Unicode characters.

Minimum characters: 1 · Maximum characters: 4096 · Pattern: "\\S"

secondsoneOf

Defaults: fast/pro/basic=5; short=8. Basic maximum 5; reference mode minimum 3; short exactly 8.

Show structure
oneOf · 1

integer

Minimum: 1 · Maximum: 10

oneOf · 2

string

Pattern: "^(10|[1-9])$"

durationoneOf

Defaults: fast/pro/basic=5; short=8. Basic maximum 5; reference mode minimum 3; short exactly 8.

Show structure
oneOf · 1

integer

Minimum: 1 · Maximum: 10

oneOf · 2

string

Pattern: "^(10|[1-9])$"

sizestring

fast/pro/basic: 1080p sizes only; short: 720x1280 only. Actual encoding dimensions are read from the file.

"1920x1080""1080x1920""1080x1080""1440x1080""1080x1440""720x1280"
resolutionstring

"1080p""720p"
aspect_ratiostring

"16:9""9:16""1:1""4:3""3:4"
input_referencestring

HTTP(S) image URL or Base64 image data URL.

Pattern: "^(https?://|data:image/)"

image_urlstring

HTTP(S) image URL or Base64 image data URL.

Pattern: "^(https?://|data:image/)"

reference_imagesarray

Minimum items: 1

Show structure

string — HTTP(S) image URL or Base64 image data URL.

Pattern: "^(https?://|data:image/)"

generation_modestring

"speed""pro""pro_ad"
metadataobject

Show structure
modestring

Must match supplied images.

"text_to_video""image_to_video""reference_to_video"
resolutionstring
"1080p""720p"
aspect_ratiostring
"16:9""9:16""1:1""4:3""3:4"
reference_imagesarray

Minimum items: 1

Show structure

string — HTTP(S) image URL or Base64 image data URL.

Pattern: "^(https?://|data:image/)"

generation_modestring

Reference mode only.

"speed""pro""pro_ad"

Default: "pro_ad"

Additional properties are not allowed.

ninteger

Fixed value: 1 · Default: 1

sample_countinteger

Fixed value: 1 · Default: 1

inputoneOf

Text or structured text/image messages; cannot be combined with prompt.

Show structure
oneOf · 1

string

Minimum characters: 1

oneOf · 2

array

Minimum items: 1

streamboolean

Default: false

backgroundboolean

Default: false

storeboolean

Responses protocol field accepted by the host.

oneOf · 1
Input and model rules
  • Cannot combine prompt.

object

Required fields: input

Conditional constraints (JSON Schema)
{
  "required": [
    "input"
  ],
  "not": {
    "required": [
      "prompt"
    ]
  }
}
oneOf · 2
Input and model rules
  • Cannot combine input.

object

Required fields: prompt

Conditional constraints (JSON Schema)
{
  "required": [
    "prompt"
  ],
  "not": {
    "required": [
      "input"
    ]
  }
}
allOf · 1
Input and model rules
  • Cannot combine input_reference, image_url.

object

Conditional constraints (JSON Schema)
{
  "not": {
    "required": [
      "input_reference",
      "image_url"
    ]
  }
}
allOf · 2
Input and model rules
  • When model = "cogvideo-basic": seconds: 1–5 or ^[1-5]$; duration: 1–5 or ^[1-5]$; must not reference_images is present; must not metadata is present and metadata.reference_images is present.

object

Conditional constraints (JSON Schema)
{
  "if": {
    "properties": {
      "model": {
        "const": "cogvideo-basic",
        "type": "string"
      }
    }
  },
  "then": {
    "properties": {
      "seconds": {
        "oneOf": [
          {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          },
          {
            "type": "string",
            "pattern": "^[1-5]$"
          }
        ]
      },
      "duration": {
        "oneOf": [
          {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          },
          {
            "type": "string",
            "pattern": "^[1-5]$"
          }
        ]
      }
    },
    "not": {
      "anyOf": [
        {
          "required": [
            "reference_images"
          ]
        },
        {
          "required": [
            "metadata"
          ],
          "properties": {
            "metadata": {
              "required": [
                "reference_images"
              ]
            }
          }
        }
      ]
    }
  }
}
allOf · 3
Input and model rules
  • When model = "cogvideo-short": seconds accepts only 8, "8"; duration accepts only 8, "8"; size must be "720x1280"; resolution must be "720p"; aspect_ratio must be "9:16"; must not input_reference is present; must not image_url is present; must not reference_images is present; must not metadata is present and metadata.reference_images is present; otherwise size accepts only "1920x1080", "1080x1920", "1080x1080", "1440x1080", "1080x1440"; resolution must be "1080p".

object

Conditional constraints (JSON Schema)
{
  "if": {
    "properties": {
      "model": {
        "const": "cogvideo-short",
        "type": "string"
      }
    }
  },
  "then": {
    "properties": {
      "seconds": {
        "enum": [
          8,
          "8"
        ]
      },
      "duration": {
        "enum": [
          8,
          "8"
        ]
      },
      "size": {
        "const": "720x1280",
        "type": "string"
      },
      "resolution": {
        "const": "720p",
        "type": "string"
      },
      "aspect_ratio": {
        "const": "9:16",
        "type": "string"
      }
    },
    "not": {
      "anyOf": [
        {
          "required": [
            "input_reference"
          ]
        },
        {
          "required": [
            "image_url"
          ]
        },
        {
          "required": [
            "reference_images"
          ]
        },
        {
          "required": [
            "metadata"
          ],
          "properties": {
            "metadata": {
              "required": [
                "reference_images"
              ]
            }
          }
        }
      ]
    }
  },
  "else": {
    "properties": {
      "size": {
        "enum": [
          "1920x1080",
          "1080x1920",
          "1080x1080",
          "1440x1080",
          "1080x1440"
        ],
        "type": "string"
      },
      "resolution": {
        "const": "1080p",
        "type": "string"
      }
    }
  }
}

Additional properties are not allowed.

Responses

Response envelope or Responses SSE; inspect the terminal response status, not HTTP status alone.

Content-Type application/json

idstring
objectstring
statusstring
metadataobject

Show structure
task_idstring
outputarray
Show structure
contentarray
Show structure
typestring
textstring

HTML video element with a private sharing URL. Protect it as a bearer capability.

Task status and results