resources/videos/methods/edit/index.md +0 −193 deleted
File Deleted View Diff
1## Create a video edit
2
3**post** `/videos/edits`
4
5Create a new video generation job by editing a source video or existing generated video.
6
7### Body Parameters
8
9- `prompt: string`
10
11 Text prompt that describes how to edit the source video.
12
13- `video: object { id }`
14
15 Reference to the completed video to edit.
16
17 - `id: string`
18
19 The identifier of the completed video.
20
21### Returns
22
23- `Video object { id, completed_at, created_at, 10 more }`
24
25 Structured information describing a generated video job.
26
27 - `id: string`
28
29 Unique identifier for the video job.
30
31 - `completed_at: number or null`
32
33 Unix timestamp (seconds) for when the job completed, if finished.
34
35 - `created_at: number`
36
37 Unix timestamp (seconds) for when the job was created.
38
39 - `error: VideoCreateError or null`
40
41 Error payload that explains why generation failed, if applicable.
42
43 - `code: string`
44
45 A machine-readable error code that was returned.
46
47 - `message: string`
48
49 A human-readable description of the error that was returned.
50
51 - `misalignment: optional object { detailed_explanation, error_type, steer }`
52
53 - `detailed_explanation: optional string`
54
55 The public explanation for this block.
56
57 - `error_type: optional string or "potentially_unintended_data_transfer" or "potentially_unintended_data_access" or "potentially_unintended_destructive_activity" or "other"`
58
59 An optional classification; clients must accept additional values.
60
61 - `string`
62
63 - `SafetyAlertErrorType = "potentially_unintended_data_transfer" or "potentially_unintended_data_access" or "potentially_unintended_destructive_activity" or "other"`
64
65 An optional classification; clients must accept additional values.
66
67 - `"potentially_unintended_data_transfer"`
68
69 - `"potentially_unintended_data_access"`
70
71 - `"potentially_unintended_destructive_activity"`
72
73 - `"other"`
74
75 - `steer: optional object { message }`
76
77 An optional public continuation instruction.
78
79 - `message: string`
80
81 The public continuation instruction.
82
83 - `expires_at: number or null`
84
85 Unix timestamp (seconds) for when the downloadable assets expire, if set.
86
87 - `model: VideoModel`
88
89 The video generation model that produced the job.
90
91 - `string`
92
93 - `"sora-2" or "sora-2-pro" or "sora-2-2025-10-06" or 2 more`
94
95 - `"sora-2"`
96
97 - `"sora-2-pro"`
98
99 - `"sora-2-2025-10-06"`
100
101 - `"sora-2-pro-2025-10-06"`
102
103 - `"sora-2-2025-12-08"`
104
105 - `object: "video"`
106
107 The object type, which is always `video`.
108
109 - `"video"`
110
111 - `progress: number`
112
113 Approximate completion percentage for the generation task.
114
115 - `prompt: string or null`
116
117 The prompt that was used to generate the video.
118
119 - `remixed_from_video_id: string or null`
120
121 Identifier of the source video if this video is a remix.
122
123 - `seconds: string`
124
125 Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
126
127 - `size: VideoSize`
128
129 The resolution of the generated video.
130
131 - `"720x1280"`
132
133 - `"1280x720"`
134
135 - `"1024x1792"`
136
137 - `"1792x1024"`
138
139 - `status: "queued" or "in_progress" or "completed" or "failed"`
140
141 Current lifecycle status of the video job.
142
143 - `"queued"`
144
145 - `"in_progress"`
146
147 - `"completed"`
148
149 - `"failed"`
150
151### Example
152
153```http
154curl https://api.openai.com/v1/videos/edits \
155 -H 'Content-Type: application/json' \
156 -H "Authorization: Bearer $OPENAI_API_KEY" \
157 -d '{
158 "prompt": "x",
159 "video": {
160 "id": "video_123"
161 }
162 }'
163```
164
165#### Response
166
167```json
168{
169 "id": "id",
170 "completed_at": 0,
171 "created_at": 0,
172 "error": {
173 "code": "code",
174 "message": "message",
175 "misalignment": {
176 "detailed_explanation": "detailed_explanation",
177 "error_type": "potentially_unintended_data_transfer",
178 "steer": {
179 "message": "message"
180 }
181 }
182 },
183 "expires_at": 0,
184 "model": "sora-2",
185 "object": "video",
186 "progress": 0,
187 "prompt": "prompt",
188 "remixed_from_video_id": "remixed_from_video_id",
189 "seconds": "string",
190 "size": "720x1280",
191 "status": "queued"
192}
193```