1# 1. Submit the job: answers 202 with an id and a status_url
2STATUS_URL=$(curl -s https://api.opper.ai/v3/videos \
3 -H "Authorization: Bearer $OPPER_API_KEY" \
4 -H "Content-Type: application/json" \
5 -d '{
6 "model": "fal/hailuo-02-standard-i2v",
7 "prompt": "A paper boat drifting down a rain-soaked street at dusk",
8 "seconds": 6,
9 "resolution": "768p",
10 "image": "https://example.com/first-frame.png"
11 }' | jq -r .status_url)
12
13# 2. Poll the status_url (GET /v3/artifacts/{id}/status) until "status"
14# is "completed" (or "failed")
15curl "$STATUS_URL" -H "Authorization: Bearer $OPPER_API_KEY"
16
17# 3. Download the clip from the "url" in the completed status
18curl -o video.mp4 "<url>"