microsoft-foundry.rest.security.o-auth2-auth
Videos
Get a video content
GET
/openai/v1/videos/{video_id}/content
Retrieves a video content by its identifier.
Path parameters
video_id
string
required
The identifier of the video whose media to download.
Query parameters
variant
enum
Which downloadable asset to return. Defaults to the MP4 video.
videothumbnailspritesheet
Responses
The request has succeeded.
Body
Content-Type: video/mp4
Request
import OpenAI from 'openai';
const client = new OpenAI();
const response = await client.videos.downloadContent('video_123');
console.log(response);
const content = await response.blob();
console.log(content);
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
response = client.videos.download_content(
video_id="video_123",
)
print(response)
content = response.read()
print(content)
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"),
)
response, err := client.Videos.DownloadContent(
context.TODO(),
"video_123",
openai.VideoDownloadContentParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v
", response)
}
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
response = openai.videos.download_content("video_123")
puts(response)
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");
}
}
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
const response = await client.videos.downloadContent('video_123');
console.log(response);
const content = await response.blob();
console.log(content);