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