Skip to main content
POST
このエンドポイントを使用すると、1 枚の元画像とプロンプトから Grok の image-to-video ジョブを開始できます。request_id は即座に返されるため、非同期ワークフローの最初のステップとして扱ってください。

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

  • model: grok-imagine-video-1.5 を使用します
  • image.url には公開された JPEG、PNG、または WebP の URL を設定します
  • 最初のリクエストでは、duration1resolution720p のままにします
  • アニメーションの方向性が明確になるよう、prompt は具体的に記述します
  • base64 を送信する場合は、ドキュメントと OpenAPI の例の形式を data:image/png;base64,<BASE64_IMAGE_DATA> のまま使用します

Duration と resolution

タスクフロー

1

ジョブを作成する

プロンプトと元画像を送信し、返された request_id を保存します。
2

完了までポーリングする

ネストされたプロバイダーの status が done になるまで、Get xAI video results を呼び出します。
3

出力を保存する

プロバイダーの一時的な配信期間が過ぎた後も必要な場合は、最終的な video.url を自分のストレージにコピーします。

承認

Authorization
string
header
必須

Bearer token authentication. Use your CometAPI key.

ボディ

application/json
prompt
string
必須

Prompt describing how the source image should animate. CometAPI requires this field for this route.

:

"Animate the still image with a slow camera move and natural motion."

aspect_ratio
enum<string>

Output aspect ratio. Combine with resolution to choose the target frame; for example 480p with 1:1 targets 480x480, 720p with 16:9 targets 1280x720, and 720p with 9:16 targets 720x1280. This endpoint does not expose an exact size field.

利用可能なオプション:
1:1,
16:9,
9:16,
4:3,
3:4,
3:2,
2:3
duration
integer
デフォルト:8

Output duration in seconds. Use an integer from 1 through 15. If omitted, CometAPI treats the request as an 8-second generation for billing and default handling.

image
object

Source image for image-to-video. Use a public JPEG, PNG, or WebP URL, or a data URI such as data:image/png;base64,<BASE64_IMAGE_DATA>.

model
string
デフォルト:grok-imagine-video-1.5

xAI video model id. The default example uses Grok Imagine 1.5 for image-to-video.

:

"grok-imagine-video-1.5"

output
object
resolution
enum<string>
デフォルト:720p

Output resolution. Use 720p for a small image-to-video test, or 1080p when you need a higher resolution tier.

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

Deprecated size field. Prefer aspect_ratio and resolution.

user
string

Optional end-user identifier.

レスポンス

200 - application/json

Request accepted.

request_id
string
必須

Deferred request id used for polling.