Пропустить и перейти к основному содержимому

Этот браузер больше не поддерживается.

Выполните обновление до Microsoft Edge, чтобы воспользоваться новейшими функциями, обновлениями для системы безопасности и технической поддержкой.

Скачать Microsoft Edge Дополнительные сведения об Internet Explorer и Microsoft Edge
microsoft-foundry.rest.security.o-auth2-auth

Videos

Create a video

POST /openai/v1/videos

Creates a video from the supplied request.

Текст запроса

The multipart request body.

Content-Type: multipart/form-data
model OpenAI.CreateVideoMultipartBody

The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults to sora-2.

prompt string обязательно

Text prompt that describes the video to generate.

input_reference any | OpenAI.ImageRefParam
Один из следующих:
any
Любое из следующих:
image_url string обязательно
file_id string обязательно
seconds OpenAI.CreateVideoMultipartBody

Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds.

size OpenAI.CreateVideoMultipartBody

Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.

Ответы

The request has succeeded.

Текст

Content-Type: application/json
id string обязательно

Unique identifier for the video job.

object enum обязательно

The object type, which is always video.

video
model string | enum обязательно
Любое из следующих:
string
enum
sora-2sora-2-prosora-2-2025-10-06sora-2-pro-2025-10-06sora-2-2025-12-08
status enum обязательно
queuedin_progresscompletedfailed
progress integer обязательно
created_at integer обязательно

Unix timestamp (seconds) for when the job was created.

completed_at integer | null обязательно

Unix timestamp (seconds) for when the job completed, if finished.

expires_at integer | null обязательно

Unix timestamp (seconds) for when the downloadable assets expire, if set.

prompt string | null обязательно
size enum обязательно
720x12801280x7201024x17921792x1024
seconds string обязательно

Duration of the generated clip in seconds. For extensions, this is the stitched total duration.

remixed_from_video_id string | null обязательно
error OpenAI.Error-2 | null обязательно

An error that occurred while generating the response.

code string обязательно

A machine-readable error code that was returned.

type string | null
param string | null
message string обязательно

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.

[key: string] string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Любое из следующих:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string обязательно

The public continuation instruction.

Client error

Текст

Content-Type: application/json
error OpenAI.Error обязательно
code string | null обязательно
message string обязательно
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Любое из следующих:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string обязательно

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Server error

Текст

Content-Type: application/json
error OpenAI.Error обязательно
code string | null обязательно
message string обязательно
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Любое из следующих:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string обязательно

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Запрос

curl https://api.openai.com/v1/videos \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -F "model=sora-2" \
  -F "prompt=A calico cat playing a piano on stage"
import OpenAI from 'openai';

const openai = new OpenAI();

const video = await openai.videos.create({ prompt: 'A calico cat playing a piano on stage' });

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.create(
    prompt="x",
)
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.New(context.TODO(), openai.VideoNewParams{
        Prompt: "x",
    })
    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.create(prompt: "x")

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.VideoCreateParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        VideoCreateParams params = VideoCreateParams.builder()
            .prompt("x")
            .build();
        Video video = client.videos().create(params);
    }
}
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.create({ prompt: 'x' });

console.log(video.id);

Response

{
  "id": "video_123",
  "object": "video",
  "model": "sora-2",
  "status": "queued",
  "progress": 0,
  "created_at": 1712697600,
  "size": "1024x1792",
  "seconds": "8",
  "quality": "standard"
}
ru-ru
Ваши варианты выбора параметров конфиденциальности
  • Заявление об отказе ИИ
  • Предыдущие версии
  • Блог
  • Участие в доработке
  • Конфиденциальность
  • Конфиденциальность медицинских данных потребителей
  • Условия использования
  • Товарные знаки
  • © Microsoft 2026