Sora 2
Download Sora 2 video content
Fetch generated Sora 2 video binary data via GET /v1/videos//content in CometAPI to download completed video outputs by video_id.
GET
/
v1
/
videos
/
{video_id}
/
content
cURL
curl -L "https://api.cometapi.com/v1/videos/<video_id>/content" \
-H "Authorization: Bearer $COMETAPI_KEY" \
-o video.mp4import os
import requests
video_id = "<video_id>"
response = requests.get(
f"https://api.cometapi.com/v1/videos/{video_id}/content",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
)
response.raise_for_status()
with open("video.mp4", "wb") as f:
f.write(response.content)
import { writeFile } from "node:fs/promises";
const videoId = "<video_id>";
const response = await fetch(`https://api.cometapi.com/v1/videos/${videoId}/content`, {
headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
});
await writeFile("video.mp4", Buffer.from(await response.arrayBuffer()));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/v1/videos/{video_id}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.cometapi.com/v1/videos/{video_id}/content"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cometapi.com/v1/videos/{video_id}/content")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/v1/videos/{video_id}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body"<string>"{
"error": {
"message": "Task is not completed yet, current status: IN_PROGRESS",
"type": "invalid_request_error"
}
}Use this endpoint to download the finished Sora output after the job reaches
completed. Until then, it returns an error instead of a video file.
Before you download
- Wait until Retrieve Video reports
status: completed - Pass the
video_idfrom the create step - Store the file in your own bucket or CDN if you need it to outlive the provider’s temporary delivery window
Download flow
1
Create the video
Start with Create Video.
2
Poll for completion
Use Retrieve Video until the job reaches
completed.3
Fetch the binary file
Call this endpoint to download the MP4 or another supported asset variant.
Temporary delivery window
Once the render is complete, retrieve the file promptly. The provider’s delivery URL is not permanent.Authorizations
Bearer token authentication. Use your CometAPI key.
Path Parameters
Completed video id.
Query Parameters
Optional content variant such as the main video, thumbnail, or spritesheet when supported by the provider.
Response
Binary video content.
The response is of type file.
Last modified on July 2, 2026
⌘I
cURL
curl -L "https://api.cometapi.com/v1/videos/<video_id>/content" \
-H "Authorization: Bearer $COMETAPI_KEY" \
-o video.mp4import os
import requests
video_id = "<video_id>"
response = requests.get(
f"https://api.cometapi.com/v1/videos/{video_id}/content",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
)
response.raise_for_status()
with open("video.mp4", "wb") as f:
f.write(response.content)
import { writeFile } from "node:fs/promises";
const videoId = "<video_id>";
const response = await fetch(`https://api.cometapi.com/v1/videos/${videoId}/content`, {
headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
});
await writeFile("video.mp4", Buffer.from(await response.arrayBuffer()));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/v1/videos/{video_id}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.cometapi.com/v1/videos/{video_id}/content"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cometapi.com/v1/videos/{video_id}/content")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/v1/videos/{video_id}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body"<string>"{
"error": {
"message": "Task is not completed yet, current status: IN_PROGRESS",
"type": "invalid_request_error"
}
}