TASK_ID="a1b2c3d4-5e6f-7890-abcd-ef1234567890"
TOKEN="sk-xxxxxxxxxxxxxxxx"
while true; do
RESP=$(curl -s "https://your-gateway.com/v1/videos/$TASK_ID" \
-H "Authorization: Bearer $TOKEN")
STATUS=$(echo "$RESP" | jq -r '.status')
echo "status=$STATUS progress=$(echo "$RESP" | jq -r '.progress')"
case "$STATUS" in
completed|failed) echo "$RESP"; break ;;
esac
sleep 5
done{
"id": "string",
"object": "video",
"model": "string",
"status": "queued",
"progress": 0,
"created_at": 0,
"completed_at": 0,
"error": {
"code": "string",
"message": "string"
},
"metadata": {
"url": "string"
},
"usage": {}
}