# Submit
TASK_ID=$(curl -s https://llm.bytespike.ai/v1/videos/generations \
-H "Authorization: Bearer $BYTESPIKE_API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "sora2",
"prompt": "A red apple rolls slowly across a wooden table, soft window light",
"duration_seconds": 5,
"size": "1280x720"
}' | jq -r .task_id)
# Poll until ready
until curl -s https://llm.bytespike.ai/v1/videos/tasks/$TASK_ID \
-H "Authorization: Bearer $BYTESPIKE_API_KEY" | jq -e '.status == "completed"' > /dev/null; do
sleep 5
done
curl -s https://llm.bytespike.ai/v1/videos/tasks/$TASK_ID \
-H "Authorization: Bearer $BYTESPIKE_API_KEY" | jq -r .result_url