Skip to main content
POST
/
videos
/
generations
视频生成接口
curl --request POST \
  --url https://geekai.co/api/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "cogvideox-flash",
  "prompt": "彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦",
  "negative_prompt": "<string>",
  "image": "<string>",
  "image_tail": "<string>",
  "with_audio": false,
  "size": "720x720",
  "resolution": "1080p",
  "aspect_ratio": "16:9",
  "quality": "speed",
  "duration": 5,
  "fps": 30,
  "watermark": false,
  "async": true,
  "extra_body": {
    "draft": false,
    "return_last_frame": false,
    "movement_amplitude": "<string>",
    "camera_strength": "<string>",
    "image_list": [
      "<string>"
    ],
    "video_list": [
      "<string>"
    ],
    "camera_control": "<string>",
    "static_mask": "<string>"
  },
  "retries": 0
}
'
{
  "model": "cogvideox-flash",
  "task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "task_status": "running",
  "video_result": {
    "id": "<string>",
    "url": "<string>",
    "cover_image_url": "<string>",
    "duration": 123,
    "revised_prompt": "<string>"
  },
  "error": {
    "code": "<string>",
    "message": "<string>"
  }
}
Note: For video model name settings, refer to the System Supported Video Model List, currently supported video generation models are cogvideox-flash (free), cogvideox, and cogvideox-2. The response data format is fully compatible with OpenAI, returning the binary data of the video file.
Different AI platforms support different video sizes for their video generation models. Please refer to the table below for the specific supported sizes:
PlatformModelSupported Sizes
ZhipuCogVideoX Series720x480, 1024x1024, 1280x960, 960x1280, 1920x1080, 1080x1920, 2048x1080, 3840x2160 (By default, the shorter side is 1080, and the longer side is scaled proportionally)

cURL Request Example

    curl --location 'https://geekai.dev/api/v1/videos/generations' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' \
    --data '{
        "model":"cogvideox-flash",
        "prompt":"Kittens and puppies are playing in the grass",
        "async": false
    }'

Authorizations

Authorization
string
header
required

API认证token

Body

application/json
model
string
required

视频模型

Example:

"cogvideox-flash"

prompt
string
required

文本提示

Example:

"彼得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦"

negative_prompt
string

反向提示词,用来描述不希望在视频中看到的内容,可以对视频进行限制,仅支持该字段模型生效

image

单张图片URL(可用于首帧图片)

image_tail
string

用于视频尾帧的图片URL,仅支持该字段模型生效

with_audio
boolean
default:false

是否带音效,仅支持音效的模型生效

size
string

视频尺寸,尺寸越大价格可能越高,不同平台支持的尺寸参数不同,请参考创建视频API设置

Example:

"720x720"

resolution
string

视频分辨率,不同平台支持的分辨率参数不同,请参考创建视频API设置

Example:

"1080p"

aspect_ratio
string

视频宽高比,默认为16:9,仅支持该字段模型生效

Example:

"16:9"

quality
string

视频质量,仅支持该字段模型生效,智谱清言支持 speed、quality 两个配置,可灵 AI 和 Google Veo3 支持 std、pro 两个配置,默认 std

Example:

"speed"

duration
enum<integer>
default:5

视频时长(秒),默认5秒(海螺默认6s)。

Available options:
5,
6,
10
fps
enum<integer>
default:30

视频帧率,仅支持该字段模型生效

Available options:
24,
30,
60
watermark
boolean
default:false

是否添加AI生成水印,默认为false,仅支持该字段模型生效

async
boolean
default:false

是否异步生成,默认false,即同步等待视频生成成功后返回生成结果,如果异步需要通过调用视频获取接口获取生成结果,推荐使用异步

Example:

true

extra_body
object

额外参数配置项,以适配不同视频模型的多样化配置

retries
integer
default:0

自动重试次数

Response

成功响应

model
string
required

使用的视频模型

Example:

"cogvideox-flash"

task_id
string<uuid>
required

任务ID

task_status
enum<string>
required

任务状态

Available options:
pending,
running,
succeed,
failed
Example:

"running"

video_result
object

视频生成结果(仅在同步模式且生成成功时返回)

error
object

错误信息(仅在生成失败时返回)