Videos
Remix Video
POST
/
videos
/
{video_id}
/
remix
Remix Video
curl --request POST \
--url https://api.example.com/videos/{video_id}/remiximport requests
url = "https://api.example.com/videos/{video_id}/remix"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/videos/{video_id}/remix', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/videos/{video_id}/remix",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/videos/{video_id}/remix"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/videos/{video_id}/remix")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/videos/{video_id}/remix")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"remixed_from_video_id": "<string>",
"created_at": 123,
"completed_at": 123,
"expires_at": 123,
"model": "<string>",
"prompt": "<string>",
"seconds": 123,
"size": "<string>",
"progress": 123,
"error": {}
}Create a remix of a completed video using a refreshed prompt.
Method Signature
client.videos.remix(
video_id="video_abc123",
prompt="Same scene but at night with stars in the sky"
)
Parameters
string
required
The ID of the completed video to remix.
string
required
Updated text prompt that directs the remix generation.
Returns
Returns a newVideo object representing the remix generation job.
string
Unique identifier for the remix video job.
string
Current lifecycle status of the remix job:
queued- waiting to startin_progress- currently generatingcompleted- successfully finishedfailed- generation failed
string
Identifier of the source video that was remixed.
integer
Unix timestamp (seconds) for when the remix job was created.
integer
Unix timestamp (seconds) for when the job completed, if finished.
integer
Unix timestamp (seconds) for when the downloadable assets expire, if set.
string
The video generation model that produced the remix.
string
The remix prompt that was used to generate the video.
integer
Duration of the generated clip in seconds (inherited from source video).
string
The resolution of the generated video (inherited from source video).
integer
Approximate completion percentage for the generation task (0-100).
object
Error payload that explains why generation failed, if applicable.
Examples
Basic video remix
from openai import OpenAI
client = OpenAI()
# First, create an original video
original = client.videos.create_and_poll(
prompt="A peaceful lake surrounded by mountains",
model="sora-2",
seconds=8
)
if original.status == "completed":
# Now remix it with a different prompt
remix = client.videos.remix(
video_id=original.id,
prompt="Same scene but during a dramatic thunderstorm"
)
print(f"Remix job started: {remix.id}")
print(f"Remixed from: {remix.remixed_from_video_id}")
print(f"Status: {remix.status}")
Remix and poll for completion
from openai import OpenAI
client = OpenAI()
original_video_id = "video_abc123"
# Create the remix
remix = client.videos.remix(
video_id=original_video_id,
prompt="Transform this into a cyberpunk aesthetic with neon lights"
)
# Wait for completion
remix = client.videos.poll(remix.id)
if remix.status == "completed":
print("Remix completed successfully!")
print(f"Original video: {remix.remixed_from_video_id}")
print(f"Remix video: {remix.id}")
else:
print(f"Remix failed: {remix.error}")
Create multiple variations
from openai import OpenAI
client = OpenAI()
# Start with an original video
original = client.videos.create_and_poll(
prompt="A busy city intersection during the day",
model="sora-2",
seconds=8,
size="1280x720"
)
if original.status == "completed":
# Create multiple remixes with different prompts
remix_prompts = [
"Same intersection at sunset with golden lighting",
"Same intersection at night with car headlights",
"Same intersection in the rain with reflections"
]
remixes = []
for prompt in remix_prompts:
remix = client.videos.remix(
video_id=original.id,
prompt=prompt
)
remixes.append(remix)
print(f"Started remix: {remix.id}")
# Poll all remixes
completed_remixes = []
for remix in remixes:
completed = client.videos.poll(remix.id)
if completed.status == "completed":
completed_remixes.append(completed)
print(f"Remix {completed.id} completed")
Iterative refinement
from openai import OpenAI
client = OpenAI()
# Create original
video = client.videos.create_and_poll(
prompt="A garden with blooming flowers",
model="sora-2",
seconds=8
)
# First refinement
video_v2 = client.videos.remix(
video_id=video.id,
prompt="Same garden but add butterflies flying around"
)
video_v2 = client.videos.poll(video_v2.id)
# Second refinement based on first remix
if video_v2.status == "completed":
video_v3 = client.videos.remix(
video_id=video_v2.id,
prompt="Same scene but at golden hour with warm lighting"
)
video_v3 = client.videos.poll(video_v3.id)
print(f"Final version: {video_v3.id}")
print(f"Evolution: {video.id} -> {video_v2.id} -> {video_v3.id}")
Remix with download
from openai import OpenAI
client = OpenAI()
original_id = "video_abc123"
# Create and wait for remix
remix = client.videos.remix(
video_id=original_id,
prompt="Make it look like a vintage 1980s film"
)
remix = client.videos.poll(remix.id)
if remix.status == "completed":
# Download the remixed video
content = client.videos.download_content(remix.id)
with open(f"remix_{remix.id}.mp4", "wb") as f:
f.write(content.read())
print(f"Remix downloaded: remix_{remix.id}.mp4")
Remix Video
curl --request POST \
--url https://api.example.com/videos/{video_id}/remiximport requests
url = "https://api.example.com/videos/{video_id}/remix"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/videos/{video_id}/remix', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/videos/{video_id}/remix",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/videos/{video_id}/remix"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/videos/{video_id}/remix")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/videos/{video_id}/remix")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"remixed_from_video_id": "<string>",
"created_at": 123,
"completed_at": 123,
"expires_at": 123,
"model": "<string>",
"prompt": "<string>",
"seconds": 123,
"size": "<string>",
"progress": 123,
"error": {}
}