Example Usage
import { VideoGenerationRequest } from "@openrouter/sdk/models";
let value: VideoGenerationRequest = {
model: "google/veo-3.1",
};
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
aspectRatio | models.VideoGenerationRequestAspectRatio | ➖ | Aspect ratio of the generated video. Omit it to use the model default, which on models with adaptive aspect ratio (e.g. BytePlus Seedance) follows the input image or video. | 16:9 |
callbackUrl | string | ➖ | URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS. | https://example.com/webhook |
creativity | number | ➖ | Creativity level for video upscaling models only. This parameter is not supported by video generation models. | 1 |
duration | number | ➖ | Duration of the generated video in seconds, or -1 to let the provider choose the length (e.g. following an input video). -1 is only accepted by models that list it in supported_durations. | 8 |
frameImages | models.FrameImage[] | ➖ | Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame, and each frame_type may appear at most once. Combining frame_images with input_references is provider-specific: some models reject the combination (as a 400 on submit or as a failed job), some use the frame images alone, and some use both (e.g. Runway applies image references as style/guidance alongside the frame anchors). | |
generateAudio | boolean | ➖ | Whether to generate audio alongside the video. Defaults to the endpoint’s generate_audio capability flag, false if not set. When neither is set, some providers (such as xAI) apply their own default and generate audio, so send false to request a silent video. Some models always include audio and ignore false. POST /videos returns 400 for true if every otherwise eligible endpoint explicitly disables audio generation. | true |
inputReferences | models.InputReference[] | ➖ | Reference assets to guide video generation. Accepts image, audio, and video references. POST /videos rejects the request with a 400 when the model or its provider integration does not support a supplied reference modality. Combining input_references with frame_images is provider-specific: some models reject the combination (as a 400 on submit or as a failed job), some use the frame images alone, and some use both (e.g. Runway applies image references as style/guidance alongside the frame anchors). | |
model | string | ✔️ | N/A | |
previousJobId | string | ➖ | ID of a completed video job to edit or extend, as returned by the submit response. The new job runs on the same model and endpoint that produced the previous one. Only models that support continuation accept this field. | gen-vid-1789493115-a1B2c3D4e5F6g7H8i9J0 |
prompt | string | ➖ | Text prompt describing the video to generate. Optional for models that support generating a video from image input alone; required by all other models. | A serene mountain landscape at sunset |
provider | models.VideoGenerationRequestProvider | ➖ | Provider routing preferences (order, only, ignore), request-level data policy (zdr, data_collection) and provider-specific passthrough configuration. Sorting by price, latency, or throughput and automatic provider fallbacks are not supported. No video endpoint currently offers Zero Data Retention, so zdr: true fails routing. | |
resolution | models.VideoGenerationRequestResolution | ➖ | Resolution of the generated video | 720p |
seed | number | ➖ | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. POST /videos returns 400 if every otherwise eligible endpoint explicitly declares seed unsupported. | |
sessionId | string | ➖ | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | session-1234 |
size | string | ➖ | Exact pixel dimensions of the generated video in “WIDTHxHEIGHT” format (e.g. “1280x720”). Interchangeable with resolution + aspect_ratio. | 1280x720 |
trace | models.TraceConfig | ➖ | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | { “trace_id”: “trace-abc123”, “trace_name”: “my-app-trace” } |
upscaleFactor | number | ➖ | Upscale factor for video upscaling models only. This parameter is not supported by video generation models. | 2 |
user | string | ➖ | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | user-1234 |