Videos
Create video
Video videos().create(VideoCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
post /videos
Create a new video generation job from a prompt and optional reference assets.
Parameters
-
VideoCreateParams params-
String promptText prompt that describes the video to generate.
-
Optional<InputReference> inputReferenceOptional reference asset upload or reference object that guides generation.
-
String -
class ImageInputReferenceParam:-
Optional<String> fileId -
Optional<String> imageUrlA fully qualified URL or base64-encoded data URL.
-
-
-
Optional<VideoModel> modelThe video generation model to use (allowed values: sora-2, sora-2-pro). Defaults to
sora-2. -
Optional<VideoSeconds> secondsClip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds.
-
Optional<VideoSize> sizeOutput resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.
-
Returns
-
class Video:Structured information describing a generated video job.
-
String idUnique identifier for the video job.
-
Optional<Long> completedAtUnix timestamp (seconds) for when the job completed, if finished.
-
long createdAtUnix timestamp (seconds) for when the job was created.
-
Optional<VideoCreateError> errorError payload that explains why generation failed, if applicable.
-
String codeA machine-readable error code that was returned.
-
String messageA human-readable description of the error that was returned.
-
-
Optional<Long> expiresAtUnix timestamp (seconds) for when the downloadable assets expire, if set.
-
VideoModel modelThe video generation model that produced the job.
-
SORA_2("sora-2") -
SORA_2_PRO("sora-2-pro") -
SORA_2_2025_10_06("sora-2-2025-10-06") -
SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06") -
SORA_2_2025_12_08("sora-2-2025-12-08")
-
-
JsonValue; object_ "video"constantThe object type, which is always
video.VIDEO("video")
-
long progressApproximate completion percentage for the generation task.
-
Optional<String> promptThe prompt that was used to generate the video.
-
Optional<String> remixedFromVideoIdIdentifier of the source video if this video is a remix.
-
VideoSeconds secondsDuration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
_4("4") -
_8("8") -
_12("12")
-
-
VideoSize sizeThe resolution of the generated video.
-
_720X1280("720x1280") -
_1280X720("1280x720") -
_1024X1792("1024x1792") -
_1792X1024("1792x1024")
-
-
Status statusCurrent lifecycle status of the video job.
-
QUEUED("queued") -
IN_PROGRESS("in_progress") -
COMPLETED("completed") -
FAILED("failed")
-
-
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.Video;
import com.openai.models.videos.VideoCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VideoCreateParams params = VideoCreateParams.builder()
.prompt("x")
.build();
Video video = client.videos().create(params);
}
}
Response
{
"id": "id",
"completed_at": 0,
"created_at": 0,
"error": {
"code": "code",
"message": "message"
},
"expires_at": 0,
"model": "sora-2",
"object": "video",
"progress": 0,
"prompt": "prompt",
"remixed_from_video_id": "remixed_from_video_id",
"seconds": "4",
"size": "720x1280",
"status": "queued"
}
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.Video;
import com.openai.models.videos.VideoCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VideoCreateParams params = VideoCreateParams.builder()
.prompt("A calico cat playing a piano on stage")
.build();
Video video = client.videos().create(params);
}
}
Response
{
"id": "video_123",
"object": "video",
"model": "sora-2",
"status": "queued",
"progress": 0,
"created_at": 1712697600,
"size": "1024x1792",
"seconds": "8",
"quality": "standard"
}
Create a new video generation job by editing a source video or existing generated video.
Video videos().edit(VideoEditParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
post /videos/edits
Create a new video generation job by editing a source video or existing generated video.
Parameters
-
VideoEditParams params-
String promptText prompt that describes how to edit the source video.
-
Video videoReference to the completed video to edit.
-
String -
class VideoReferenceInputParam:Reference to the completed video to edit.
-
String idThe identifier of the completed video.
-
-
-
Returns
-
class Video:Structured information describing a generated video job.
-
String idUnique identifier for the video job.
-
Optional<Long> completedAtUnix timestamp (seconds) for when the job completed, if finished.
-
long createdAtUnix timestamp (seconds) for when the job was created.
-
Optional<VideoCreateError> errorError payload that explains why generation failed, if applicable.
-
String codeA machine-readable error code that was returned.
-
String messageA human-readable description of the error that was returned.
-
-
Optional<Long> expiresAtUnix timestamp (seconds) for when the downloadable assets expire, if set.
-
VideoModel modelThe video generation model that produced the job.
-
SORA_2("sora-2") -
SORA_2_PRO("sora-2-pro") -
SORA_2_2025_10_06("sora-2-2025-10-06") -
SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06") -
SORA_2_2025_12_08("sora-2-2025-12-08")
-
-
JsonValue; object_ "video"constantThe object type, which is always
video.VIDEO("video")
-
long progressApproximate completion percentage for the generation task.
-
Optional<String> promptThe prompt that was used to generate the video.
-
Optional<String> remixedFromVideoIdIdentifier of the source video if this video is a remix.
-
VideoSeconds secondsDuration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
_4("4") -
_8("8") -
_12("12")
-
-
VideoSize sizeThe resolution of the generated video.
-
_720X1280("720x1280") -
_1280X720("1280x720") -
_1024X1792("1024x1792") -
_1792X1024("1792x1024")
-
-
Status statusCurrent lifecycle status of the video job.
-
QUEUED("queued") -
IN_PROGRESS("in_progress") -
COMPLETED("completed") -
FAILED("failed")
-
-
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.Video;
import com.openai.models.videos.VideoEditParams;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VideoEditParams params = VideoEditParams.builder()
.prompt("x")
.video(new ByteArrayInputStream("Example data".getBytes()))
.build();
Video video = client.videos().edit(params);
}
}
Response
{
"id": "id",
"completed_at": 0,
"created_at": 0,
"error": {
"code": "code",
"message": "message"
},
"expires_at": 0,
"model": "sora-2",
"object": "video",
"progress": 0,
"prompt": "prompt",
"remixed_from_video_id": "remixed_from_video_id",
"seconds": "4",
"size": "720x1280",
"status": "queued"
}
Create an extension of a completed video.
Video videos().extend(VideoExtendParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
post /videos/extensions
Create an extension of a completed video.
Parameters
-
VideoExtendParams params-
String promptUpdated text prompt that directs the extension generation.
-
VideoSeconds secondsLength of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20).
-
Video videoReference to the completed video to extend.
-
String -
class VideoReferenceInputParam:Reference to the completed video.
-
String idThe identifier of the completed video.
-
-
-
Returns
-
class Video:Structured information describing a generated video job.
-
String idUnique identifier for the video job.
-
Optional<Long> completedAtUnix timestamp (seconds) for when the job completed, if finished.
-
long createdAtUnix timestamp (seconds) for when the job was created.
-
Optional<VideoCreateError> errorError payload that explains why generation failed, if applicable.
-
String codeA machine-readable error code that was returned.
-
String messageA human-readable description of the error that was returned.
-
-
Optional<Long> expiresAtUnix timestamp (seconds) for when the downloadable assets expire, if set.
-
VideoModel modelThe video generation model that produced the job.
-
SORA_2("sora-2") -
SORA_2_PRO("sora-2-pro") -
SORA_2_2025_10_06("sora-2-2025-10-06") -
SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06") -
SORA_2_2025_12_08("sora-2-2025-12-08")
-
-
JsonValue; object_ "video"constantThe object type, which is always
video.VIDEO("video")
-
long progressApproximate completion percentage for the generation task.
-
Optional<String> promptThe prompt that was used to generate the video.
-
Optional<String> remixedFromVideoIdIdentifier of the source video if this video is a remix.
-
VideoSeconds secondsDuration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
_4("4") -
_8("8") -
_12("12")
-
-
VideoSize sizeThe resolution of the generated video.
-
_720X1280("720x1280") -
_1280X720("1280x720") -
_1024X1792("1024x1792") -
_1792X1024("1792x1024")
-
-
Status statusCurrent lifecycle status of the video job.
-
QUEUED("queued") -
IN_PROGRESS("in_progress") -
COMPLETED("completed") -
FAILED("failed")
-
-
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.Video;
import com.openai.models.videos.VideoExtendParams;
import com.openai.models.videos.VideoSeconds;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VideoExtendParams params = VideoExtendParams.builder()
.prompt("x")
.seconds(VideoSeconds._4)
.video(new ByteArrayInputStream("Example data".getBytes()))
.build();
Video video = client.videos().extend(params);
}
}
Response
{
"id": "id",
"completed_at": 0,
"created_at": 0,
"error": {
"code": "code",
"message": "message"
},
"expires_at": 0,
"model": "sora-2",
"object": "video",
"progress": 0,
"prompt": "prompt",
"remixed_from_video_id": "remixed_from_video_id",
"seconds": "4",
"size": "720x1280",
"status": "queued"
}
Create a character from an uploaded video.
VideoCreateCharacterResponse videos().createCharacter(VideoCreateCharacterParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
post /videos/characters
Create a character from an uploaded video.
Parameters
-
VideoCreateCharacterParams params-
String nameDisplay name for this API character.
-
String videoVideo file used to create a character.
-
Returns
-
class VideoCreateCharacterResponse:-
Optional<String> idIdentifier for the character creation cameo.
-
long createdAtUnix timestamp (in seconds) when the character was created.
-
Optional<String> nameDisplay name for the character.
-
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.VideoCreateCharacterParams;
import com.openai.models.videos.VideoCreateCharacterResponse;
import java.io.ByteArrayInputStream;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VideoCreateCharacterParams params = VideoCreateCharacterParams.builder()
.name("x")
.video(new ByteArrayInputStream("Example data".getBytes()))
.build();
VideoCreateCharacterResponse response = client.videos().createCharacter(params);
}
}
Response
{
"id": "id",
"created_at": 0,
"name": "name"
}
Fetch a character.
VideoGetCharacterResponse videos().getCharacter(VideoGetCharacterParamsparams = VideoGetCharacterParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
get /videos/characters/{character_id}
Fetch a character.
Parameters
-
VideoGetCharacterParams paramsOptional<String> characterId
Returns
-
class VideoGetCharacterResponse:-
Optional<String> idIdentifier for the character creation cameo.
-
long createdAtUnix timestamp (in seconds) when the character was created.
-
Optional<String> nameDisplay name for the character.
-
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.VideoGetCharacterParams;
import com.openai.models.videos.VideoGetCharacterResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VideoGetCharacterResponse response = client.videos().getCharacter("char_123");
}
}
Response
{
"id": "id",
"created_at": 0,
"name": "name"
}
List videos
VideoListPage videos().list(VideoListParamsparams = VideoListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
get /videos
List recently generated videos for the current project.
Parameters
-
VideoListParams params-
Optional<String> afterIdentifier for the last item from the previous pagination request
-
Optional<Long> limitNumber of items to retrieve
-
Optional<Order> orderSort order of results by timestamp. Use
ascfor ascending order ordescfor descending order.-
ASC("asc") -
DESC("desc")
-
-
Returns
-
class Video:Structured information describing a generated video job.
-
String idUnique identifier for the video job.
-
Optional<Long> completedAtUnix timestamp (seconds) for when the job completed, if finished.
-
long createdAtUnix timestamp (seconds) for when the job was created.
-
Optional<VideoCreateError> errorError payload that explains why generation failed, if applicable.
-
String codeA machine-readable error code that was returned.
-
String messageA human-readable description of the error that was returned.
-
-
Optional<Long> expiresAtUnix timestamp (seconds) for when the downloadable assets expire, if set.
-
VideoModel modelThe video generation model that produced the job.
-
SORA_2("sora-2") -
SORA_2_PRO("sora-2-pro") -
SORA_2_2025_10_06("sora-2-2025-10-06") -
SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06") -
SORA_2_2025_12_08("sora-2-2025-12-08")
-
-
JsonValue; object_ "video"constantThe object type, which is always
video.VIDEO("video")
-
long progressApproximate completion percentage for the generation task.
-
Optional<String> promptThe prompt that was used to generate the video.
-
Optional<String> remixedFromVideoIdIdentifier of the source video if this video is a remix.
-
VideoSeconds secondsDuration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
_4("4") -
_8("8") -
_12("12")
-
-
VideoSize sizeThe resolution of the generated video.
-
_720X1280("720x1280") -
_1280X720("1280x720") -
_1024X1792("1024x1792") -
_1792X1024("1792x1024")
-
-
Status statusCurrent lifecycle status of the video job.
-
QUEUED("queued") -
IN_PROGRESS("in_progress") -
COMPLETED("completed") -
FAILED("failed")
-
-
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.VideoListPage;
import com.openai.models.videos.VideoListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VideoListPage page = client.videos().list();
}
}
Response
{
"data": [
{
"id": "id",
"completed_at": 0,
"created_at": 0,
"error": {
"code": "code",
"message": "message"
},
"expires_at": 0,
"model": "sora-2",
"object": "video",
"progress": 0,
"prompt": "prompt",
"remixed_from_video_id": "remixed_from_video_id",
"seconds": "4",
"size": "720x1280",
"status": "queued"
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id",
"object": "list"
}
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.VideoListPage;
import com.openai.models.videos.VideoListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VideoListPage page = client.videos().list();
}
}
Response
{
"data": [
{
"id": "video_123",
"object": "video",
"model": "sora-2",
"status": "completed"
}
],
"object": "list"
}
Retrieve video
Video videos().retrieve(VideoRetrieveParamsparams = VideoRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
get /videos/{video_id}
Fetch the latest metadata for a generated video.
Parameters
-
VideoRetrieveParams paramsOptional<String> videoId
Returns
-
class Video:Structured information describing a generated video job.
-
String idUnique identifier for the video job.
-
Optional<Long> completedAtUnix timestamp (seconds) for when the job completed, if finished.
-
long createdAtUnix timestamp (seconds) for when the job was created.
-
Optional<VideoCreateError> errorError payload that explains why generation failed, if applicable.
-
String codeA machine-readable error code that was returned.
-
String messageA human-readable description of the error that was returned.
-
-
Optional<Long> expiresAtUnix timestamp (seconds) for when the downloadable assets expire, if set.
-
VideoModel modelThe video generation model that produced the job.
-
SORA_2("sora-2") -
SORA_2_PRO("sora-2-pro") -
SORA_2_2025_10_06("sora-2-2025-10-06") -
SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06") -
SORA_2_2025_12_08("sora-2-2025-12-08")
-
-
JsonValue; object_ "video"constantThe object type, which is always
video.VIDEO("video")
-
long progressApproximate completion percentage for the generation task.
-
Optional<String> promptThe prompt that was used to generate the video.
-
Optional<String> remixedFromVideoIdIdentifier of the source video if this video is a remix.
-
VideoSeconds secondsDuration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
_4("4") -
_8("8") -
_12("12")
-
-
VideoSize sizeThe resolution of the generated video.
-
_720X1280("720x1280") -
_1280X720("1280x720") -
_1024X1792("1024x1792") -
_1792X1024("1792x1024")
-
-
Status statusCurrent lifecycle status of the video job.
-
QUEUED("queued") -
IN_PROGRESS("in_progress") -
COMPLETED("completed") -
FAILED("failed")
-
-
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.Video;
import com.openai.models.videos.VideoRetrieveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
Video video = client.videos().retrieve("video_123");
}
}
Response
{
"id": "id",
"completed_at": 0,
"created_at": 0,
"error": {
"code": "code",
"message": "message"
},
"expires_at": 0,
"model": "sora-2",
"object": "video",
"progress": 0,
"prompt": "prompt",
"remixed_from_video_id": "remixed_from_video_id",
"seconds": "4",
"size": "720x1280",
"status": "queued"
}
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.Video;
import com.openai.models.videos.VideoRetrieveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
Video video = client.videos().retrieve("video_123");
}
}
Delete video
VideoDeleteResponse videos().delete(VideoDeleteParamsparams = VideoDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
delete /videos/{video_id}
Permanently delete a completed or failed video and its stored assets.
Parameters
-
VideoDeleteParams paramsOptional<String> videoId
Returns
-
class VideoDeleteResponse:Confirmation payload returned after deleting a video.
-
String idIdentifier of the deleted video.
-
boolean deletedIndicates that the video resource was deleted.
-
JsonValue; object_ "video.deleted"constantThe object type that signals the deletion response.
VIDEO_DELETED("video.deleted")
-
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.VideoDeleteParams;
import com.openai.models.videos.VideoDeleteResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VideoDeleteResponse video = client.videos().delete("video_123");
}
}
Response
{
"id": "id",
"deleted": true,
"object": "video.deleted"
}
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.VideoDeleteParams;
import com.openai.models.videos.VideoDeleteResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VideoDeleteResponse video = client.videos().delete("video_123");
}
}
Remix video
Video videos().remix(VideoRemixParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
post /videos/{video_id}/remix
Create a remix of a completed video using a refreshed prompt.
Parameters
-
VideoRemixParams params-
Optional<String> videoId -
String promptUpdated text prompt that directs the remix generation.
-
Returns
-
class Video:Structured information describing a generated video job.
-
String idUnique identifier for the video job.
-
Optional<Long> completedAtUnix timestamp (seconds) for when the job completed, if finished.
-
long createdAtUnix timestamp (seconds) for when the job was created.
-
Optional<VideoCreateError> errorError payload that explains why generation failed, if applicable.
-
String codeA machine-readable error code that was returned.
-
String messageA human-readable description of the error that was returned.
-
-
Optional<Long> expiresAtUnix timestamp (seconds) for when the downloadable assets expire, if set.
-
VideoModel modelThe video generation model that produced the job.
-
SORA_2("sora-2") -
SORA_2_PRO("sora-2-pro") -
SORA_2_2025_10_06("sora-2-2025-10-06") -
SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06") -
SORA_2_2025_12_08("sora-2-2025-12-08")
-
-
JsonValue; object_ "video"constantThe object type, which is always
video.VIDEO("video")
-
long progressApproximate completion percentage for the generation task.
-
Optional<String> promptThe prompt that was used to generate the video.
-
Optional<String> remixedFromVideoIdIdentifier of the source video if this video is a remix.
-
VideoSeconds secondsDuration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
_4("4") -
_8("8") -
_12("12")
-
-
VideoSize sizeThe resolution of the generated video.
-
_720X1280("720x1280") -
_1280X720("1280x720") -
_1024X1792("1024x1792") -
_1792X1024("1792x1024")
-
-
Status statusCurrent lifecycle status of the video job.
-
QUEUED("queued") -
IN_PROGRESS("in_progress") -
COMPLETED("completed") -
FAILED("failed")
-
-
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.Video;
import com.openai.models.videos.VideoRemixParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VideoRemixParams params = VideoRemixParams.builder()
.videoId("video_123")
.prompt("x")
.build();
Video video = client.videos().remix(params);
}
}
Response
{
"id": "id",
"completed_at": 0,
"created_at": 0,
"error": {
"code": "code",
"message": "message"
},
"expires_at": 0,
"model": "sora-2",
"object": "video",
"progress": 0,
"prompt": "prompt",
"remixed_from_video_id": "remixed_from_video_id",
"seconds": "4",
"size": "720x1280",
"status": "queued"
}
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.videos.Video;
import com.openai.models.videos.VideoRemixParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VideoRemixParams params = VideoRemixParams.builder()
.videoId("video_123")
.prompt("Extend the scene with the cat taking a bow to the cheering audience")
.build();
Video video = client.videos().remix(params);
}
}
Response
{
"id": "video_456",
"object": "video",
"model": "sora-2",
"status": "queued",
"progress": 0,
"created_at": 1712698600,
"size": "720x1280",
"seconds": "8",
"remixed_from_video_id": "video_123"
}
Retrieve video content
HttpResponse videos().downloadContent(VideoDownloadContentParamsparams = VideoDownloadContentParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
get /videos/{video_id}/content
Download the generated video bytes or a derived preview asset.
Streams the rendered video content for the specified video job.
Parameters
-
VideoDownloadContentParams params-
Optional<String> videoId -
Optional<Variant> variantWhich downloadable asset to return. Defaults to the MP4 video.
-
VIDEO("video") -
THUMBNAIL("thumbnail") -
SPRITESHEET("spritesheet")
-
-
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.http.HttpResponse;
import com.openai.models.videos.VideoDownloadContentParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
HttpResponse response = client.videos().downloadContent("video_123");
}
}
Example
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.http.HttpResponse;
import com.openai.models.videos.VideoDownloadContentParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
HttpResponse response = client.videos().downloadContent("video_123");
}
}
Domain Types
Image Input Reference Param
-
class ImageInputReferenceParam:-
Optional<String> fileId -
Optional<String> imageUrlA fully qualified URL or base64-encoded data URL.
-
Video
-
class Video:Structured information describing a generated video job.
-
String idUnique identifier for the video job.
-
Optional<Long> completedAtUnix timestamp (seconds) for when the job completed, if finished.
-
long createdAtUnix timestamp (seconds) for when the job was created.
-
Optional<VideoCreateError> errorError payload that explains why generation failed, if applicable.
-
String codeA machine-readable error code that was returned.
-
String messageA human-readable description of the error that was returned.
-
-
Optional<Long> expiresAtUnix timestamp (seconds) for when the downloadable assets expire, if set.
-
VideoModel modelThe video generation model that produced the job.
-
SORA_2("sora-2") -
SORA_2_PRO("sora-2-pro") -
SORA_2_2025_10_06("sora-2-2025-10-06") -
SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06") -
SORA_2_2025_12_08("sora-2-2025-12-08")
-
-
JsonValue; object_ "video"constantThe object type, which is always
video.VIDEO("video")
-
long progressApproximate completion percentage for the generation task.
-
Optional<String> promptThe prompt that was used to generate the video.
-
Optional<String> remixedFromVideoIdIdentifier of the source video if this video is a remix.
-
VideoSeconds secondsDuration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
_4("4") -
_8("8") -
_12("12")
-
-
VideoSize sizeThe resolution of the generated video.
-
_720X1280("720x1280") -
_1280X720("1280x720") -
_1024X1792("1024x1792") -
_1792X1024("1792x1024")
-
-
Status statusCurrent lifecycle status of the video job.
-
QUEUED("queued") -
IN_PROGRESS("in_progress") -
COMPLETED("completed") -
FAILED("failed")
-
-
Video Create Error
-
class VideoCreateError:An error that occurred while generating the response.
-
String codeA machine-readable error code that was returned.
-
String messageA human-readable description of the error that was returned.
-
Video Model
-
enum VideoModel:-
SORA_2("sora-2") -
SORA_2_PRO("sora-2-pro") -
SORA_2_2025_10_06("sora-2-2025-10-06") -
SORA_2_PRO_2025_10_06("sora-2-pro-2025-10-06") -
SORA_2_2025_12_08("sora-2-2025-12-08")
-
Video Seconds
-
enum VideoSeconds:-
_4("4") -
_8("8") -
_12("12")
-
Video Size
-
enum VideoSize:-
_720X1280("720x1280") -
_1280X720("1280x720") -
_1024X1792("1024x1792") -
_1792X1024("1792x1024")
-