Skip to content

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 ​

MethodFull Endpoint PathPurpose
POST/v1/videos/generationsCreate an asynchronous video task (HTTP 202 Accepted)
GET/v1/tasks/{id}Query task progress and status by task ID
GET/v1/tasks/{id}/contentDownload private MP4 after success (HTTP 307 Redirect)

Before you start

  1. undefined
  2. undefined
  3. 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 ​

bash
# 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.mp4

undefined ​

| 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, or output_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

json
{
  "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:

json
{
  "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 ​

  1. 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.
  2. Deduplication: Duplicate URLs within a single request are rejected. The 50-image ceiling is a platform safety limit, not a quality guarantee.
  3. Source video validation: Source videos are safely downloaded and probed. Non-standard MP4 containers, corrupted streams, or inaccessible URLs trigger VIDEO_ASSET_INVALID.
  4. 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 → succeeded or failed.
  • Download: When status=succeeded, fetch GET /v1/tasks/{id}/content to obtain an HTTP 307 redirect to the private MP4 link.
  • Idempotency: Use the optional Idempotency-Key header (1–128 printable ASCII) to prevent duplicate charges during network timeouts. Failed or timed-out tasks return TASK_TIMEOUT in error.code.

Error codes and troubleshooting ​

HTTP StatusError CodeProbable Cause & Resolution
400VIDEO_REQUEST_INVALIDMissing prompt, duration omitted or outside 1–15, invalid aspect ratio, or mixed generation/editing fields.
400VIDEO_ASSET_INVALIDAsset URL unreachable, redirect detected, corrupt image, or non-MP4 video container.
401INVALID_API_KEYAPI key is missing, malformed, revoked, or IP-restricted.
402INSUFFICIENT_BALANCEInsufficient Workspace funds. Top up your balance in the console.
404MEDIA_TASK_NOT_FOUNDTask ID not found or unauthorized cross-workspace access attempt.
409 VIDEO_PRICE_CHANGEDReview current catalog terms before deciding whether to create again.
409VIDEO_IDEMPOTENCY_CONFLICTSame Idempotency-Key reused with altered payload.
503VIDEO_SERVICE_UNAVAILABLEThe service is temporarily unavailable. Check status code TASK_TIMEOUT on failure.

Shared video task guide

Access leading AI models through one unified API