Stream or run a video response · cogvideo-fast
/v1/responsesstream=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_KEYChoose 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.
- 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"promptstringNon-blank prompt, at most 4096 Unicode characters.
Minimum characters: 1 · Maximum characters: 4096 · Pattern: "\\S"
secondsoneOfDefaults: 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])$"
durationoneOfDefaults: 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])$"
sizestringfast/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_referencestringHTTP(S) image URL or Base64 image data URL.
Pattern: "^(https?://|data:image/)"
image_urlstringHTTP(S) image URL or Base64 image data URL.
Pattern: "^(https?://|data:image/)"
reference_imagesarrayMinimum items: 1
Show structure
string — HTTP(S) image URL or Base64 image data URL.
Pattern: "^(https?://|data:image/)"
generation_modestring"speed""pro""pro_ad"metadataobjectShow structure
modestringMust 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_imagesarrayMinimum items: 1
Show structure
string — HTTP(S) image URL or Base64 image data URL.
Pattern: "^(https?://|data:image/)"
generation_modestringReference mode only.
"speed""pro""pro_ad"Default: "pro_ad"
Additional properties are not allowed.
nintegerFixed value: 1 · Default: 1
sample_countintegerFixed value: 1 · Default: 1
inputoneOfText or structured text/image messages; cannot be combined with prompt.
Show structure
oneOf · 1
string
Minimum characters: 1
oneOf · 2
array
Minimum items: 1
streambooleanDefault: false
backgroundbooleanDefault: false
storebooleanResponses protocol field accepted by the host.
oneOf · 1
- Cannot combine prompt.
object
Required fields: input
Conditional constraints (JSON Schema)
{
"required": [
"input"
],
"not": {
"required": [
"prompt"
]
}
}oneOf · 2
- Cannot combine input.
object
Required fields: prompt
Conditional constraints (JSON Schema)
{
"required": [
"prompt"
],
"not": {
"required": [
"input"
]
}
}allOf · 1
- Cannot combine input_reference, image_url.
object
Conditional constraints (JSON Schema)
{
"not": {
"required": [
"input_reference",
"image_url"
]
}
}allOf · 2
- 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
- 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
idstringobjectstringstatusstringmetadataobjectShow structure
task_idstringoutputarrayShow structure
contentarrayShow structure
typestringtextstringHTML video element with a private sharing URL. Protect it as a bearer capability.