Skip to content

Videos API (OpenAI Compatible)

Generate videos from text prompts and reference images with AWS Bedrock video models through the OpenAI Videos API shape.

Video generation is asynchronous: creating a video returns a job object immediately. Poll the job until its status is completed, then download the MP4 content — exactly like the OpenAI (Sora) workflow, so the official OpenAI SDKs work unchanged.

Why Choose the Videos API?

  • Text-to-Video & Image-to-Video
    Generate studio-quality clips from a prompt, optionally guided by a reference image used as the first frame.

  • Drop-in OpenAI Compatibility
    Follows the OpenAI Videos API shape. client.videos.create(...) works by changing the base URL.

  • Stateless by Design
    The video ID encodes the AWS Bedrock job reference — no database or server-side session, jobs survive server restarts and scale horizontally.

  • Private AWS Backend
    Videos are generated by AWS Bedrock and stored in your own S3 buckets — no traffic to third-party endpoints.

Quick Start: Available Endpoints

Endpoint Method What It Does Powered By MCP Tool
/v1/videos POST Start an asynchronous video generation job AWS Bedrock Video Models openai_video_generation
/v1/videos GET List video generation jobs across regions AWS Bedrock openai_video_list
/v1/videos/{video_id} GET Retrieve the current state of a job AWS Bedrock openai_video_get
/v1/videos/{video_id}/content GET Download the generated MP4 once completed Amazon S3 openai_video_content
/v1/videos/{video_id} DELETE Delete the stored video output Amazon S3 openai_video_delete

Example with the OpenAI Python SDK:

from openai import OpenAI

client = OpenAI(base_url="https://your-host/v1", api_key="your-api-key")

video = client.videos.create(
    model="amazon.nova-reel-v1:1",
    prompt="Closeup of a seashell on a sandy beach, gentle waves",
)
while video.status in ("queued", "in_progress"):
    video = client.videos.retrieve(video.id)

with open("video.mp4", "wb") as file:
    file.write(client.videos.download_content(video.id).read())
client.videos.delete(video.id)

Example request (curl):

curl -X POST "https://your-host/v1/videos" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "amazon.nova-reel-v1:1",
    "prompt": "Closeup of a seashell on a sandy beach, gentle waves",
    "seconds": "6",
    "size": "1280x720"
  }'

Example response:

{
  "id": "video_eyJhcm4iOiJhcm46YXdzOmJlZHJvY2s6...",
  "object": "video",
  "model": "amazon.nova-reel-v1:1",
  "status": "queued",
  "progress": 0,
  "created_at": 1783805314,
  "seconds": "6",
  "size": "1280x720",
  "prompt": "Closeup of a seashell on a sandy beach, gentle waves"
}

Model Support

Any video generation model available in your configured AWS Bedrock regions can be used, for example:

Amazon Nova Amazon Models

Model Model ID Durations (seconds) Sizes (size)
Amazon Nova Reel 1.1 amazon.nova-reel-v1:1 6, or multiples of 6 up to 120 1280x720
Amazon Nova Reel 1.0 amazon.nova-reel-v1:0 6 1280x720

Amazon Nova Reel is marked legacy by AWS

AWS flags the Nova Reel models as legacy, so they are hidden by default. Set AWS_BEDROCK_LEGACY=true to expose and use them.

Luma AI Luma AI Models

Model Model ID Durations (seconds) Sizes (size)
Luma Ray 2 luma.ray-v2:0 5 or 9 540p/720p in ratios 1:1, 16:9, 9:16, 4:3, 3:4, 21:9, 9:21 (e.g. 1280x720, 720x1280, 960x540)

When seconds or size is omitted, the model's shortest duration and default resolution are used. For Luma Ray, the requested size selects the model's resolution (smaller dimension: 540 or 720) and aspect ratio (reduced width:height).

Find compatible models: Call /search_models with mcp_tool=openai_video_generation to discover model IDs that support video generation in your deployment.

Reference Images (Image-to-Video)

The optional input_reference image is used as the video's first frame:

  • multipart/form-data — upload the image file directly (this is what the OpenAI SDKs send). The SDK object form (input_reference={"image_url": ...} or {"file_id": ...}) is also accepted.
  • application/json — pass a base64 string, data URI, HTTPS URL, S3 URI, or Files API ID.

Amazon Nova Reel requires a PNG or JPEG matching the video resolution (1280x720) and only supports reference images for 6-second videos.

Feature Compatibility

Feature Status Notes
Creation
prompt Full support
model Required — this gateway has no implicit default video model
seconds / size Supported values depend on the model (see table above)
input_reference First-frame image; also accepts URLs/S3/Files API IDs in JSON requests
Extra model-specific params Extra fields are forwarded to the model (e.g. seed, loop)
Lifecycle
Retrieve / poll job progress is 0 while running and 100 when completed
Download content (video) Streamed MP4
Delete video Removes the stored output from S3
variant=thumbnail/spritesheet AWS Bedrock generates only the video asset
List videos (GET /v1/videos) Merged across regions; listed while AWS retains the job record
Remix video Not available on AWS Bedrock
Edits / extensions / characters /v1/videos/edits, /videos/extensions, and /videos/characters are not available on AWS Bedrock
expires_at Reported when a retention period is configured

Legend:

  • Supported — Fully compatible with the OpenAI API
  • Available on Select Models — Check your model's capabilities
  • Partial — Supported with limitations
  • Unsupported — Not available in this implementation
  • Extra Feature — Enhanced capability beyond the OpenAI API

Stateless job tracking

The video ID encodes the AWS Bedrock async job reference, so any server instance can serve the retrieve/download/delete calls without shared state. Two consequences: the prompt is only echoed in the creation response (not when polling or listing), and a deleted video's job record remains visible until AWS expires it. Listing reads the AWS Bedrock async invocation records of every configured region, so it also needs no server state. If a region is unreachable, listing skips it (logging a request warning) and still returns the jobs from the healthy regions.

How It Works

  1. POST /v1/videos starts an AWS Bedrock asynchronous invocation in a region where the model is available and a regional S3 bucket is configured (AWS_S3_REGIONAL_BUCKETS).
  2. AWS Bedrock renders the video and writes the MP4 to that bucket under AWS_S3_VIDEOS_PREFIX (videos/ by default).
  3. GET /v1/videos/{video_id} reads the job state directly from AWS Bedrock; .../content streams the MP4 from S3; DELETE removes the stored objects.

S3 bucket requirement

AWS Bedrock requires the output bucket to be in the same region as the invocation. Configure a bucket for each region offering video models via AWS_S3_REGIONAL_BUCKETS, otherwise video generation requests fail with a configuration error.

Retention

By default videos persist until deleted through the API. Set AWS_S3_VIDEOS_EXPIRES_AFTER to enforce a retention period: the Video object then reports expires_at (completion time plus the retention period) and downloading expired content returns a 404, matching the OpenAI API's automatic video expiry.

Billing

AWS bills video generation per second of generated video. Billed seconds appear in usage logs and cost tracking as output_seconds, recorded when the job is started. Standard S3 storage costs apply to the stored videos until they are deleted.