Class: OpenAI::Resources::Videos Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/resources/videos.rb,
sig/openai/resources/videos.rbs

Overview

Deprecated.

The Sora API is scheduled to permanently shut down on September

24, 2026.

Instance Method Summary collapse

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.

Parameters:



316
317
318
# File 'lib/openai/resources/videos.rb', line 316

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

Deprecated.

The Sora API is scheduled to permanently shut down on September 24, 2026.

Some parameter documentations has been truncated, see Models::VideoCreateParams for more details.

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.

Parameters:

Returns:

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/openai/resources/videos.rb', line 36

def create(params)
  parsed, options = 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: options
  )
end

#create_character(name:, video:, request_options: {}) ⇒ OpenAI::Models::VideoCreateCharacterResponse

Deprecated.

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.

Parameters:

  • name (String)

    Display name for this API character.

  • video (Pathname, StringIO, IO, String, OpenAI::FilePart)

    Video file used to create a character.

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/openai/resources/videos.rb', line 148

def create_character(params)
  parsed, options = 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: options
  )
end

#delete(video_id, request_options: {}) ⇒ OpenAI::Models::VideoDeleteResponse

Deprecated.

The Sora API is scheduled to permanently shut down on September 24, 2026.

Permanently delete a completed or failed video and its stored assets.

Parameters:

  • video_id (String)

    The identifier of the video to delete.

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



119
120
121
122
123
124
125
126
127
# File 'lib/openai/resources/videos.rb', line 119

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

Deprecated.

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.

Parameters:

Returns:

  • (StringIO)

See Also:



178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/openai/resources/videos.rb', line 178

def download_content(video_id, params = {})
  parsed, options = 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: options
  )
end

#edit(prompt:, video:, request_options: {}) ⇒ OpenAI::Models::Video

Deprecated.

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.

Parameters:

Returns:

See Also:



212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/openai/resources/videos.rb', line 212

def edit(params)
  parsed, options = 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: options
  )
end

#extend_(prompt:, seconds:, video:, request_options: {}) ⇒ OpenAI::Models::Video

Deprecated.

The Sora API is scheduled to permanently shut down on September 24, 2026.

Some parameter documentations has been truncated, see Models::VideoExtendParams for more details.

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.

Parameters:

Returns:

See Also:



249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/openai/resources/videos.rb', line 249

def extend_(params)
  parsed, options = 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: options
  )
end

#get_character(character_id, request_options: {}) ⇒ OpenAI::Models::VideoGetCharacterResponse

Deprecated.

The Sora API is scheduled to permanently shut down on September 24, 2026.

Fetch a character.

Parameters:

  • character_id (String)

    The identifier of the character to retrieve.

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



275
276
277
278
279
280
281
282
283
# File 'lib/openai/resources/videos.rb', line 275

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>

Deprecated.

The Sora API is scheduled to permanently shut down on September 24, 2026.

Some parameter documentations has been truncated, see Models::VideoListParams for more details.

List recently generated videos for the current project.

Parameters:

  • after (String)

    Identifier for the last item from the previous pagination request

  • limit (Integer)

    Number of items to retrieve

  • order (Symbol, OpenAI::Models::VideoListParams::Order)

    Sort order of results by timestamp. Use asc for ascending order or desc for

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/openai/resources/videos.rb', line 92

def list(params = {})
  parsed, options = 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: options
  )
end

#remix(video_id, prompt:, request_options: {}) ⇒ OpenAI::Models::Video

Deprecated.

The Sora API is scheduled to permanently shut down on September 24, 2026.

Create a remix of a completed video using a refreshed prompt.

Parameters:

  • video_id (String)

    The identifier of the completed video to remix.

  • prompt (String)

    Updated text prompt that directs the remix generation.

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/openai/resources/videos.rb', line 300

def remix(video_id, params)
  parsed, options = 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: options
  )
end

#retrieve(video_id, request_options: {}) ⇒ OpenAI::Models::Video

Deprecated.

The Sora API is scheduled to permanently shut down on September 24, 2026.

Fetch the latest metadata for a generated video.

Parameters:

  • video_id (String)

    The identifier of the video to retrieve.

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



62
63
64
65
66
67
68
69
70
# File 'lib/openai/resources/videos.rb', line 62

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