Integrasi API Grok Imagine Video
Gunakan Grok Imagine Video melalui Rivya Public API v1 dengan id model grok-imagine-video, input yang didukung, parameter, aturan Files API, kredit, dan contoh response.
grok-imagine-video
text, file
Diperlukan untuk mode referensi
10
Video
FIXED
5000 karakter
Kontrak request
Kirim id model di level atas. Kontrol khusus model berada di params.
| Key | Tipe | Wajib | Default | Deskripsi |
|---|---|---|---|---|
| model | string | Ya | grok-imagine-video | Gunakan grok-imagine-video sebagai id model API. |
| prompt | string | Ya | - | Maksimum 5000 karakter untuk model ini. |
| params | object | Tidak | - | Objek parameter khusus model. Gunakan baris di bawah untuk key yang diizinkan. |
| client_request_id | string | Tidak | - | ID sisi klien opsional untuk melacak request di sistem Anda. |
Parameter model
| Key | Tipe | Wajib | Default | Rentang | Opsi | Deskripsi |
|---|---|---|---|---|---|---|
| mode | select | Tidak | normal | - | fun, normal, spicy | Mode generasi |
| duration | number | Tidak | 6 | min 6 / max 30 / step 1 | - | Durasi |
| resolution | select | Tidak | 480p | - | 480p, 720p | Resolusi |
| aspect_ratio | select | Tidak | 2:3 | - | 1:1, 16:9, 9:16, 2:3, 3:2 | Rasio aspek |
Kebijakan unggahan
Unggah file referensi terlebih dahulu, lalu tempatkan URL dan duration token yang dikembalikan ke dalam params.referenceMediaItems.
Gambar referensi: Unggah hingga 1 file gambar untuk proyek gambar.
1
image
Referensi video dan audio harus membawa durationToken dari /api/v1/files saat verifikasi durasi diperlukan.
| kind | Ukuran maksimum | Tipe MIME |
|---|---|---|
| image | 10 MB | image/jpeg, image/png, image/webp |
Request minimal
{
"model": "grok-imagine-video",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"mode": "normal",
"duration": 6,
"resolution": "480p",
"aspect_ratio": "2:3"
}
}Request file referensi
{
"model": "grok-imagine-video",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"mode": "normal",
"duration": 6,
"resolution": "480p",
"aspect_ratio": "2:3",
"referenceMediaItems": [
{
"url": "https://cdn.example.com/reference-image.png",
"kind": "image",
"name": "reference-image.png",
"mimeType": "image/png"
}
]
}
}Response create
Endpoint create mengembalikan public task id. Poll endpoint status sampai tugas berhasil atau gagal.
{
"id": "task_grok_imagine_video_example",
"status": "queued",
"model": "grok-imagine-video",
"reserved_credits": 10,
"final_credits": 0,
"created_at": "2026-05-11T00:00:00.000Z",
"updated_at": "2026-05-11T00:00:00.000Z",
"result": null,
"error": null
}Error umum
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found
Beberapa mode membutuhkan unggahan referensi Files API.