@@ -58,21 +58,23 @@ message VideoUrlContent {
5858// An API service for interaction with video generation models.
5959service Video {
6060 // Create a video based on a text prompt and optionally an image.
61- // If an image is provided, generates video with the image as the first frame (image-to-video).
62- // If no image is provided, generates video from text only (text-to-video).
61+ // If an image is provided, generates video with the image as the first frame
62+ // (image-to-video). If no image is provided, generates video from text only
63+ // (text-to-video).
6364 //
64- // This is an asynchronous operation. The method returns immediately with a request_id
65- // that can be used to poll for the result using GetDeferredVideo.
65+ // This is an asynchronous operation. The method returns immediately with a
66+ // request_id that can be used to poll for the result using GetDeferredVideo.
6667 rpc GenerateVideo (GenerateVideoRequest ) returns (StartDeferredResponse ) {}
6768
68- // Gets the result of a video generation started by calling `GenerateVideo`.
69- rpc GetDeferredVideo (GetDeferredVideoRequest ) returns (GetDeferredVideoResponse ) {}
70- }
69+ // Extend an existing video by generating continuation content.
70+ //
71+ // This is an asynchronous operation. The method returns immediately with a
72+ // request_id that can be used to poll for the result using GetDeferredVideo.
73+ rpc ExtendVideo (ExtendVideoRequest ) returns (StartDeferredResponse ) {}
7174
72- // Output destination for generated video.
73- message VideoOutput {
74- // Signed URL to upload the generated video via HTTP PUT.
75- string upload_url = 1 ;
75+ // Gets the result of a video generation started by calling `GenerateVideo` or
76+ // `ExtendVideo`.
77+ rpc GetDeferredVideo (GetDeferredVideoRequest ) returns (GetDeferredVideoResponse ) {}
7678}
7779
7880// Request message for generating a video.
@@ -104,6 +106,11 @@ message GenerateVideoRequest {
104106 // Optional resolution for video generation.
105107 // Defaults to 480p if not specified.
106108 optional VideoResolution resolution = 8 ;
109+
110+ // Optional reference images for reference-to-video (R2V) generation.
111+ // When provided (and `image` is not set), generates video using these images
112+ // as style/content references.
113+ repeated ImageUrlContent reference_images = 13 ;
107114}
108115
109116// Request for retrieving deferred video generation results.
@@ -120,8 +127,20 @@ message VideoResponse {
120127 // The model used to generate the video (ignoring aliases).
121128 string model = 2 ;
122129
123- // The usage of the request.
130+ // Billing and cost information for this request.
124131 SamplingUsage usage = 3 ;
132+
133+ // Structured error describing why video generation failed.
134+ // Only present when the background generation encountered a failure
135+ // (either client error 4xx or server error 5xx).
136+ optional VideoError error = 6 ;
137+
138+ // Approximate completion percentage for the video generation task (0-100).
139+ // - When status is `PENDING`: progress is between 0-99, indicating current
140+ // completion.
141+ // - When status is `DONE`: progress is 100.
142+ // - When status is `FAILED`: progress is 0.
143+ int32 progress = 7 ;
125144}
126145
127146// Contains all data related to a generated video.
@@ -144,6 +163,33 @@ message GetDeferredVideoResponse {
144163 // Current status of the request.
145164 DeferredStatus status = 1 ;
146165
147- // Response. Only present if `status=DONE`
166+ // Response. Only present if `status=DONE` or `status=FAILED`.
167+ // When failed, the `error` field in VideoResponse describes the failure.
148168 optional VideoResponse response = 2 ;
149169}
170+
171+ // Structured error returned when video generation fails.
172+ message VideoError {
173+ // Machine-readable error code (e.g. "invalid_argument", "internal_error").
174+ string code = 1 ;
175+ // Human-readable error message describing the failure.
176+ string message = 2 ;
177+ }
178+
179+ // Request message for extending an existing video.
180+ message ExtendVideoRequest {
181+ // Prompt describing what should happen next in the video.
182+ string prompt = 1 ;
183+
184+ // Input video to extend. The extension continues from the end of this video.
185+ // Supports URL or base64-encoded video data.
186+ // Input video must be between 2 and 30 seconds long.
187+ VideoUrlContent video = 2 ;
188+
189+ // Name or alias of the video generation model to be used.
190+ string model = 3 ;
191+
192+ // Duration of the extension segment to generate in seconds (1-10).
193+ // Defaults to 6 seconds if not specified.
194+ optional int32 duration = 4 ;
195+ }
0 commit comments