快速开始

只需三个请求,就能生成首页上的那条视频。你需要一个 API Key:先,然后把它设置为环境变量 CHEAPVIDEO_API_KEY。

1. 提交任务

请求
curl https://api.cheapvideo.ai/v1/videos \
  -H "Authorization: Bearer $CHEAPVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2.0-mini",
    "prompt": "A paper boat drifting down a rainy city gutter at dusk, neon reflections, close-up tracking shot",
    "resolution": "720p",
    "duration": 5
  }'
响应
{
  "id": "task_8f2c1a",
  "status": "queued"
}

2. 查询状态

每隔几秒重复请求,直到 status 变为 succeeded 或 failed。

请求
curl https://api.cheapvideo.ai/v1/videos/task_8f2c1a \
  -H "Authorization: Bearer $CHEAPVIDEO_API_KEY"
响应
{
  "id": "task_8f2c1a",
  "status": "succeeded",
  "video_url": "https://cdn.cheapvideo.dev/task_8f2c1a.mp4",
  "duration": 5,
  "cost_usd": 0.40
}

3. 下载视频

请求
curl -o clip.mp4 https://cdn.cheapvideo.dev/task_8f2c1a.mp4