Skip to main content
POST
このエンドポイントを使用して、テキスト、ソース画像、または参照入力から Grok 動画ジョブを開始します。request_id がすぐに返されるため、非同期ワークフローの最初のステップとして扱ってください。 常に model: grok-imagine-video-1.5 を明示的に送信してください。modelprompt は、ここで説明する 1.5 のリクエスト形式で必須です。

入力モードを選択する

データ URI には data:image/png;base64,<BASE64_IMAGE_DATA> を使用します。各 reference_images 項目では同じ url フィールドを使用します。参照オーディオ項目では、voice_id などのプリセット eve を使用します。プロンプトでは、<IMAGE_0><AUDIO_0> などのタグで対応する参照を識別できます。

小規模なリクエストから始める

  • model: grok-imagine-video-1.5 を使用する
  • 最初のリクエストでは、duration1 に、resolution480p に設定します。
  • prompt を明示的に指定して、シーンと動きを明確にします
  • 参照画像と音声を組み合わせる前に、入力モードは一度に 1 つずつ追加します

長さと解像度

生成された動画にはオーディオトラックが含まれます。アプリケーションが特定の出力形式に依存する場合は、durationresolutionaspect_ratio を明示的に設定してください。

タスクフロー

1

ジョブを作成

モデル、プロンプト、および任意の入力を送信し、返された request_id を保存します。
2

完了するまでポーリングする

以下の xAI動画結果を取得 を、最上位の statusdonefailed、または expired になるまで呼び出します。タスクメタデータの準備中は、初期レスポンスにエコーバックされた request_id のみが含まれる場合があります。
3

出力を保存

一時的な配信期間後にも必要な場合は、最終的な video.url を自分のストレージにコピーしてください。

承認

Authorization
string
header
必須

Use your CometAPI API key as the bearer value.

ボディ

application/json
model
enum<string>
必須

The Grok video model ID. Send this field explicitly so the request uses Grok Imagine Video 1.5.

利用可能なオプション:
grok-imagine-video-1.5
:

"grok-imagine-video-1.5"

prompt
string
必須

A description of the scene, motion, and audio. Reference-to-video prompts can identify inputs with tags such as <IMAGE_0> and <AUDIO_0>.

Minimum string length: 1
:

"A paper boat glides across a quiet pond at sunrise."

duration
integer
デフォルト:8

The output duration in seconds. Use an integer from 1 through 15.

必須範囲: 1 <= x <= 15
aspect_ratio
enum<string>

The output aspect ratio. Text-to-video uses 16:9 when omitted. Image-to-video uses the source image's aspect ratio when omitted.

利用可能なオプション:
1:1,
16:9,
9:16,
4:3,
3:4,
3:2,
2:3
:

"16:9"

resolution
enum<string>
デフォルト:480p

The output resolution. Reference-to-video requests support 480p and 720p; text-to-video and image-to-video also support 1080p.

利用可能なオプション:
480p,
720p,
1080p
image
object

The source image for image-to-video. Do not combine this field with reference_images or reference_audios.

reference_images
object[]

Visual references for reference-to-video. Each item accepts a public image URL or image data URI. Do not combine this field with image.

Required array length: 1 - 7 elements
reference_audios
object[]

Preset voice references for reference-to-video. Do not combine this field with image.

Required array length: 1 - 3 elements

レスポンス

200 - application/json

Request accepted.

request_id
string
必須

The deferred request ID used to poll GET /grok/v1/videos/{request_id}.

最終更新日 2026年8月21日