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:

ParameterTypeRequiredDescription
promptstringText prompt for the video
modelstringModel to use. Only sora is supported (default)
widthintegerAllowed: 480, 720, 854, 1080, 1280, 1920
heightintegerAllowed: 480, 720, 854, 1080, 1280, 1920
n_secondsintegerDuration 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:

(binary/mp4 video file)

Pricing

ResolutionCost per Second
480p / 854p$0.07
720p / 1280p$0.12
1080p / 1920p$0.20

Sample Code

from shuttleai import ShuttleAI
import time


client = ShuttleAI()

video_response = client.video.generations.generate(
    prompt="A serene sunset over a calm ocean with gentle waves",
    model="sora",
    width=480,
    height=480,
    n_seconds=5
)
print(f"Video generation job created with ID: {video_response.id}")
print(f"Initial status: {video_response.status}")

job_id = video_response.id
while True:
    status_response = client.video.generations.get_job_status(job_id)
    print(f"Job status: {status_response.status}")

    if status_response.is_completed:
        if status_response.first_video and status_response.first_video.video_url:
            print(f"Video generated successfully! URL: {status_response.first_video.video_url}")
            # Save the video to a file
            status_response.first_video.to_file("output_video.mp4")
            print("Video saved to output_video.mp4")
        else:
            print("No video URL available.")
        break
    elif status_response.has_failed:
        print("Video generation job failed.")
        break
    else:
        print("Job still processing, waiting...")
        time.sleep(5)  # Wait before polling again