java/resources/videos/methods/edit/index.md +0 −179 deleted
File Deleted View Diff
1## Create a new video generation job by editing a source video or existing generated video.
2
3`Video videos().edit(VideoEditParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`
4
5**post** `/videos/edits`
6
7Create a new video generation job by editing a source video or existing generated video.
8
9### Parameters
10
11- `VideoEditParams params`
12
13 - `String prompt`
14
15 Text prompt that describes how to edit the source video.
16
17 - `Video video`
18
19 Reference to the completed video to edit.
20
21 - `String`
22
23 - `class VideoReferenceInputParam:`
24
25 Reference to the completed video.
26
27 - `String id`
28
29 The identifier of the completed video.
30
31### Returns
32
33- `class Video:`
34
35 Structured information describing a generated video job.
36
37 - `String id`
38
39 Unique identifier for the video job.
40
41 - `Optional<Long> completedAt`
42
43 Unix timestamp (seconds) for when the job completed, if finished.
44
45 - `long createdAt`
46
47 Unix timestamp (seconds) for when the job was created.
48
49 - `Optional<VideoCreateError> error`
50
51 Error payload that explains why generation failed, if applicable.
52
53 - `String code`
54
55 A machine-readable error code that was returned.
56
57 - `String message`
58
59 A human-readable description of the error that was returned.
60
61 - `Optional<Long> expiresAt`
62
63 Unix timestamp (seconds) for when the downloadable assets expire, if set.
64
65 - `VideoModel model`
66
67 The video generation model that produced the job.
68
69 - `SORA_2("sora-2")`
70
71 - `SORA_2_PRO("sora-2-pro")`
72
73 - `SORA_2_2025_10_06("sora-2-2025-10-06")`
74
75 - `SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06")`
76
77 - `SORA_2_2025_12_08("sora-2-2025-12-08")`
78
79 - `JsonValue; object_ "video"constant`
80
81 The object type, which is always `video`.
82
83 - `VIDEO("video")`
84
85 - `long progress`
86
87 Approximate completion percentage for the generation task.
88
89 - `Optional<String> prompt`
90
91 The prompt that was used to generate the video.
92
93 - `Optional<String> remixedFromVideoId`
94
95 Identifier of the source video if this video is a remix.
96
97 - `VideoSeconds seconds`
98
99 Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
100
101 - `_4("4")`
102
103 - `_8("8")`
104
105 - `_12("12")`
106
107 - `VideoSize size`
108
109 The resolution of the generated video.
110
111 - `_720X1280("720x1280")`
112
113 - `_1280X720("1280x720")`
114
115 - `_1024X1792("1024x1792")`
116
117 - `_1792X1024("1792x1024")`
118
119 - `Status status`
120
121 Current lifecycle status of the video job.
122
123 - `QUEUED("queued")`
124
125 - `IN_PROGRESS("in_progress")`
126
127 - `COMPLETED("completed")`
128
129 - `FAILED("failed")`
130
131### Example
132
133```java
134package com.openai.example;
135
136import com.openai.client.OpenAIClient;
137import com.openai.client.okhttp.OpenAIOkHttpClient;
138import com.openai.models.videos.Video;
139import com.openai.models.videos.VideoEditParams;
140import java.io.ByteArrayInputStream;
141import java.io.InputStream;
142
143public final class Main {
144 private Main() {}
145
146 public static void main(String[] args) {
147 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
148
149 VideoEditParams params = VideoEditParams.builder()
150 .prompt("x")
151 .video(new ByteArrayInputStream("Example data".getBytes()))
152 .build();
153 Video video = client.videos().edit(params);
154 }
155}
156```
157
158#### Response
159
160```json
161{
162 "id": "id",
163 "completed_at": 0,
164 "created_at": 0,
165 "error": {
166 "code": "code",
167 "message": "message"
168 },
169 "expires_at": 0,
170 "model": "string",
171 "object": "video",
172 "progress": 0,
173 "prompt": "prompt",
174 "remixed_from_video_id": "remixed_from_video_id",
175 "seconds": "string",
176 "size": "720x1280",
177 "status": "queued"
178}
179```