Create a video task · cogvideo-fast
/v1/videosCreate one asynchronous task. Fixed per-video billing; failed tasks are refunded. Do not re-submit after a client timeout without checking the existing task.
Asynchronous · submit and query · Returns a task ID. Query its status in the playground, then retrieve the result.
Authentication
Use a customer API Key. Setup →
Authorization: Bearer YOUR_API_KEYChoose a model
Model capabilities and limits →Request body
Conflicting aliases/metadata are rejected. Single-image and reference-image inputs are mutually exclusive. For reference mode use fast/pro and 3–10 seconds.
- 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".
modelstringrequired"cogvideo-fast""cogvideo-pro""cogvideo-basic""cogvideo-short"promptstringrequiredNon-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
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
Task accepted. Save id and poll; task status determines eventual success.
Content-Type application/json
idstringrequiredobjectstringrequiredFixed value: "video"
statusstringrequiredunknown means an unrecognized task state; do not interpret as completion.
"queued""in_progress""completed""failed""unknown"progressnumberrequiredcreated_atintegerrequirederrorobjectShow structure
codestringFixed value: "video_generation_failed"
messagestring