Class: OpenAI::Resources::Videos Deprecated
- Inherits:
-
Object
- Object
- OpenAI::Resources::Videos
- Defined in:
- lib/openai/resources/videos.rb,
sig/openai/resources/videos.rbs
Overview
The Sora API is scheduled to permanently shut down on September
24, 2026.
Instance Method Summary collapse
-
#create(prompt:, input_reference: nil, model: nil, seconds: nil, size: nil, request_options: {}) ⇒ OpenAI::Models::Video
deprecated
Deprecated.
The Sora API is scheduled to permanently shut down on September 24, 2026.
-
#create_character(name:, video:, request_options: {}) ⇒ OpenAI::Models::VideoCreateCharacterResponse
deprecated
Deprecated.
The Sora API is scheduled to permanently shut down on September 24, 2026.
-
#delete(video_id, request_options: {}) ⇒ OpenAI::Models::VideoDeleteResponse
deprecated
Deprecated.
The Sora API is scheduled to permanently shut down on September 24, 2026.
-
#download_content(video_id, variant: nil, request_options: {}) ⇒ StringIO
deprecated
Deprecated.
The Sora API is scheduled to permanently shut down on September 24, 2026.
-
#edit(prompt:, video:, request_options: {}) ⇒ OpenAI::Models::Video
deprecated
Deprecated.
The Sora API is scheduled to permanently shut down on September 24, 2026.
-
#extend_(prompt:, seconds:, video:, request_options: {}) ⇒ OpenAI::Models::Video
deprecated
Deprecated.
The Sora API is scheduled to permanently shut down on September 24, 2026.
-
#get_character(character_id, request_options: {}) ⇒ OpenAI::Models::VideoGetCharacterResponse
deprecated
Deprecated.
The Sora API is scheduled to permanently shut down on September 24, 2026.
-
#initialize(client:) ⇒ Videos
constructor
private
A new instance of Videos.
-
#list(after: nil, limit: nil, order: nil, request_options: {}) ⇒ OpenAI::Internal::ConversationCursorPage<OpenAI::Models::Video>
deprecated
Deprecated.
The Sora API is scheduled to permanently shut down on September 24, 2026.
-
#remix(video_id, prompt:, request_options: {}) ⇒ OpenAI::Models::Video
deprecated
Deprecated.
The Sora API is scheduled to permanently shut down on September 24, 2026.
-
#retrieve(video_id, request_options: {}) ⇒ OpenAI::Models::Video
deprecated
Deprecated.
The Sora API is scheduled to permanently shut down on September 24, 2026.
Constructor Details
#initialize(client:) ⇒ Videos
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Videos.
349 350 351 |
# File 'lib/openai/resources/videos.rb', line 349 def initialize(client:) @client = client end |
Instance Method Details
#create(prompt:, input_reference: nil, model: nil, seconds: nil, size: nil, request_options: {}) ⇒ OpenAI::Models::Video
The Sora API is scheduled to permanently shut down on September 24, 2026.
Create a new video generation job from a prompt and optional reference assets.
String, StringIO, and pathless IO inputs are sent with generic upload
metadata. Use OpenAI::FilePart when you need to override the filename or
content type.
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/openai/resources/videos.rb', line 44 def create(params) parsed, = OpenAI::VideoCreateParams.dump_request(params) @client.request( method: :post, path: "videos", headers: {"content-type" => "multipart/form-data"}, body: parsed, model: OpenAI::Video, security: {bearer_auth: true}, options: ) end |
#create_character(name:, video:, request_options: {}) ⇒ OpenAI::Models::VideoCreateCharacterResponse
The Sora API is scheduled to permanently shut down on September 24, 2026.
Create a character from an uploaded video.
String, StringIO, and pathless IO inputs are sent with generic upload
metadata. Use OpenAI::FilePart when you need to override the filename or
content type.
165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/openai/resources/videos.rb', line 165 def create_character(params) parsed, = OpenAI::VideoCreateCharacterParams.dump_request(params) @client.request( method: :post, path: "videos/characters", headers: {"content-type" => "multipart/form-data"}, body: parsed, model: OpenAI::Models::VideoCreateCharacterResponse, security: {bearer_auth: true}, options: ) end |
#delete(video_id, request_options: {}) ⇒ OpenAI::Models::VideoDeleteResponse
The Sora API is scheduled to permanently shut down on September 24, 2026.
Permanently delete a completed or failed video and its stored assets.
130 131 132 133 134 135 136 137 138 |
# File 'lib/openai/resources/videos.rb', line 130 def delete(video_id, params = {}) @client.request( method: :delete, path: ["videos/%1$s", video_id], model: OpenAI::Models::VideoDeleteResponse, security: {bearer_auth: true}, options: params[:request_options] ) end |
#download_content(video_id, variant: nil, request_options: {}) ⇒ StringIO
The Sora API is scheduled to permanently shut down on September 24, 2026.
Download the generated video bytes or a derived preview asset.
Streams the rendered video content for the specified video job.
197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/openai/resources/videos.rb', line 197 def download_content(video_id, params = {}) parsed, = OpenAI::VideoDownloadContentParams.dump_request(params) query = OpenAI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["videos/%1$s/content", video_id], query: query, headers: {"accept" => "application/binary"}, model: StringIO, security: {bearer_auth: true}, options: ) end |
#edit(prompt:, video:, request_options: {}) ⇒ OpenAI::Models::Video
The Sora API is scheduled to permanently shut down on September 24, 2026.
Create a new video generation job by editing a source video or existing generated video.
String, StringIO, and pathless IO inputs are sent with generic upload
metadata. Use OpenAI::FilePart when you need to override the filename or
content type.
237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/openai/resources/videos.rb', line 237 def edit(params) parsed, = OpenAI::VideoEditParams.dump_request(params) @client.request( method: :post, path: "videos/edits", headers: {"content-type" => "multipart/form-data"}, body: parsed, model: OpenAI::Video, security: {bearer_auth: true}, options: ) end |
#extend_(prompt:, seconds:, video:, request_options: {}) ⇒ OpenAI::Models::Video
The Sora API is scheduled to permanently shut down on September 24, 2026.
Create an extension of a completed video.
String, StringIO, and pathless IO inputs are sent with generic upload
metadata. Use OpenAI::FilePart when you need to override the filename or
content type.
279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/openai/resources/videos.rb', line 279 def extend_(params) parsed, = OpenAI::VideoExtendParams.dump_request(params) @client.request( method: :post, path: "videos/extensions", headers: {"content-type" => "multipart/form-data"}, body: parsed, model: OpenAI::Video, security: {bearer_auth: true}, options: ) end |
#get_character(character_id, request_options: {}) ⇒ OpenAI::Models::VideoGetCharacterResponse
The Sora API is scheduled to permanently shut down on September 24, 2026.
Fetch a character.
306 307 308 309 310 311 312 313 314 |
# File 'lib/openai/resources/videos.rb', line 306 def get_character(character_id, params = {}) @client.request( method: :get, path: ["videos/characters/%1$s", character_id], model: OpenAI::Models::VideoGetCharacterResponse, security: {bearer_auth: true}, options: params[:request_options] ) end |
#list(after: nil, limit: nil, order: nil, request_options: {}) ⇒ OpenAI::Internal::ConversationCursorPage<OpenAI::Models::Video>
The Sora API is scheduled to permanently shut down on September 24, 2026.
List recently generated videos for the current project.
102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/openai/resources/videos.rb', line 102 def list(params = {}) parsed, = OpenAI::VideoListParams.dump_request(params) query = OpenAI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "videos", query: query, page: OpenAI::Internal::ConversationCursorPage, model: OpenAI::Video, security: {bearer_auth: true}, options: ) end |
#remix(video_id, prompt:, request_options: {}) ⇒ OpenAI::Models::Video
The Sora API is scheduled to permanently shut down on September 24, 2026.
Create a remix of a completed video using a refreshed prompt.
333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/openai/resources/videos.rb', line 333 def remix(video_id, params) parsed, = OpenAI::VideoRemixParams.dump_request(params) @client.request( method: :post, path: ["videos/%1$s/remix", video_id], headers: {"content-type" => "multipart/form-data"}, body: parsed, model: OpenAI::Video, security: {bearer_auth: true}, options: ) end |
#retrieve(video_id, request_options: {}) ⇒ OpenAI::Models::Video
The Sora API is scheduled to permanently shut down on September 24, 2026.
Fetch the latest metadata for a generated video.
71 72 73 74 75 76 77 78 79 |
# File 'lib/openai/resources/videos.rb', line 71 def retrieve(video_id, params = {}) @client.request( method: :get, path: ["videos/%1$s", video_id], model: OpenAI::Video, security: {bearer_auth: true}, options: params[:request_options] ) end |