Grok Imagine Video 1.5 API
APIMaster を通じて Grok Imagine Video 1.5 を呼び出し、テキストから動画、および画像から動画の生成を行います。
Grok Imagine Video 1.5
テキストから動画、および画像から動画を生成するには、APIMaster の非同期動画 API と grok-imagine-video-1.5 を使用します。
ベース URL:
https://apimaster.ai/v1(https://apimaster.ai/v1)。タスクはPOST https://apimaster.ai/v1/videos/generationsで作成します。
タスクを送信する
POST https://apimaster.ai/v1/videos/generations
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
model |
string | はい | grok-imagine-video-1.5 |
prompt |
string | はい | 英語または中国語による動画の説明 |
aspect_ratio |
string | いいえ | 16:9、9:16、1:1 などのアスペクト比。デフォルトは 16:9 |
duration |
integer | いいえ | 動画の長さ(秒)。デフォルトは 6 |
resolution |
string | いいえ | 480p、720p、または現在利用可能なその他の解像度。デフォルトは 720p |
image_urls |
string[] | いいえ | 公開アクセス可能な HTTP(S) の参照画像 URL |
テキストから動画
curl -s "https://apimaster.ai/v1/videos/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5",
"prompt": "A dog running on a sunny beach, cinematic slow motion",
"aspect_ratio": "16:9",
"duration": 6,
"resolution": "720p"
}'
画像から動画
curl -s "https://apimaster.ai/v1/videos/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video-1.5",
"prompt": "Animate the scene naturally with a gentle camera push-in",
"image_urls": ["https://example.com/start.png"],
"aspect_ratio": "16:9",
"duration": 10,
"resolution": "720p"
}'
送信時のレスポンスにはタスク ID が含まれます。
{
"code": 200,
"data": [{"task_id": "task_xxxxxxxx", "status": "submitted"}]
}
タスクのステータスを確認する
GET https://apimaster.ai/v1/videos/{task_id}
curl -s "https://apimaster.ai/v1/videos/task_xxxxxxxx" \
-H "Authorization: Bearer YOUR_API_KEY"
完了すると、レスポンスに動画 URL が含まれます。
{
"id": "task_xxxxxxxx",
"status": "completed",
"progress": "100%",
"url": "https://apimaster.ai/v1/videos/task_xxxxxxxx/content"
}
ダウンロード
GET https://apimaster.ai/v1/videos/{task_id}/content
curl -L "https://apimaster.ai/v1/videos/task_xxxxxxxx/content" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o output.mp4
制限とエラー
- 6 秒未満の長さは 6 秒に正規化されます。利用可能な最大値と解像度は、現在のモデルカードとレスポンスによって決まります。
image_urlsの各要素は、公開されている HTTP(S) URL である必要があります。401は API キーが無効、402は残高不足、429はレート制限を意味します。- タスクが失敗した場合は、ダウンロードを試みる前にステータスレスポンスのエラーを確認してください。
