Skip to main content

Download Video

Downloads the generated video file. This endpoint is only available when the video generation job has a status of completed.
GET https://api.runcrate.ai/v1/videos/{id}/download

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the video generation job.

Example Request

curl https://api.runcrate.ai/v1/videos/vid_abc123/download \
  -H "Authorization: Bearer rc_live_YOUR_API_KEY" \
  --output video.mp4

Response

Returns the video file as binary data with content type video/mp4.
HeaderValue
Content-Typevideo/mp4
Content-Dispositionattachment; filename="vid_abc123.mp4"
This endpoint returns a 404 error if the video generation job has not yet completed. Always check the job status before attempting to download.

Full Workflow Example

# 1. Create the video job
JOB=$(curl -s https://api.runcrate.ai/v1/videos \
  -H "Authorization: Bearer rc_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan-ai/Wan2.1-T2V-14B",
    "prompt": "Ocean waves crashing on a rocky shore at sunset"
  }')

VIDEO_ID=$(echo $JOB | jq -r '.id')
echo "Job created: $VIDEO_ID"

# 2. Poll for completion
while true; do
  STATUS=$(curl -s https://api.runcrate.ai/v1/videos/$VIDEO_ID \
    -H "Authorization: Bearer rc_live_YOUR_API_KEY" | jq -r '.status')
  echo "Status: $STATUS"
  if [ "$STATUS" = "completed" ]; then break; fi
  if [ "$STATUS" = "failed" ]; then echo "Generation failed"; exit 1; fi
  sleep 5
done

# 3. Download the video
curl https://api.runcrate.ai/v1/videos/$VIDEO_ID/download \
  -H "Authorization: Bearer rc_live_YOUR_API_KEY" \
  --output output.mp4

echo "Video saved to output.mp4"