POST 一回でレンダリングがワーカーのキューに入り、署名付き Webhook が mp4 を返します。ffmpeg のインストールも、GPU の確保も、キューの見張りも不要です。
POSThttps://autostud.ai/api/v1/actions/renders.create動画は一度作れば、あとは必要なだけレンダリングできます。
動画はタイムラインそのものです。レイヤー、音声、字幕、フォーマット。1 回の呼び出しで作るか、チームがエディタで組んだものをそのまま使えます。
export AUTOSTUD_API_KEY="sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# A video is the timeline. Create one, or skip this step and reuse
# a video your team already built in the editor.
curl -X POST https://autostud.ai/api/v1/actions/videos.create \
-H "Authorization: Bearer $AUTOSTUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video_name": "Launch teaser",
"video_format": "portrait",
"video_lang": "en"
}'renders.create に動画 ID を渡し、このジョブだけ変えたい設定を上書きすれば、すぐワーカーへ送られます。返るのはジョブであって、ファイルではありません。
# The Idempotency-Key makes this call safe to retry: send it twice
# and you get the same render back, never a second job.
curl -X POST https://autostud.ai/api/v1/actions/renders.create \
-H "Authorization: Bearer $AUTOSTUD_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: launch-teaser-v3" \
-d '{
"video_id": "0f4c8b71-2d95-47a3-9e6c-15b8ad7f3c20",
"render_settings": {
"quality": "high"
}
}'render.completed が出力 URL とともに届きます。ポーリングが好みなら、動画 ID で絞り込んでレンダリング一覧を読み直してください。
# Register once. Every render reports itself from then on.
curl -X POST https://autostud.ai/api/v1/webhooks \
-H "Authorization: Bearer $AUTOSTUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/hooks/autostud",
"events": ["render.started", "render.completed", "render.failed"],
"description": "Rendering"
}'
# The signing secret comes back once, in this response. Store it.開始に 2 つのフィールド、安全な再試行に 1 つのヘッダー、追跡に 1 つの ID。
video_idレンダリングする動画。構成のすべてはすでにこの中にあります。
render_settingsこのジョブだけの任意の上書き設定。フォーマット、品質、必要なフレーム範囲。
Idempotency-Keyヘッダーです。同じキーを 2 回送れば最初のレンダリングが返り、重複は決して生まれません。
render_id呼び出しが返し、すべての Webhook が運ぶ ID。完成した mp4 は常に依頼元のジョブを指します。
レンダリング結果は H.264 の mp4 で、動画に設定されたフォーマットに従います。TikTok や Reels には縦、フィードには正方形、YouTube には横。同じタイムラインから違う出力が得られます。
レンダリングにかかるのはミリ秒ではなく分単位です。Webhook を 1 つ登録すれば、ワーカーが着手した時、ファイルが完成した時、失敗した時を 3 つのイベントが知らせます。
render.startedrender.completedrender.failed動画の長さとレイヤー数に比例して数分です。呼び出しはジョブがキューに入った時点で返るので、アプリ側で待たされることはありません。
レンダリングはクレジット課金で、履歴は API から読めます。キーを renders:read だけに絞れば、ジョブを開始できないダッシュボードから消費だけを監視できます。
できます。Idempotency-Key ヘッダーを送れば、再度の呼び出しは 2 件目をキューに入れず元のレンダリングを返します。API のすべての実行アクションが同じ保証を提供します。
当社の CDN にあり、URL はレンダリングのレコードと render.completed のペイロードの両方に入っています。恒久的に必要なら、ダウンロードして自分側で保管してください。