java/resources/videos/index.md +0 −1634 deleted
File Deleted View Diff
1# Videos
2
3## Create video
4
5`Video videos().create(VideoCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`
6
7**post** `/videos`
8
9Create a new video generation job from a prompt and optional reference assets.
10
11### Parameters
12
13- `VideoCreateParams params`
14
15 - `String prompt`
16
17 Text prompt that describes the video to generate.
18
19 - `Optional<InputReference> inputReference`
20
21 Optional reference asset upload or reference object that guides generation.
22
23 - `String`
24
25 - `class ImageInputReferenceParam:`
26
27 - `Optional<String> fileId`
28
29 - `Optional<String> imageUrl`
30
31 A fully qualified URL or base64-encoded data URL.
32
33 - `Optional<VideoModel> model`
34
35 The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults to `sora-2`.
36
37 - `Optional<VideoSeconds> seconds`
38
39 Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds.
40
41 - `Optional<VideoSize> size`
42
43 Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.
44
45### Returns
46
47- `class Video:`
48
49 Structured information describing a generated video job.
50
51 - `String id`
52
53 Unique identifier for the video job.
54
55 - `Optional<Long> completedAt`
56
57 Unix timestamp (seconds) for when the job completed, if finished.
58
59 - `long createdAt`
60
61 Unix timestamp (seconds) for when the job was created.
62
63 - `Optional<VideoCreateError> error`
64
65 Error payload that explains why generation failed, if applicable.
66
67 - `String code`
68
69 A machine-readable error code that was returned.
70
71 - `String message`
72
73 A human-readable description of the error that was returned.
74
75 - `Optional<Long> expiresAt`
76
77 Unix timestamp (seconds) for when the downloadable assets expire, if set.
78
79 - `VideoModel model`
80
81 The video generation model that produced the job.
82
83 - `SORA_2("sora-2")`
84
85 - `SORA_2_PRO("sora-2-pro")`
86
87 - `SORA_2_2025_10_06("sora-2-2025-10-06")`
88
89 - `SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06")`
90
91 - `SORA_2_2025_12_08("sora-2-2025-12-08")`
92
93 - `JsonValue; object_ "video"constant`
94
95 The object type, which is always `video`.
96
97 - `VIDEO("video")`
98
99 - `long progress`
100
101 Approximate completion percentage for the generation task.
102
103 - `Optional<String> prompt`
104
105 The prompt that was used to generate the video.
106
107 - `Optional<String> remixedFromVideoId`
108
109 Identifier of the source video if this video is a remix.
110
111 - `VideoSeconds seconds`
112
113 Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
114
115 - `_4("4")`
116
117 - `_8("8")`
118
119 - `_12("12")`
120
121 - `VideoSize size`
122
123 The resolution of the generated video.
124
125 - `_720X1280("720x1280")`
126
127 - `_1280X720("1280x720")`
128
129 - `_1024X1792("1024x1792")`
130
131 - `_1792X1024("1792x1024")`
132
133 - `Status status`
134
135 Current lifecycle status of the video job.
136
137 - `QUEUED("queued")`
138
139 - `IN_PROGRESS("in_progress")`
140
141 - `COMPLETED("completed")`
142
143 - `FAILED("failed")`
144
145### Example
146
147```java
148package com.openai.example;
149
150import com.openai.client.OpenAIClient;
151import com.openai.client.okhttp.OpenAIOkHttpClient;
152import com.openai.models.videos.Video;
153import com.openai.models.videos.VideoCreateParams;
154
155public final class Main {
156 private Main() {}
157
158 public static void main(String[] args) {
159 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
160
161 VideoCreateParams params = VideoCreateParams.builder()
162 .prompt("x")
163 .build();
164 Video video = client.videos().create(params);
165 }
166}
167```
168
169#### Response
170
171```json
172{
173 "id": "id",
174 "completed_at": 0,
175 "created_at": 0,
176 "error": {
177 "code": "code",
178 "message": "message"
179 },
180 "expires_at": 0,
181 "model": "string",
182 "object": "video",
183 "progress": 0,
184 "prompt": "prompt",
185 "remixed_from_video_id": "remixed_from_video_id",
186 "seconds": "string",
187 "size": "720x1280",
188 "status": "queued"
189}
190```
191
192### Example
193
194```java
195package com.openai.example;
196
197import com.openai.client.OpenAIClient;
198import com.openai.client.okhttp.OpenAIOkHttpClient;
199import com.openai.models.videos.Video;
200import com.openai.models.videos.VideoCreateParams;
201
202public final class Main {
203 private Main() {}
204
205 public static void main(String[] args) {
206 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
207
208 VideoCreateParams params = VideoCreateParams.builder()
209 .prompt("A calico cat playing a piano on stage")
210 .build();
211 Video video = client.videos().create(params);
212 }
213}
214```
215
216#### Response
217
218```json
219{
220 "id": "video_123",
221 "object": "video",
222 "model": "sora-2",
223 "status": "queued",
224 "progress": 0,
225 "created_at": 1712697600,
226 "size": "1024x1792",
227 "seconds": "8",
228 "quality": "standard"
229}
230```
231
232## Create a new video generation job by editing a source video or existing generated video.
233
234`Video videos().edit(VideoEditParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`
235
236**post** `/videos/edits`
237
238Create a new video generation job by editing a source video or existing generated video.
239
240### Parameters
241
242- `VideoEditParams params`
243
244 - `String prompt`
245
246 Text prompt that describes how to edit the source video.
247
248 - `Video video`
249
250 Reference to the completed video to edit.
251
252 - `String`
253
254 - `class VideoReferenceInputParam:`
255
256 Reference to the completed video.
257
258 - `String id`
259
260 The identifier of the completed video.
261
262### Returns
263
264- `class Video:`
265
266 Structured information describing a generated video job.
267
268 - `String id`
269
270 Unique identifier for the video job.
271
272 - `Optional<Long> completedAt`
273
274 Unix timestamp (seconds) for when the job completed, if finished.
275
276 - `long createdAt`
277
278 Unix timestamp (seconds) for when the job was created.
279
280 - `Optional<VideoCreateError> error`
281
282 Error payload that explains why generation failed, if applicable.
283
284 - `String code`
285
286 A machine-readable error code that was returned.
287
288 - `String message`
289
290 A human-readable description of the error that was returned.
291
292 - `Optional<Long> expiresAt`
293
294 Unix timestamp (seconds) for when the downloadable assets expire, if set.
295
296 - `VideoModel model`
297
298 The video generation model that produced the job.
299
300 - `SORA_2("sora-2")`
301
302 - `SORA_2_PRO("sora-2-pro")`
303
304 - `SORA_2_2025_10_06("sora-2-2025-10-06")`
305
306 - `SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06")`
307
308 - `SORA_2_2025_12_08("sora-2-2025-12-08")`
309
310 - `JsonValue; object_ "video"constant`
311
312 The object type, which is always `video`.
313
314 - `VIDEO("video")`
315
316 - `long progress`
317
318 Approximate completion percentage for the generation task.
319
320 - `Optional<String> prompt`
321
322 The prompt that was used to generate the video.
323
324 - `Optional<String> remixedFromVideoId`
325
326 Identifier of the source video if this video is a remix.
327
328 - `VideoSeconds seconds`
329
330 Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
331
332 - `_4("4")`
333
334 - `_8("8")`
335
336 - `_12("12")`
337
338 - `VideoSize size`
339
340 The resolution of the generated video.
341
342 - `_720X1280("720x1280")`
343
344 - `_1280X720("1280x720")`
345
346 - `_1024X1792("1024x1792")`
347
348 - `_1792X1024("1792x1024")`
349
350 - `Status status`
351
352 Current lifecycle status of the video job.
353
354 - `QUEUED("queued")`
355
356 - `IN_PROGRESS("in_progress")`
357
358 - `COMPLETED("completed")`
359
360 - `FAILED("failed")`
361
362### Example
363
364```java
365package com.openai.example;
366
367import com.openai.client.OpenAIClient;
368import com.openai.client.okhttp.OpenAIOkHttpClient;
369import com.openai.models.videos.Video;
370import com.openai.models.videos.VideoEditParams;
371import java.io.ByteArrayInputStream;
372import java.io.InputStream;
373
374public final class Main {
375 private Main() {}
376
377 public static void main(String[] args) {
378 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
379
380 VideoEditParams params = VideoEditParams.builder()
381 .prompt("x")
382 .video(new ByteArrayInputStream("Example data".getBytes()))
383 .build();
384 Video video = client.videos().edit(params);
385 }
386}
387```
388
389#### Response
390
391```json
392{
393 "id": "id",
394 "completed_at": 0,
395 "created_at": 0,
396 "error": {
397 "code": "code",
398 "message": "message"
399 },
400 "expires_at": 0,
401 "model": "string",
402 "object": "video",
403 "progress": 0,
404 "prompt": "prompt",
405 "remixed_from_video_id": "remixed_from_video_id",
406 "seconds": "string",
407 "size": "720x1280",
408 "status": "queued"
409}
410```
411
412## Create an extension of a completed video.
413
414`Video videos().extend(VideoExtendParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`
415
416**post** `/videos/extensions`
417
418Create an extension of a completed video.
419
420### Parameters
421
422- `VideoExtendParams params`
423
424 - `String prompt`
425
426 Updated text prompt that directs the extension generation.
427
428 - `VideoSeconds seconds`
429
430 Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20).
431
432 - `Video video`
433
434 Reference to the completed video to extend.
435
436 - `String`
437
438 - `class VideoReferenceInputParam:`
439
440 Reference to the completed video.
441
442 - `String id`
443
444 The identifier of the completed video.
445
446### Returns
447
448- `class Video:`
449
450 Structured information describing a generated video job.
451
452 - `String id`
453
454 Unique identifier for the video job.
455
456 - `Optional<Long> completedAt`
457
458 Unix timestamp (seconds) for when the job completed, if finished.
459
460 - `long createdAt`
461
462 Unix timestamp (seconds) for when the job was created.
463
464 - `Optional<VideoCreateError> error`
465
466 Error payload that explains why generation failed, if applicable.
467
468 - `String code`
469
470 A machine-readable error code that was returned.
471
472 - `String message`
473
474 A human-readable description of the error that was returned.
475
476 - `Optional<Long> expiresAt`
477
478 Unix timestamp (seconds) for when the downloadable assets expire, if set.
479
480 - `VideoModel model`
481
482 The video generation model that produced the job.
483
484 - `SORA_2("sora-2")`
485
486 - `SORA_2_PRO("sora-2-pro")`
487
488 - `SORA_2_2025_10_06("sora-2-2025-10-06")`
489
490 - `SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06")`
491
492 - `SORA_2_2025_12_08("sora-2-2025-12-08")`
493
494 - `JsonValue; object_ "video"constant`
495
496 The object type, which is always `video`.
497
498 - `VIDEO("video")`
499
500 - `long progress`
501
502 Approximate completion percentage for the generation task.
503
504 - `Optional<String> prompt`
505
506 The prompt that was used to generate the video.
507
508 - `Optional<String> remixedFromVideoId`
509
510 Identifier of the source video if this video is a remix.
511
512 - `VideoSeconds seconds`
513
514 Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
515
516 - `_4("4")`
517
518 - `_8("8")`
519
520 - `_12("12")`
521
522 - `VideoSize size`
523
524 The resolution of the generated video.
525
526 - `_720X1280("720x1280")`
527
528 - `_1280X720("1280x720")`
529
530 - `_1024X1792("1024x1792")`
531
532 - `_1792X1024("1792x1024")`
533
534 - `Status status`
535
536 Current lifecycle status of the video job.
537
538 - `QUEUED("queued")`
539
540 - `IN_PROGRESS("in_progress")`
541
542 - `COMPLETED("completed")`
543
544 - `FAILED("failed")`
545
546### Example
547
548```java
549package com.openai.example;
550
551import com.openai.client.OpenAIClient;
552import com.openai.client.okhttp.OpenAIOkHttpClient;
553import com.openai.models.videos.Video;
554import com.openai.models.videos.VideoExtendParams;
555import com.openai.models.videos.VideoSeconds;
556import java.io.ByteArrayInputStream;
557import java.io.InputStream;
558
559public final class Main {
560 private Main() {}
561
562 public static void main(String[] args) {
563 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
564
565 VideoExtendParams params = VideoExtendParams.builder()
566 .prompt("x")
567 .seconds(VideoSeconds._4)
568 .video(new ByteArrayInputStream("Example data".getBytes()))
569 .build();
570 Video video = client.videos().extend(params);
571 }
572}
573```
574
575#### Response
576
577```json
578{
579 "id": "id",
580 "completed_at": 0,
581 "created_at": 0,
582 "error": {
583 "code": "code",
584 "message": "message"
585 },
586 "expires_at": 0,
587 "model": "string",
588 "object": "video",
589 "progress": 0,
590 "prompt": "prompt",
591 "remixed_from_video_id": "remixed_from_video_id",
592 "seconds": "string",
593 "size": "720x1280",
594 "status": "queued"
595}
596```
597
598## Create a character from an uploaded video.
599
600`VideoCreateCharacterResponse videos().createCharacter(VideoCreateCharacterParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`
601
602**post** `/videos/characters`
603
604Create a character from an uploaded video.
605
606### Parameters
607
608- `VideoCreateCharacterParams params`
609
610 - `String name`
611
612 Display name for this API character.
613
614 - `String video`
615
616 Video file used to create a character.
617
618### Returns
619
620- `class VideoCreateCharacterResponse:`
621
622 - `Optional<String> id`
623
624 Identifier for the character creation cameo.
625
626 - `long createdAt`
627
628 Unix timestamp (in seconds) when the character was created.
629
630 - `Optional<String> name`
631
632 Display name for the character.
633
634### Example
635
636```java
637package com.openai.example;
638
639import com.openai.client.OpenAIClient;
640import com.openai.client.okhttp.OpenAIOkHttpClient;
641import com.openai.models.videos.VideoCreateCharacterParams;
642import com.openai.models.videos.VideoCreateCharacterResponse;
643import java.io.ByteArrayInputStream;
644
645public final class Main {
646 private Main() {}
647
648 public static void main(String[] args) {
649 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
650
651 VideoCreateCharacterParams params = VideoCreateCharacterParams.builder()
652 .name("x")
653 .video(new ByteArrayInputStream("Example data".getBytes()))
654 .build();
655 VideoCreateCharacterResponse response = client.videos().createCharacter(params);
656 }
657}
658```
659
660#### Response
661
662```json
663{
664 "id": "id",
665 "created_at": 0,
666 "name": "name"
667}
668```
669
670## Fetch a character.
671
672`VideoGetCharacterResponse videos().getCharacter(VideoGetCharacterParamsparams = VideoGetCharacterParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`
673
674**get** `/videos/characters/{character_id}`
675
676Fetch a character.
677
678### Parameters
679
680- `VideoGetCharacterParams params`
681
682 - `Optional<String> characterId`
683
684### Returns
685
686- `class VideoGetCharacterResponse:`
687
688 - `Optional<String> id`
689
690 Identifier for the character creation cameo.
691
692 - `long createdAt`
693
694 Unix timestamp (in seconds) when the character was created.
695
696 - `Optional<String> name`
697
698 Display name for the character.
699
700### Example
701
702```java
703package com.openai.example;
704
705import com.openai.client.OpenAIClient;
706import com.openai.client.okhttp.OpenAIOkHttpClient;
707import com.openai.models.videos.VideoGetCharacterParams;
708import com.openai.models.videos.VideoGetCharacterResponse;
709
710public final class Main {
711 private Main() {}
712
713 public static void main(String[] args) {
714 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
715
716 VideoGetCharacterResponse response = client.videos().getCharacter("char_123");
717 }
718}
719```
720
721#### Response
722
723```json
724{
725 "id": "id",
726 "created_at": 0,
727 "name": "name"
728}
729```
730
731## List videos
732
733`VideoListPage videos().list(VideoListParamsparams = VideoListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`
734
735**get** `/videos`
736
737List recently generated videos for the current project.
738
739### Parameters
740
741- `VideoListParams params`
742
743 - `Optional<String> after`
744
745 Identifier for the last item from the previous pagination request
746
747 - `Optional<Long> limit`
748
749 Number of items to retrieve
750
751 - `Optional<Order> order`
752
753 Sort order of results by timestamp. Use `asc` for ascending order or `desc` for descending order.
754
755 - `ASC("asc")`
756
757 - `DESC("desc")`
758
759### Returns
760
761- `class Video:`
762
763 Structured information describing a generated video job.
764
765 - `String id`
766
767 Unique identifier for the video job.
768
769 - `Optional<Long> completedAt`
770
771 Unix timestamp (seconds) for when the job completed, if finished.
772
773 - `long createdAt`
774
775 Unix timestamp (seconds) for when the job was created.
776
777 - `Optional<VideoCreateError> error`
778
779 Error payload that explains why generation failed, if applicable.
780
781 - `String code`
782
783 A machine-readable error code that was returned.
784
785 - `String message`
786
787 A human-readable description of the error that was returned.
788
789 - `Optional<Long> expiresAt`
790
791 Unix timestamp (seconds) for when the downloadable assets expire, if set.
792
793 - `VideoModel model`
794
795 The video generation model that produced the job.
796
797 - `SORA_2("sora-2")`
798
799 - `SORA_2_PRO("sora-2-pro")`
800
801 - `SORA_2_2025_10_06("sora-2-2025-10-06")`
802
803 - `SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06")`
804
805 - `SORA_2_2025_12_08("sora-2-2025-12-08")`
806
807 - `JsonValue; object_ "video"constant`
808
809 The object type, which is always `video`.
810
811 - `VIDEO("video")`
812
813 - `long progress`
814
815 Approximate completion percentage for the generation task.
816
817 - `Optional<String> prompt`
818
819 The prompt that was used to generate the video.
820
821 - `Optional<String> remixedFromVideoId`
822
823 Identifier of the source video if this video is a remix.
824
825 - `VideoSeconds seconds`
826
827 Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
828
829 - `_4("4")`
830
831 - `_8("8")`
832
833 - `_12("12")`
834
835 - `VideoSize size`
836
837 The resolution of the generated video.
838
839 - `_720X1280("720x1280")`
840
841 - `_1280X720("1280x720")`
842
843 - `_1024X1792("1024x1792")`
844
845 - `_1792X1024("1792x1024")`
846
847 - `Status status`
848
849 Current lifecycle status of the video job.
850
851 - `QUEUED("queued")`
852
853 - `IN_PROGRESS("in_progress")`
854
855 - `COMPLETED("completed")`
856
857 - `FAILED("failed")`
858
859### Example
860
861```java
862package com.openai.example;
863
864import com.openai.client.OpenAIClient;
865import com.openai.client.okhttp.OpenAIOkHttpClient;
866import com.openai.models.videos.VideoListPage;
867import com.openai.models.videos.VideoListParams;
868
869public final class Main {
870 private Main() {}
871
872 public static void main(String[] args) {
873 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
874
875 VideoListPage page = client.videos().list();
876 }
877}
878```
879
880#### Response
881
882```json
883{
884 "data": [
885 {
886 "id": "id",
887 "completed_at": 0,
888 "created_at": 0,
889 "error": {
890 "code": "code",
891 "message": "message"
892 },
893 "expires_at": 0,
894 "model": "string",
895 "object": "video",
896 "progress": 0,
897 "prompt": "prompt",
898 "remixed_from_video_id": "remixed_from_video_id",
899 "seconds": "string",
900 "size": "720x1280",
901 "status": "queued"
902 }
903 ],
904 "first_id": "first_id",
905 "has_more": true,
906 "last_id": "last_id",
907 "object": "list"
908}
909```
910
911### Example
912
913```java
914package com.openai.example;
915
916import com.openai.client.OpenAIClient;
917import com.openai.client.okhttp.OpenAIOkHttpClient;
918import com.openai.models.videos.VideoListPage;
919import com.openai.models.videos.VideoListParams;
920
921public final class Main {
922 private Main() {}
923
924 public static void main(String[] args) {
925 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
926
927 VideoListPage page = client.videos().list();
928 }
929}
930```
931
932#### Response
933
934```json
935{
936 "data": [
937 {
938 "id": "video_123",
939 "object": "video",
940 "model": "sora-2",
941 "status": "completed"
942 }
943 ],
944 "object": "list"
945}
946```
947
948## Retrieve video
949
950`Video videos().retrieve(VideoRetrieveParamsparams = VideoRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`
951
952**get** `/videos/{video_id}`
953
954Fetch the latest metadata for a generated video.
955
956### Parameters
957
958- `VideoRetrieveParams params`
959
960 - `Optional<String> videoId`
961
962### Returns
963
964- `class Video:`
965
966 Structured information describing a generated video job.
967
968 - `String id`
969
970 Unique identifier for the video job.
971
972 - `Optional<Long> completedAt`
973
974 Unix timestamp (seconds) for when the job completed, if finished.
975
976 - `long createdAt`
977
978 Unix timestamp (seconds) for when the job was created.
979
980 - `Optional<VideoCreateError> error`
981
982 Error payload that explains why generation failed, if applicable.
983
984 - `String code`
985
986 A machine-readable error code that was returned.
987
988 - `String message`
989
990 A human-readable description of the error that was returned.
991
992 - `Optional<Long> expiresAt`
993
994 Unix timestamp (seconds) for when the downloadable assets expire, if set.
995
996 - `VideoModel model`
997
998 The video generation model that produced the job.
999
1000 - `SORA_2("sora-2")`
1001
1002 - `SORA_2_PRO("sora-2-pro")`
1003
1004 - `SORA_2_2025_10_06("sora-2-2025-10-06")`
1005
1006 - `SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06")`
1007
1008 - `SORA_2_2025_12_08("sora-2-2025-12-08")`
1009
1010 - `JsonValue; object_ "video"constant`
1011
1012 The object type, which is always `video`.
1013
1014 - `VIDEO("video")`
1015
1016 - `long progress`
1017
1018 Approximate completion percentage for the generation task.
1019
1020 - `Optional<String> prompt`
1021
1022 The prompt that was used to generate the video.
1023
1024 - `Optional<String> remixedFromVideoId`
1025
1026 Identifier of the source video if this video is a remix.
1027
1028 - `VideoSeconds seconds`
1029
1030 Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
1031
1032 - `_4("4")`
1033
1034 - `_8("8")`
1035
1036 - `_12("12")`
1037
1038 - `VideoSize size`
1039
1040 The resolution of the generated video.
1041
1042 - `_720X1280("720x1280")`
1043
1044 - `_1280X720("1280x720")`
1045
1046 - `_1024X1792("1024x1792")`
1047
1048 - `_1792X1024("1792x1024")`
1049
1050 - `Status status`
1051
1052 Current lifecycle status of the video job.
1053
1054 - `QUEUED("queued")`
1055
1056 - `IN_PROGRESS("in_progress")`
1057
1058 - `COMPLETED("completed")`
1059
1060 - `FAILED("failed")`
1061
1062### Example
1063
1064```java
1065package com.openai.example;
1066
1067import com.openai.client.OpenAIClient;
1068import com.openai.client.okhttp.OpenAIOkHttpClient;
1069import com.openai.models.videos.Video;
1070import com.openai.models.videos.VideoRetrieveParams;
1071
1072public final class Main {
1073 private Main() {}
1074
1075 public static void main(String[] args) {
1076 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
1077
1078 Video video = client.videos().retrieve("video_123");
1079 }
1080}
1081```
1082
1083#### Response
1084
1085```json
1086{
1087 "id": "id",
1088 "completed_at": 0,
1089 "created_at": 0,
1090 "error": {
1091 "code": "code",
1092 "message": "message"
1093 },
1094 "expires_at": 0,
1095 "model": "string",
1096 "object": "video",
1097 "progress": 0,
1098 "prompt": "prompt",
1099 "remixed_from_video_id": "remixed_from_video_id",
1100 "seconds": "string",
1101 "size": "720x1280",
1102 "status": "queued"
1103}
1104```
1105
1106### Example
1107
1108```java
1109package com.openai.example;
1110
1111import com.openai.client.OpenAIClient;
1112import com.openai.client.okhttp.OpenAIOkHttpClient;
1113import com.openai.models.videos.Video;
1114import com.openai.models.videos.VideoRetrieveParams;
1115
1116public final class Main {
1117 private Main() {}
1118
1119 public static void main(String[] args) {
1120 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
1121
1122 Video video = client.videos().retrieve("video_123");
1123 }
1124}
1125```
1126
1127## Delete video
1128
1129`VideoDeleteResponse videos().delete(VideoDeleteParamsparams = VideoDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`
1130
1131**delete** `/videos/{video_id}`
1132
1133Permanently delete a completed or failed video and its stored assets.
1134
1135### Parameters
1136
1137- `VideoDeleteParams params`
1138
1139 - `Optional<String> videoId`
1140
1141### Returns
1142
1143- `class VideoDeleteResponse:`
1144
1145 Confirmation payload returned after deleting a video.
1146
1147 - `String id`
1148
1149 Identifier of the deleted video.
1150
1151 - `boolean deleted`
1152
1153 Indicates that the video resource was deleted.
1154
1155 - `JsonValue; object_ "video.deleted"constant`
1156
1157 The object type that signals the deletion response.
1158
1159 - `VIDEO_DELETED("video.deleted")`
1160
1161### Example
1162
1163```java
1164package com.openai.example;
1165
1166import com.openai.client.OpenAIClient;
1167import com.openai.client.okhttp.OpenAIOkHttpClient;
1168import com.openai.models.videos.VideoDeleteParams;
1169import com.openai.models.videos.VideoDeleteResponse;
1170
1171public final class Main {
1172 private Main() {}
1173
1174 public static void main(String[] args) {
1175 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
1176
1177 VideoDeleteResponse video = client.videos().delete("video_123");
1178 }
1179}
1180```
1181
1182#### Response
1183
1184```json
1185{
1186 "id": "id",
1187 "deleted": true,
1188 "object": "video.deleted"
1189}
1190```
1191
1192### Example
1193
1194```java
1195package com.openai.example;
1196
1197import com.openai.client.OpenAIClient;
1198import com.openai.client.okhttp.OpenAIOkHttpClient;
1199import com.openai.models.videos.VideoDeleteParams;
1200import com.openai.models.videos.VideoDeleteResponse;
1201
1202public final class Main {
1203 private Main() {}
1204
1205 public static void main(String[] args) {
1206 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
1207
1208 VideoDeleteResponse video = client.videos().delete("video_123");
1209 }
1210}
1211```
1212
1213## Remix video
1214
1215`Video videos().remix(VideoRemixParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`
1216
1217**post** `/videos/{video_id}/remix`
1218
1219Create a remix of a completed video using a refreshed prompt.
1220
1221### Parameters
1222
1223- `VideoRemixParams params`
1224
1225 - `Optional<String> videoId`
1226
1227 - `String prompt`
1228
1229 Updated text prompt that directs the remix generation.
1230
1231### Returns
1232
1233- `class Video:`
1234
1235 Structured information describing a generated video job.
1236
1237 - `String id`
1238
1239 Unique identifier for the video job.
1240
1241 - `Optional<Long> completedAt`
1242
1243 Unix timestamp (seconds) for when the job completed, if finished.
1244
1245 - `long createdAt`
1246
1247 Unix timestamp (seconds) for when the job was created.
1248
1249 - `Optional<VideoCreateError> error`
1250
1251 Error payload that explains why generation failed, if applicable.
1252
1253 - `String code`
1254
1255 A machine-readable error code that was returned.
1256
1257 - `String message`
1258
1259 A human-readable description of the error that was returned.
1260
1261 - `Optional<Long> expiresAt`
1262
1263 Unix timestamp (seconds) for when the downloadable assets expire, if set.
1264
1265 - `VideoModel model`
1266
1267 The video generation model that produced the job.
1268
1269 - `SORA_2("sora-2")`
1270
1271 - `SORA_2_PRO("sora-2-pro")`
1272
1273 - `SORA_2_2025_10_06("sora-2-2025-10-06")`
1274
1275 - `SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06")`
1276
1277 - `SORA_2_2025_12_08("sora-2-2025-12-08")`
1278
1279 - `JsonValue; object_ "video"constant`
1280
1281 The object type, which is always `video`.
1282
1283 - `VIDEO("video")`
1284
1285 - `long progress`
1286
1287 Approximate completion percentage for the generation task.
1288
1289 - `Optional<String> prompt`
1290
1291 The prompt that was used to generate the video.
1292
1293 - `Optional<String> remixedFromVideoId`
1294
1295 Identifier of the source video if this video is a remix.
1296
1297 - `VideoSeconds seconds`
1298
1299 Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
1300
1301 - `_4("4")`
1302
1303 - `_8("8")`
1304
1305 - `_12("12")`
1306
1307 - `VideoSize size`
1308
1309 The resolution of the generated video.
1310
1311 - `_720X1280("720x1280")`
1312
1313 - `_1280X720("1280x720")`
1314
1315 - `_1024X1792("1024x1792")`
1316
1317 - `_1792X1024("1792x1024")`
1318
1319 - `Status status`
1320
1321 Current lifecycle status of the video job.
1322
1323 - `QUEUED("queued")`
1324
1325 - `IN_PROGRESS("in_progress")`
1326
1327 - `COMPLETED("completed")`
1328
1329 - `FAILED("failed")`
1330
1331### Example
1332
1333```java
1334package com.openai.example;
1335
1336import com.openai.client.OpenAIClient;
1337import com.openai.client.okhttp.OpenAIOkHttpClient;
1338import com.openai.models.videos.Video;
1339import com.openai.models.videos.VideoRemixParams;
1340
1341public final class Main {
1342 private Main() {}
1343
1344 public static void main(String[] args) {
1345 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
1346
1347 VideoRemixParams params = VideoRemixParams.builder()
1348 .videoId("video_123")
1349 .prompt("x")
1350 .build();
1351 Video video = client.videos().remix(params);
1352 }
1353}
1354```
1355
1356#### Response
1357
1358```json
1359{
1360 "id": "id",
1361 "completed_at": 0,
1362 "created_at": 0,
1363 "error": {
1364 "code": "code",
1365 "message": "message"
1366 },
1367 "expires_at": 0,
1368 "model": "string",
1369 "object": "video",
1370 "progress": 0,
1371 "prompt": "prompt",
1372 "remixed_from_video_id": "remixed_from_video_id",
1373 "seconds": "string",
1374 "size": "720x1280",
1375 "status": "queued"
1376}
1377```
1378
1379### Example
1380
1381```java
1382package com.openai.example;
1383
1384import com.openai.client.OpenAIClient;
1385import com.openai.client.okhttp.OpenAIOkHttpClient;
1386import com.openai.models.videos.Video;
1387import com.openai.models.videos.VideoRemixParams;
1388
1389public final class Main {
1390 private Main() {}
1391
1392 public static void main(String[] args) {
1393 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
1394
1395 VideoRemixParams params = VideoRemixParams.builder()
1396 .videoId("video_123")
1397 .prompt("Extend the scene with the cat taking a bow to the cheering audience")
1398 .build();
1399 Video video = client.videos().remix(params);
1400 }
1401}
1402```
1403
1404#### Response
1405
1406```json
1407{
1408 "id": "video_456",
1409 "object": "video",
1410 "model": "sora-2",
1411 "status": "queued",
1412 "progress": 0,
1413 "created_at": 1712698600,
1414 "size": "720x1280",
1415 "seconds": "8",
1416 "remixed_from_video_id": "video_123"
1417}
1418```
1419
1420## Retrieve video content
1421
1422`HttpResponse videos().downloadContent(VideoDownloadContentParamsparams = VideoDownloadContentParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`
1423
1424**get** `/videos/{video_id}/content`
1425
1426Download the generated video bytes or a derived preview asset.
1427
1428Streams the rendered video content for the specified video job.
1429
1430### Parameters
1431
1432- `VideoDownloadContentParams params`
1433
1434 - `Optional<String> videoId`
1435
1436 - `Optional<Variant> variant`
1437
1438 Which downloadable asset to return. Defaults to the MP4 video.
1439
1440 - `VIDEO("video")`
1441
1442 - `THUMBNAIL("thumbnail")`
1443
1444 - `SPRITESHEET("spritesheet")`
1445
1446### Example
1447
1448```java
1449package com.openai.example;
1450
1451import com.openai.client.OpenAIClient;
1452import com.openai.client.okhttp.OpenAIOkHttpClient;
1453import com.openai.core.http.HttpResponse;
1454import com.openai.models.videos.VideoDownloadContentParams;
1455
1456public final class Main {
1457 private Main() {}
1458
1459 public static void main(String[] args) {
1460 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
1461
1462 HttpResponse response = client.videos().downloadContent("video_123");
1463 }
1464}
1465```
1466
1467### Example
1468
1469```java
1470package com.openai.example;
1471
1472import com.openai.client.OpenAIClient;
1473import com.openai.client.okhttp.OpenAIOkHttpClient;
1474import com.openai.core.http.HttpResponse;
1475import com.openai.models.videos.VideoDownloadContentParams;
1476
1477public final class Main {
1478 private Main() {}
1479
1480 public static void main(String[] args) {
1481 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
1482
1483 HttpResponse response = client.videos().downloadContent("video_123");
1484 }
1485}
1486```
1487
1488## Domain Types
1489
1490### Image Input Reference Param
1491
1492- `class ImageInputReferenceParam:`
1493
1494 - `Optional<String> fileId`
1495
1496 - `Optional<String> imageUrl`
1497
1498 A fully qualified URL or base64-encoded data URL.
1499
1500### Video
1501
1502- `class Video:`
1503
1504 Structured information describing a generated video job.
1505
1506 - `String id`
1507
1508 Unique identifier for the video job.
1509
1510 - `Optional<Long> completedAt`
1511
1512 Unix timestamp (seconds) for when the job completed, if finished.
1513
1514 - `long createdAt`
1515
1516 Unix timestamp (seconds) for when the job was created.
1517
1518 - `Optional<VideoCreateError> error`
1519
1520 Error payload that explains why generation failed, if applicable.
1521
1522 - `String code`
1523
1524 A machine-readable error code that was returned.
1525
1526 - `String message`
1527
1528 A human-readable description of the error that was returned.
1529
1530 - `Optional<Long> expiresAt`
1531
1532 Unix timestamp (seconds) for when the downloadable assets expire, if set.
1533
1534 - `VideoModel model`
1535
1536 The video generation model that produced the job.
1537
1538 - `SORA_2("sora-2")`
1539
1540 - `SORA_2_PRO("sora-2-pro")`
1541
1542 - `SORA_2_2025_10_06("sora-2-2025-10-06")`
1543
1544 - `SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06")`
1545
1546 - `SORA_2_2025_12_08("sora-2-2025-12-08")`
1547
1548 - `JsonValue; object_ "video"constant`
1549
1550 The object type, which is always `video`.
1551
1552 - `VIDEO("video")`
1553
1554 - `long progress`
1555
1556 Approximate completion percentage for the generation task.
1557
1558 - `Optional<String> prompt`
1559
1560 The prompt that was used to generate the video.
1561
1562 - `Optional<String> remixedFromVideoId`
1563
1564 Identifier of the source video if this video is a remix.
1565
1566 - `VideoSeconds seconds`
1567
1568 Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
1569
1570 - `_4("4")`
1571
1572 - `_8("8")`
1573
1574 - `_12("12")`
1575
1576 - `VideoSize size`
1577
1578 The resolution of the generated video.
1579
1580 - `_720X1280("720x1280")`
1581
1582 - `_1280X720("1280x720")`
1583
1584 - `_1024X1792("1024x1792")`
1585
1586 - `_1792X1024("1792x1024")`
1587
1588 - `Status status`
1589
1590 Current lifecycle status of the video job.
1591
1592 - `QUEUED("queued")`
1593
1594 - `IN_PROGRESS("in_progress")`
1595
1596 - `COMPLETED("completed")`
1597
1598 - `FAILED("failed")`
1599
1600### Video Create Error
1601
1602- `class VideoCreateError:`
1603
1604 An error that occurred while generating the response.
1605
1606 - `String code`
1607
1608 A machine-readable error code that was returned.
1609
1610 - `String message`
1611
1612 A human-readable description of the error that was returned.
1613
1614### Video Seconds
1615
1616- `enum VideoSeconds:`
1617
1618 - `_4("4")`
1619
1620 - `_8("8")`
1621
1622 - `_12("12")`
1623
1624### Video Size
1625
1626- `enum VideoSize:`
1627
1628 - `_720X1280("720x1280")`
1629
1630 - `_1280X720("1280x720")`
1631
1632 - `_1024X1792("1024x1792")`
1633
1634 - `_1792X1024("1792x1024")`