Videos
Create a video remix
Creates a video remix from the supplied request.
Path parameters
video_id
string
required
The identifier of the completed video to remix.
Request Body
The multipart request body.
prompt
OpenAI.CreateVideoRemixBody
required
Updated text prompt that directs the remix generation.
Responses
The request has succeeded.
Body
id
string
required
Unique identifier for the video job.
object
enum
required
The object type, which is always video.
model
string | enum
required
enum
status
enum
required
created_at
integer
required
Unix timestamp (seconds) for when the job was created.
completed_at
integer | null
required
Unix timestamp (seconds) for when the job completed, if finished.
expires_at
integer | null
required
Unix timestamp (seconds) for when the downloadable assets expire, if set.
size
enum
required
seconds
string
required
Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
error
OpenAI.Error-2 | null
required
An error that occurred while generating the response.
code
string
required
A machine-readable error code that was returned.
message
string
required
A human-readable description of the error that was returned.
headers
object
The Retry-After and Retry-After-Ms headers returned with the original error, if any.
misalignment
OpenAI.MisalignmentErrorDetailsResource
error_type
string | enum
enum
detailed_explanation
string
The public explanation for this block.
steer
OpenAI._MisalignmentSteer
message
string
required
The public continuation instruction.
Request
curl -X POST https://api.openai.com/v1/videos/video_123/remix \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Extend the scene with the cat taking a bow to the cheering audience"
}'
import OpenAI from 'openai';
const client = new OpenAI();
const video = await client.videos.remix('video_123', { prompt: 'Extend the scene with the cat taking a bow to the cheering audience' });
console.log(video.id);
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
video = client.videos.remix(
video_id="video_123",
prompt="x",
)
print(video.id)
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
video, err := client.Videos.Remix(
context.TODO(),
"video_123",
openai.VideoRemixParams{
Prompt: "x",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v
", video.ID)
}
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
video = openai.videos.remix("video_123", prompt: "x")
puts(video)
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);
}
}
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
const video = await client.videos.remix('video_123', { prompt: 'x' });
console.log(video.id);
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"
}