クイックスタート

3つのリクエストで、トップページの動画を生成できます。API キーが必要です。したうえで、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