Skip to main content
POST
Text-to-video: submit a video generation task from text
오른쪽의 대화형 플레이그라운드는 실시간 디버깅을 지원합니다. Authorization 필드에 API 키를 설정합니다(형식: Bearer sk-xxx), prompt를 입력하고 model / size / seconds를 선택한 다음 전송합니다.
범위: 이 페이지는 텍스트만으로 동영상을 생성하는 기능만 다룹니다. input_reference가 없으며, 요청 본문은 application/json입니다. 참조 이미지에서 동영상으로 애니메이션을 만들려면 이미지-투-비디오 엔드포인트를 사용합니다(동일한 경로 + multipart 업로드).
⚠️ 3단계 비동기 흐름 — 이 페이지는 1단계(제출)만 다룹니다
  • 1단계(이 페이지): POST /v1/videosvideo_id + status: "queued"를 반환합니다
  • 2단계: GET /v1/videos/{video_id}status: "completed"가 될 때까지 폴링합니다
  • 3단계: GET /v1/videos/{video_id}/content에서 다운로드합니다(MP4 파일을 반환합니다)
POST 자체는 몇 초가 걸리며 생성이 끝날 때까지 블로킹하지 않습니다. 전체 흐름은 아래 Python 샘플에 나와 있습니다.

코드 샘플

Python (OpenAI SDK 드롭인)

Python (Raw requests)

cURL

Node.js (fetch)

브라우저 JavaScript

매개변수 빠른 참조

자세한 매개변수 제약, 허용 값, 예시는 오른쪽 플레이그라운드에서 확인할 수 있습니다 — 모든 enum 필드에는 드롭다운이 제공됩니다. 이미지-투-동영상 매개변수(input_reference 업로드)의 경우 이미지-투-동영상 엔드포인트를 참조하십시오.

응답 형식

단계 1 — 즉시 제출 응답

단계 2 — 실행 중 폴링

단계 2 — 완료 후 폴링

⚠️ 응답 필드 주의사항
  • 직접 video_url 필드 없음 — 동영상 파일은 GET /v1/videos/{id}/content에서 다운로드해야 합니다(video/mp4 바이너리 스트림을 반환합니다). JSON 응답에서 CDN URL이 있을 것이라고 기대하지 마십시오.
  • progress은 엄격하게 선형적이지 않습니다 — 건너뛸 수 있습니다(예: 0 → 45 → 80 → 100)
  • status: "failed"에서는 error 필드가 항상 존재하지 않습니다 — 대부분의 실패는 콘텐츠 정책 또는 용량 문제이며, 그냥 다시 시도하거나 프롬프트를 수정하십시오
  • OpenAI의 동영상 콘텐츠는 1일 동안만 보관됩니다 — /content은 만료 후 404를 반환합니다
이 엔드포인트는 비동기 작업 진입점입니다. 작업이 완료되면 과금은 seconds 요율로 정산됩니다(가격표 참조). POST 제출, 상태 폴링, 콘텐츠 다운로드 자체는 과금되지 않으며, 실패한 작업도 과금되지 않습니다.

인증

Authorization
string
header
필수

API Key from the APIYI console (must use Sora2官转 group + usage-based billing)

본문

application/json
model
enum<string>
기본값:sora-2
필수

Model ID. sora-2 supports 720p only; sora-2-pro supports 720p / 1024p / 1080p tiers

사용 가능한 옵션:
sora-2,
sora-2-pro
prompt
string
필수

Video generation prompt; describe scene, camera motion, style, lighting, and character actions in detail

예시:

"A serene Japanese garden with cherry blossoms, koi pond, traditional bridge, golden hour, ultra detailed"

seconds
enum<string>
기본값:4

Video duration as a string enum (not a number):

  • "4" — 4 seconds (default), ideal for short demos, single shots, fast prompt iteration
  • "8" — 8 seconds, standard short-form video, most common
  • "12" — 12 seconds, long shots and continuous action

Passing "10" / "15" or the integer 4 returns 400

사용 가능한 옵션:
4,
8,
12
size
enum<string>
기본값:720x1280

Output resolution. sora-2 and sora-2-pro support different tiers:

  • sora-2 (720p only): 720x1280 (portrait, default) / 1280x720 (landscape)
  • sora-2-pro additionally supports:
    • 1024x1792 / 1792x1024 (1024p, $0.50/sec)
    • 1080x1920 / 1920x1080 (1080p, $0.70/sec)

Passing 1024p / 1080p sizes to sora-2 returns 400

사용 가능한 옵션:
720x1280,
1280x720,
1024x1792,
1792x1024,
1080x1920,
1920x1080

응답

Task submitted, returns video_id with queued status

id
string

Task ID for subsequent polling and download

예시:

"video_abc123def456"

object
string

Object type, fixed video

예시:

"video"

model
string

Model ID used for this task

예시:

"sora-2"

status
enum<string>

Task status:

  • queued — submitted, waiting in queue
  • in_progress — generating
  • completed — done, ready to download (/v1/videos/{id}/content)
  • failed — failed (not billed), safe to retry
사용 가능한 옵션:
queued,
in_progress,
completed,
failed
예시:

"queued"

progress
integer

Generation progress percentage (0–100), not strictly linear

예시:

0

created_at
integer

Task creation Unix timestamp (seconds)

예시:

1712697600

completed_at
integer

Task completion Unix timestamp (seconds), present only on completed status

예시:

1712697900

size
string

Actual output resolution (matches the requested size)

예시:

"1280x720"

seconds
string

Actual duration generated (matches the requested seconds)

예시:

"8"

quality
string

Quality tier (standard for sora-2, high for sora-2-pro)

예시:

"standard"