import requests, time
# Step 1: Submit job
response = requests.post(
"https://api.runcrate.ai/v1/videos",
headers={
"Authorization": "Bearer rc_live_YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "google/veo-3.0",
"prompt": "A cinematic sunrise over misty mountains",
"duration": 6,
},
)
job = response.json()
print("Job ID:", job["id"])
# Step 2: Poll for completion
while True:
poll = requests.get(
f"https://api.runcrate.ai/v1/videos/{job['id']}",
headers={"Authorization": "Bearer rc_live_YOUR_API_KEY"},
)
data = poll.json()
if data["status"] == "completed":
break
time.sleep(5)
# Step 3: Download the video
video = requests.get(
f"https://api.runcrate.ai/v1/videos/{job['id']}/download",
headers={"Authorization": "Bearer rc_live_YOUR_API_KEY"},
)
with open("video.mp4", "wb") as f:
f.write(video.content)