Videos
Get a video
Retrieves a video by its identifier.
Parametri del percorso
video_id
string
necessario
The identifier of the video to retrieve.
Risposte
The request has succeeded.
Corpo
id
string
necessario
Unique identifier for the video job.
object
enum
necessario
The object type, which is always video.
model
string | enum
necessario
enum
status
enum
necessario
created_at
integer
necessario
Unix timestamp (seconds) for when the job was created.
completed_at
integer | null
necessario
Unix timestamp (seconds) for when the job completed, if finished.
expires_at
integer | null
necessario
Unix timestamp (seconds) for when the downloadable assets expire, if set.
size
enum
necessario
seconds
string
necessario
Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
error
OpenAI.Error-2 | null
necessario
An error that occurred while generating the response.
code
string
necessario
A machine-readable error code that was returned.
message
string
necessario
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
necessario
The public continuation instruction.
Richiedi
import OpenAI from 'openai';
const client = new OpenAI();
const video = await client.videos.retrieve('video_123');
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.retrieve(
"video_123",
)
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.Get(context.TODO(), "video_123")
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.retrieve("video_123")
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.VideoRetrieveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
Video video = client.videos().retrieve("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 video = await client.videos.retrieve('video_123');
console.log(video.id);