cli/resources/videos/methods/create/index.md +0 −158 deleted
File Deleted View Diff
1## Create video
2
3`$ openai videos create`
4
5**post** `/videos`
6
7Create a new video generation job from a prompt and optional reference assets.
8
9### Parameters
10
11- `--prompt: string`
12
13 Text prompt that describes the video to generate.
14
15- `--input-reference: optional string or ImageInputReferenceParam`
16
17 Optional reference asset upload or reference object that guides generation.
18
19- `--model: optional string or "sora-2" or "sora-2-pro" or "sora-2-2025-10-06" or 2 more`
20
21 The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults to `sora-2`.
22
23- `--seconds: optional "4" or "8" or "12"`
24
25 Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds.
26
27- `--size: optional "720x1280" or "1280x720" or "1024x1792" or "1792x1024"`
28
29 Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.
30
31### Returns
32
33- `video: object { id, completed_at, created_at, 10 more }`
34
35 Structured information describing a generated video job.
36
37 - `id: string`
38
39 Unique identifier for the video job.
40
41 - `completed_at: number`
42
43 Unix timestamp (seconds) for when the job completed, if finished.
44
45 - `created_at: number`
46
47 Unix timestamp (seconds) for when the job was created.
48
49 - `error: object { code, message }`
50
51 Error payload that explains why generation failed, if applicable.
52
53 - `code: string`
54
55 A machine-readable error code that was returned.
56
57 - `message: string`
58
59 A human-readable description of the error that was returned.
60
61 - `expires_at: number`
62
63 Unix timestamp (seconds) for when the downloadable assets expire, if set.
64
65 - `model: string or "sora-2" or "sora-2-pro" or "sora-2-2025-10-06" or 2 more`
66
67 The video generation model that produced the job.
68
69 - `"sora-2"`
70
71 - `"sora-2-pro"`
72
73 - `"sora-2-2025-10-06"`
74
75 - `"sora-2-pro-2025-10-06"`
76
77 - `"sora-2-2025-12-08"`
78
79 - `object: "video"`
80
81 The object type, which is always `video`.
82
83 - `progress: number`
84
85 Approximate completion percentage for the generation task.
86
87 - `prompt: string`
88
89 The prompt that was used to generate the video.
90
91 - `remixed_from_video_id: string`
92
93 Identifier of the source video if this video is a remix.
94
95 - `seconds: string or VideoSeconds`
96
97 Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
98
99 - `"4"`
100
101 - `"8"`
102
103 - `"12"`
104
105 - `size: "720x1280" or "1280x720" or "1024x1792" or "1792x1024"`
106
107 The resolution of the generated video.
108
109 - `"720x1280"`
110
111 - `"1280x720"`
112
113 - `"1024x1792"`
114
115 - `"1792x1024"`
116
117 - `status: "queued" or "in_progress" or "completed" or "failed"`
118
119 Current lifecycle status of the video job.
120
121 - `"queued"`
122
123 - `"in_progress"`
124
125 - `"completed"`
126
127 - `"failed"`
128
129### Example
130
131```cli
132openai videos create \
133 --api-key 'My API Key' \
134 --prompt x
135```
136
137#### Response
138
139```json
140{
141 "id": "id",
142 "completed_at": 0,
143 "created_at": 0,
144 "error": {
145 "code": "code",
146 "message": "message"
147 },
148 "expires_at": 0,
149 "model": "string",
150 "object": "video",
151 "progress": 0,
152 "prompt": "prompt",
153 "remixed_from_video_id": "remixed_from_video_id",
154 "seconds": "string",
155 "size": "720x1280",
156 "status": "queued"
157}
158```