POST
/
videos
/
generations
curl --request POST \
  --url https://geekai.dev/api/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "cogvideox-flash",
  "prompt": "Peter Rabbit drives his car along the road, his face beaming with joy and delight.",
  "image_url": "https://example.com/image.jpg",
  "async": false,
  "with_audio": false,
  "size": "1920x1080",
  "quality": "speed",
  "duration": 30,
  "fps": 30,
  "retries": 0
}'
{
  "model": "cogvideox-flash",
  "task_id": "bigmodel-video-123456789",
  "task_status": "running",
  "video_result": {
    "url": "<string>",
    "cover_image_url": "<string>",
    "duration": 123,
    "size": 123
  },
  "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 Series

720x480, 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

token

Body

application/json

Response

200
application/json

successful response

The response is of type object.