resources/videos/methods/edit/index.md +0 −154 deleted
File Deleted View Diff
1## Create a new video generation job by editing a source video or existing generated video.
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`
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`
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 - `expires_at: number`
52
53 Unix timestamp (seconds) for when the downloadable assets expire, if set.
54
55 - `model: VideoModel`
56
57 The video generation model that produced the job.
58
59 - `string`
60
61 - `"sora-2" or "sora-2-pro" or "sora-2-2025-10-06" or 2 more`
62
63 - `"sora-2"`
64
65 - `"sora-2-pro"`
66
67 - `"sora-2-2025-10-06"`
68
69 - `"sora-2-pro-2025-10-06"`
70
71 - `"sora-2-2025-12-08"`
72
73 - `object: "video"`
74
75 The object type, which is always `video`.
76
77 - `"video"`
78
79 - `progress: number`
80
81 Approximate completion percentage for the generation task.
82
83 - `prompt: string`
84
85 The prompt that was used to generate the video.
86
87 - `remixed_from_video_id: string`
88
89 Identifier of the source video if this video is a remix.
90
91 - `seconds: string`
92
93 Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
94
95 - `size: VideoSize`
96
97 The resolution of the generated video.
98
99 - `"720x1280"`
100
101 - `"1280x720"`
102
103 - `"1024x1792"`
104
105 - `"1792x1024"`
106
107 - `status: "queued" or "in_progress" or "completed" or "failed"`
108
109 Current lifecycle status of the video job.
110
111 - `"queued"`
112
113 - `"in_progress"`
114
115 - `"completed"`
116
117 - `"failed"`
118
119### Example
120
121```http
122curl https://api.openai.com/v1/videos/edits \
123 -H 'Content-Type: application/json' \
124 -H "Authorization: Bearer $OPENAI_API_KEY" \
125 -d '{
126 "prompt": "x",
127 "video": {
128 "id": "video_123"
129 }
130 }'
131```
132
133#### Response
134
135```json
136{
137 "id": "id",
138 "completed_at": 0,
139 "created_at": 0,
140 "error": {
141 "code": "code",
142 "message": "message"
143 },
144 "expires_at": 0,
145 "model": "string",
146 "object": "video",
147 "progress": 0,
148 "prompt": "prompt",
149 "remixed_from_video_id": "remixed_from_video_id",
150 "seconds": "seconds",
151 "size": "720x1280",
152 "status": "queued"
153}
154```