microsoft-foundry.rest.security.o-auth2-auth
Videos
List videos
GET
/openai/v1/videos
Lists videos matching the request filters.
Query parameters
limit
integer
Number of items to retrieve
order
enum
Sort order of results by timestamp. Use asc for ascending order or desc for descending order.
ascdesc
after
string
Identifier for the last item from the previous pagination request
Responses
The request has succeeded.
Body
Content-Type: application/json
object
enum
required
The type of object returned, must be list.
list
data
OpenAI.VideoResource[]
required
A list of items
first_id
string | null
required
last_id
string | null
required
has_more
boolean
required
Whether there are more items available.
Request
curl https://api.openai.com/v1/videos \
-H "Authorization: Bearer $OPENAI_API_KEY"
import OpenAI from 'openai';
const openai = new OpenAI();
// Automatically fetches more pages as needed.
for await (const video of openai.videos.list()) {
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
)
page = client.videos.list()
page = page.data[0]
print(page.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"),
)
page, err := client.Videos.List(context.TODO(), openai.VideoListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v
", page)
}
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
page = openai.videos.list
puts(page)
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();
}
}
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const video of client.videos.list()) {
console.log(video.id);
}
Response
{
"data": [
{
"id": "video_123",
"object": "video",
"model": "sora-2",
"status": "completed"
}
],
"object": "list"
}