Video Generations

POST /v1/videos/generations

Generate videos from text prompts asynchronously -- submit a request, receive a task ID, and poll for the completed video.

Request

POST https://api.chuizi.ai/v1/videos/generations

Authentication

Authorization: Bearer ck-your-api-key

Parameters

ParameterTypeRequiredDefaultDescription
modelstringYesModel name, e.g. minimax/video-01, kling/kling-v2
promptstringYesText description of the video to generate
durationintegerNo5Video duration in seconds (model dependent, typically 2-10)
aspect_ratiostringNo"16:9"Aspect ratio: 16:9, 9:16, 1:1
resolutionstringNo"720p"Video resolution: 480p, 720p, 1080p
imagestringNoBase64-encoded reference image for image-to-video generation

Request Example

config.json
json
{
  "model": "minimax/video-01",
  "prompt": "A golden retriever running through a field of wildflowers in slow motion",
  "duration": 5,
  "aspect_ratio": "16:9",
  "resolution": "720p"
}

Response

Initial Response (Task Created)

config.json
json
{
  "id": "gen-xxxxxxxxxxxxxxxx",
  "status": "processing",
  "created": 1712000000,
  "model": "minimax/video-01",
  "x_chuizi": {
    "generation_id": "gen-xxxxxxxxxxxxxxxx"
  }
}

Code Examples

terminal
bash
# Step 1: Submit generation request
TASK=$(curl -s -X POST https://api.chuizi.ai/v1/videos/generations \
  -H "Authorization: Bearer ck-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax/video-01",
    "prompt": "A golden retriever running through wildflowers"
  }')

ID=$(echo $TASK | jq -r '.id')

# Step 2: Poll for result
curl -s https://api.chuizi.ai/v1/videos/$ID \
  -H "Authorization: Bearer ck-your-key"

Next Steps