Grok Imagine Video 1.5
xAI · 1–15s · 480p / 720p / 1080p · 1–50 Image references · Actual-cost billing
Grok Imagine Video 1.5 brings enhanced visual clarity, finer texture reproduction, and an added 1080p high-definition tier to xAI's video suite. It is optimized for high-fidelity text-to-video and multi-image reference composition under Tokenlio's unified actual-cost video engine.
API Endpoints
| Method | Full Endpoint Path | Purpose |
|---|---|---|
| POST | /v1/videos/generations | Create an asynchronous video task (HTTP 202 Accepted) |
| GET | /v1/tasks/{id} | Query task progress and status by task ID |
| GET | /v1/tasks/{id}/content | Download private MP4 after success (HTTP 307 Redirect) |
Before you start
- undefined
- undefined
- undefined
Video editing is not supported on 1.5
Grok Imagine Video 1.5 does not support video editing (operation: edit or video_urls). Submitting editing parameters will be rejected locally with 400 VIDEO_REQUEST_INVALID. To edit an existing video, use Grok Imagine Video.
undefined
| undefined | | --- | --- | --- | | Text-to-video | 1–15 integer seconds; 480p / 720p / 1080p | Added 1080p resolution tier for crisp large-screen presentation. | | Image reference | 1–50 HTTPS images (order preserved) | Composite up to 50 reference images with prompt control. | | Video editing | Not supported | Excluded on 1.5; use Base for video editing workflows. | | undefined | | undefined |
undefined
# 1. Submit a video task (returns HTTP 202 with task ID)
BASE_URL='https://api.tokenlio.ai'
curl "$BASE_URL/v1/videos/generations" \
-H "Authorization: Bearer $TOKENLIO_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"model":"grok-imagine-video-1.5","prompt":"A quiet landscape at sunrise","duration":6,"resolution":"480p","size":"16:9"}'
# Example Response: {"id":"dfc68868-d388-4d83-a173-d44e47a8bec7","model":"grok-imagine-video-1.5","status":"queued","assets":[]}
# 2. Poll task progress every 5–15 seconds
TASK_ID='YOUR_TASK_ID'
curl "$BASE_URL/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $TOKENLIO_API_KEY"
# 3. Download the result MP4 video
curl --location "$BASE_URL/v1/tasks/$TASK_ID/content" \
-H "Authorization: Bearer $TOKENLIO_API_KEY" -o result.mp4undefined
| undefined | | --- | --- | --- | --- | --- | | model | string | Must be grok-imagine-video-1.5 | Exact published model ID. No unapproved suffixes or uppercase variants. | | prompt | string | Required nonblank string | Scene description; up to 8,000 Unicode characters. | | operation | string | Optional generate (default) | Editing is unsupported. Only generate is allowed. | | duration | integer | Required integer 1–15 | Output duration in seconds. Must be an explicit integer. | | resolution | string | 480p / 720p / 1080p (default 480p) | Full three-tier resolution selection. | | size | string | Optional (default auto) | Aspect ratio: auto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3. | | image_urls | string[] | Optional 1–50 URLs | Ordered reference images. Omit rather than passing empty []. | | video_urls | string[] | Must be omitted | Unsupported on this model. |
Strict parameter mutual exclusion
- Forbidden controls: Do not send
video,aspect_ratio,generate_audio,seed,return_last_frame, oroutput_format. - Editing exclusivity: When
operation: edit, all generation controls (duration,resolution,size,image_urls) must be omitted, even if 0, empty, or null. - Payload limit: The entire JSON payload must not exceed 64 KiB.
undefined
undefined
undefined
{
"model": "grok-imagine-video-1.5",
"prompt": "A quiet landscape at sunrise",
"duration": 6,
"resolution": "480p",
"size": "16:9",
"image_urls": [
"https://cdn.example.com/reference-a.png"
],
"operation": "generate"
}undefined
Generate high-definition 1080p video with multiple reference images:
{
"model": "grok-imagine-video-1.5",
"prompt": "A quiet landscape at sunrise",
"duration": 6,
"resolution": "1080p",
"size": "16:9",
"image_urls": [
"https://cdn.example.com/reference-a.png",
"https://cdn.example.com/reference-b.png"
]
}Asset URL and network transmission rules
- Public HTTPS direct access: All image and video URLs must be publicly accessible via standard HTTPS/443 without redirects, credentials, private IPs, or URL fragments.
- Deduplication: Duplicate URLs within a single request are rejected. The 50-image ceiling is a platform safety limit, not a quality guarantee.
- Source video validation: Source videos are safely downloaded and probed. Non-standard MP4 containers, corrupted streams, or inaccessible URLs trigger
VIDEO_ASSET_INVALID. - Content stability: Keep URLs immutable; server measurements rely on byte-level consistency.
Billing and reference rates
Reference rates are shown in the console; they are not a pre-charge or a spending cap. Final actual charges appear as charged_amount in task/call records after successful delivery and settlement. Failed, timed-out (TASK_TIMEOUT) or undelivered tasks are not charged, and polling/downloads are not new generation calls.
max_charge_amount is not accepted for actual-cost models. expected_pricing_revision is optional: send it only when you already hold a valid pricing version. Review current catalog terms rather than blindly resending a changed-price request.
video-reference-pricing/v2 · USD
Lifecycle, polling and download
- Acceptance: A successful submission returns HTTP 202 Accepted with a task
id. - Polling: Poll
GET /v1/tasks/{id}every 5–15 seconds. Status transitions:queued→processing→succeededorfailed. - Download: When
status=succeeded, fetchGET /v1/tasks/{id}/contentto obtain an HTTP 307 redirect to the private MP4 link. - Idempotency: Use the optional
Idempotency-Keyheader (1–128 printable ASCII) to prevent duplicate charges during network timeouts. Failed or timed-out tasks returnTASK_TIMEOUTinerror.code.
Error codes and troubleshooting
| HTTP Status | Error Code | Probable Cause & Resolution |
|---|---|---|
| 400 | VIDEO_REQUEST_INVALID | Missing prompt, duration omitted or outside 1–15, invalid aspect ratio, or mixed generation/editing fields. |
| 400 | VIDEO_ASSET_INVALID | Asset URL unreachable, redirect detected, corrupt image, or non-MP4 video container. |
| 401 | INVALID_API_KEY | API key is missing, malformed, revoked, or IP-restricted. |
| 402 | INSUFFICIENT_BALANCE | Insufficient Workspace funds. Top up your balance in the console. |
| 404 | MEDIA_TASK_NOT_FOUND | Task ID not found or unauthorized cross-workspace access attempt. |
409 VIDEO_PRICE_CHANGED | Review current catalog terms before deciding whether to create again. | |
| 409 | VIDEO_IDEMPOTENCY_CONFLICT | Same Idempotency-Key reused with altered payload. |
| 503 | VIDEO_SERVICE_UNAVAILABLE | The service is temporarily unavailable. Check status code TASK_TIMEOUT on failure. |
