Skip to main content
POST
Text-to-video: submit a video generation task from text
右側のインタラクティブなプレイグラウンドでは、ライブデバッグができます。Authorization フィールドに API Key を設定し(形式: Bearer sk-xxx)、prompt を入力して、model / size / seconds を選択し、送信してください。
Scope: このページでは「テキストのみから動画を生成」する方法を扱います — input_reference はなく、リクエストボディは application/json です。参照画像からアニメーション化する場合(image-to-video)は、Image-to-Video endpoint を使用してください(同じ path + multipart アップロード)。
⚠️ 3段階の非同期フロー — このページではステップ 1(送信)までを扱います
  • Step 1(このページ): POST /v1/videosvideo_id + status: "queued" を返します
  • Step 2: GET /v1/videos/{video_id}status: "completed" になるまでポーリングします
  • Step 3: GET /v1/videos/{video_id}/content からダウンロードします(MP4 ファイルを返します)
POST 自体は数秒かかり、生成が完了するまで ブロックしません。完全なフローは下の Python サンプルに示されています。

コードサンプル

Python (OpenAI SDK ドロップイン)

Python (Raw requests)

cURL

Node.js (fetch)

Browser JavaScript

パラメーター早見表

詳細なパラメーター制約、許可される値、例は右側の Playground で確認できます。すべての enum フィールドにはドロップダウンがあります。画像から動画へのパラメーター(input_reference upload)については、Image-to-Video エンドポイント を参照してください

応答形式

Step 1 — 即時送信応答

Step 2 — 実行中のポーリング

Step 2 — 完了後のポーリング

⚠️ 応答フィールドの注意点
  • video_url フィールドは直接ありません — 動画ファイルは GET /v1/videos/{id}/content からダウンロードする必要があります(video/mp4 のバイナリストリームを返します)。JSON 応答に CDN URL が含まれるとは期待しないでください。
  • progress は厳密に直線的ではありません — 飛ぶことがあります(例: 0 → 45 → 80 → 100)
  • status: "failed" では、error フィールドが常に存在するとは限りません — 失敗の多くはコンテンツポリシーまたはキャパシティの問題です。再試行するか、prompt を見直してください
  • 動画コンテンツは 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"