ruby/resources/videos/methods/extend/index.md +0 −182 deleted
File Deleted View Diff
1## Create an extension of a completed video.
2
3`videos.extend_(**kwargs) -> Video`
4
5**post** `/videos/extensions`
6
7Create an extension of a completed video.
8
9### Parameters
10
11- `prompt: String`
12
13 Updated text prompt that directs the extension generation.
14
15- `seconds: VideoSeconds`
16
17 Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20).
18
19 - `:"4"`
20
21 - `:"8"`
22
23 - `:"12"`
24
25- `video: String | VideoReferenceInputParam{ id}`
26
27 Reference to the completed video to extend.
28
29 - `String = String`
30
31 Reference to the completed video to extend.
32
33 - `class VideoReferenceInputParam`
34
35 Reference to the completed video.
36
37 - `id: String`
38
39 The identifier of the completed video.
40
41### Returns
42
43- `class Video`
44
45 Structured information describing a generated video job.
46
47 - `id: String`
48
49 Unique identifier for the video job.
50
51 - `completed_at: Integer`
52
53 Unix timestamp (seconds) for when the job completed, if finished.
54
55 - `created_at: Integer`
56
57 Unix timestamp (seconds) for when the job was created.
58
59 - `error: VideoCreateError`
60
61 Error payload that explains why generation failed, if applicable.
62
63 - `code: String`
64
65 A machine-readable error code that was returned.
66
67 - `message: String`
68
69 A human-readable description of the error that was returned.
70
71 - `expires_at: Integer`
72
73 Unix timestamp (seconds) for when the downloadable assets expire, if set.
74
75 - `model: VideoModel`
76
77 The video generation model that produced the job.
78
79 - `String = String`
80
81 - `VideoModel = :"sora-2" | :"sora-2-pro" | :"sora-2-2025-10-06" | 2 more`
82
83 - `:"sora-2"`
84
85 - `:"sora-2-pro"`
86
87 - `:"sora-2-2025-10-06"`
88
89 - `:"sora-2-pro-2025-10-06"`
90
91 - `:"sora-2-2025-12-08"`
92
93 - `object: :video`
94
95 The object type, which is always `video`.
96
97 - `:video`
98
99 - `progress: Integer`
100
101 Approximate completion percentage for the generation task.
102
103 - `prompt: String`
104
105 The prompt that was used to generate the video.
106
107 - `remixed_from_video_id: String`
108
109 Identifier of the source video if this video is a remix.
110
111 - `seconds: String | VideoSeconds`
112
113 Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
114
115 - `String = String`
116
117 - `VideoSeconds = :"4" | :"8" | :"12"`
118
119 - `:"4"`
120
121 - `:"8"`
122
123 - `:"12"`
124
125 - `size: VideoSize`
126
127 The resolution of the generated video.
128
129 - `:"720x1280"`
130
131 - `:"1280x720"`
132
133 - `:"1024x1792"`
134
135 - `:"1792x1024"`
136
137 - `status: :queued | :in_progress | :completed | :failed`
138
139 Current lifecycle status of the video job.
140
141 - `:queued`
142
143 - `:in_progress`
144
145 - `:completed`
146
147 - `:failed`
148
149### Example
150
151```ruby
152require "openai"
153
154openai = OpenAI::Client.new(api_key: "My API Key")
155
156video = openai.videos.extend_(prompt: "x", seconds: :"4", video: StringIO.new("Example data"))
157
158puts(video)
159```
160
161#### Response
162
163```json
164{
165 "id": "id",
166 "completed_at": 0,
167 "created_at": 0,
168 "error": {
169 "code": "code",
170 "message": "message"
171 },
172 "expires_at": 0,
173 "model": "string",
174 "object": "video",
175 "progress": 0,
176 "prompt": "prompt",
177 "remixed_from_video_id": "remixed_from_video_id",
178 "seconds": "string",
179 "size": "720x1280",
180 "status": "queued"
181}
182```