Video Generation
OpenRouter supports video generation through models that have "video" in their output_modalities. These models can create videos from text prompts (and optional reference images) via a dedicated asynchronous API.
Video generation uses the /api/v1/videos endpoint. This API may change.
Model Discovery
You can find video generation models in several ways:
Via the Video Models API
Use the dedicated video models endpoint to list all available video generation models along with their supported parameters:
The response returns a data array where each model includes:
Use this endpoint to check which resolutions, aspect ratios, and passthrough parameters are supported by each model before submitting a generation request.
Via the Models API
You can also use the output_modalities query parameter on the Models API to discover video generation models:
On the Models Page
Visit the Models page and filter by output modalities to find models capable of video generation. Look for models that list "video" in their output modalities.
How It Works
Unlike text or image generation, video generation is asynchronous because generating video takes significantly longer. The workflow is:
- Submit a generation request to
POST /api/v1/videos - Receive a job ID and polling URL immediately
- Poll the polling URL (
GET /api/v1/videos/{jobId}) until the status iscompleted - Download the video from the content URL (
GET /api/v1/videos/{jobId}/content)
API Usage
Submitting a Video Generation Request
Request Parameters
Supported Resolutions
480p720p1080p1K2K4K
Supported Aspect Ratios
16:9— Widescreen landscape9:16— Vertical/portrait1:1— Square4:3— Standard landscape3:4— Standard portrait21:9— Ultra-wide9:21— Ultra-tall
Using Reference Images
You can provide reference images to guide the video generation. This is useful for creating videos based on existing visual content:
Provider-Specific Options
You can pass provider-specific options using the provider parameter. Options are keyed by provider slug, and only the options for the matched provider are forwarded:
Use the Video Models API to check which passthrough parameters each model supports via the allowed_passthrough_parameters field.
Response Format
Submit Response (202 Accepted)
When you submit a video generation request, you receive an immediate response with the job details:
Poll Response
When polling the job status, the response includes additional fields as the job progresses:
Job Statuses
Downloading the Video
Once the job status is completed, the unsigned_urls array contains URLs to download the generated video content. You can also use the content endpoint directly:
The index query parameter defaults to 0 and can be used if the model generates multiple video outputs.
Best Practices
- Detailed Prompts: Provide specific, descriptive prompts for better video quality. Include details about motion, camera angles, lighting, and scene composition
- Appropriate Resolution: Higher resolutions take longer to generate and cost more. Choose the resolution that fits your use case
- Polling Interval: Use a reasonable polling interval (e.g., 30 seconds) to avoid excessive API calls. Video generation typically takes 30 seconds to several minutes depending on the model and parameters
- Error Handling: Always check the job status for
failedstate and handle theerrorfield appropriately - Reference Images: When using reference images, ensure they are high quality and relevant to the desired video output
Troubleshooting
Job stays in pending for a long time?
- Video generation can take several minutes depending on the model, resolution, and server load
- Continue polling at regular intervals
Generation failed?
- Check the
errorfield in the poll response for details - Verify the model supports video generation (
output_modalitiesincludes"video") - Ensure your prompt is appropriate and within model guidelines
- Check that any reference images are accessible and in supported formats
Model not found?
- Use the Video Models API or the Models page to find available video generation models
- Verify the model slug is correct (e.g.,
google/veo-3.1)