Overview
Generate AI-powered videos with ShuttleAI.
All endpoints are under https://api.shuttleai.com/v1/video/generations
.
Authentication Required:
All endpoints require a Bearer token in the Authorization
header.
Authorization: Bearer YOUR_API_KEY
Endpoints
Create a Video Generation Job
Start a new AI video generation job.
POST /jobs
Tip: Use the job_id
returned to check the status of your video.
Request:
POST https://api.shuttleai.com/v1/video/generations/jobs
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
{
"prompt": "A cat playing piano in a jazz bar.",
"model": "sora",
"width": 480,
"height": 480,
"n_seconds": 5
}
Response:
{
"id": "task_01jwp68a7dfcjv09m05jdgkd8s",
"status": "queued",
"created_at": 1748796451
}
Parameters:
Parameter | Type | Required | Description |
---|
prompt | string | ✅ | Text prompt for the video |
model | string | ❌ | Model to use. Only sora is supported (default) |
width | integer | ✅ | Allowed: 480, 720, 854, 1080, 1280, 1920 |
height | integer | ✅ | Allowed: 480, 720, 854, 1080, 1280, 1920 |
n_seconds | integer | ✅ | Duration in seconds. Min 1, Max 20 |
Get Job Status & Results
Check if your video is done, and get the CDN link when finished.
GET /jobs/{job_id}
Note: Poll this endpoint until status
is succeeded
.
Request:
GET https://api.shuttleai.com/v1/video/generations/jobs/{job_id}
Authorization: Bearer YOUR_API_KEY
Response:
{
"id": "task_01jwp5n2tpf3e9wmmd5960bwrq",
"status": "succeeded",
"generations": [
{
"id": "gen_01jwp5ncsdey4s90j3herd7qzw",
"output": {
"video_url": "https://cdn.shuttleai.com/cdn/23a5746f-a307-4565-967b-fe5457d2953d.mp4"
}
}
]
}
Get Video File (Optional Direct Download)
Download the raw video file (usually the same as the CDN link).
GET /{generation_id}/content/video
Request:
GET https://api.shuttleai.com/v1/video/generations/gen_01jwp5ncsdey4s90j3herd7qzw/content/video
Authorization: Bearer YOUR_API_KEY
Response:
Pricing
Resolution | Cost per Second |
---|
480p / 854p | $0.07 |
720p / 1280p | $0.12 |
1080p / 1920p | $0.20 |
Sample Code
import requests
import time
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"prompt": "A cat playing piano in a jazz bar.",
"width": 480,
"height": 480,
"n_seconds": 5,
"model": "sora"
}
# Create job
resp = requests.post("https://api.shuttleai.com/v1/video/generations/jobs", json=data, headers=headers)
resp.raise_for_status()
job = resp.json()
job_id = job["id"]
print(f"Job submitted: {job_id}")
# Poll for status until succeeded
while True:
status_resp = requests.get(f"https://api.shuttleai.com/v1/video/generations/jobs/{job_id}", headers=headers)
status_resp.raise_for_status()
status_json = status_resp.json()
print(f"Status: {status_json.get('status')}")
if status_json.get("status") == "succeeded":
generations = status_json.get("generations", [])
if generations and "output" in generations[0] and "video_url" in generations[0]["output"]:
video_url = generations[0]["output"]["video_url"]
print(f"Video is ready! Downloading from: {video_url}")
break
else:
print("Video ready but no video_url found.")
exit(1)
elif status_json.get("status") == "failed":
print("Video generation failed.")
exit(1)
else:
time.sleep(4) # Wait a few seconds before retrying
# Download the video
video_resp = requests.get(video_url)
video_resp.raise_for_status()
with open("output.mp4", "wb") as f:
f.write(video_resp.content)
print("Video downloaded as output.mp4")