Skip to main content

Overview

The model ID remains grok-video. Use the preferred REST URLs below. The previous /generateTask/grok-video and /statusTask/grok-video URLs remain supported with the same parameters and pricing. Grok Imagine Video is an xAI video model for text-to-video generation and image-to-video workflows. Use this page when you are ready to call the API after trying the model in the APIXO playground.

Choose the Grok video endpoint

These endpoints generate new clips; neither exposes video-input editing or native video extension. For dedicated first/last frames, timed keyframes, and loop images, use Grok Imagine Video 1.5. Grok Imagine Video does not expose those frame controls. Multiple image_urls entries remain reference images, not a first/last-frame pair. xAI’s native Extend feature is a separate API capability; do not send its parameters to these APIXO endpoints. For a longer sequence assembled from separate clips, see the Grok longer-video workflow. It explains clip planning and editing, and distinguishes this workflow from native video extension.

Endpoint and authentication

Base URL:
All requests require your APIXO API key:
Submit requests also require:

Copy-paste async quickstart

This minimal request submits a text-to-video task and returns a taskId.
Successful response:
Save the taskId; you need it to poll for the final result.

Poll for result

Processing response:
Success response:
Failed response:
Parse resultJson after state becomes success:

Request body

Text-to-video

Image-to-video with image URLs

Image-to-video from a Grok Imagine Image task

Use a successfully completed Grok Imagine Image task and select an available result with index (0 through 5). This animates a still image into a new video; it does not extend a previous video. Do not include image_urls in the same request.

Parameters

string
default:"async"
Result delivery mode. Omit this field or use async for polling with statusTask, or use callback for webhook delivery.
string
Required when request_type is callback. Provide a public HTTPS URL that can receive the final task payload. See Webhooks.
object
required
Grok Imagine Video input parameters.

Response format

Submit task response

POST /generateTask/grok-imagine-video returns a task ID when the task is accepted:
integer
API status code. 200 means the task was accepted.
string
Human-readable status message.
string
Unique task identifier used with the status endpoint.

Status response fields

string
Unique task identifier.
string
Current task state: processing, success, or failed.
string
JSON string containing the generated video URLs in resultUrls. Present when state is success.
string
Machine-readable failure code. Present when state is failed.
string
Human-readable failure message. Present when state is failed.
integer
Task creation timestamp in Unix milliseconds.
integer
Task completion timestamp in Unix milliseconds. Present after completion.
integer
Processing duration in milliseconds. Present after completion.

Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.
Callback delivery uses the same final payload shape as the status response. See Webhooks for delivery requirements and retry behavior.

Billing

New non-LLM requests use 1 credit = $0.001. Calculate the full amount, including billable quantity and add-ons, apply the applicable account discount, then round the request total upward to the next whole credit. Agreed fixed unit prices retain their precision and replace the standard price and discount; final rounding still applies. See credit conversion and rounding. The rates below match the main API Pricing catalog’s public base-price table updated on October 30, 2026. Check that page for current rates and any account discount before budgeting. Grok Imagine Video is billed per second. The selected resolution determines the per-second unit price, and the submitted duration determines the billable seconds. The market display reference is a separately specified comparison value and does not affect the amount charged. Formula:
A 10-second request costs $0.240 at 480p, $0.450 at 720p, or $0.800 at 1080p, before any account discount. These totals apply to both supported modes. These are USD API usage charges. Studio monthly credits do not apply to API calls. For current API rates in USD, see API pricing.

Latency and polling

The user manual lists typical Grok Imagine Video generation time at about 40s-60s. Actual latency may vary by prompt complexity, duration, resolution, queue load, and storage transfer time.
For production workloads, use callback mode to avoid frequent polling while video tasks run.
Result URLs are valid for 15 days. Download and store important outputs promptly. For image-to-video, use exactly one source method: either image_urls, or task_id with index. Public image URLs should point directly to JPG, PNG, or WebP files and should be accessible by APIXO. Prompts can be written in English or Chinese. More specific camera motion, scene timing, subject action, lighting, and style details usually produce better results. Rate limits and concurrency can vary by account, API key, and route. If you receive 429, slow down requests and retry with backoff. For account-level details, see System APIs.

Errors and troubleshooting

HTTP errors

Validation notes

Task failure codes

failCode identifies the task failure. Common values include: See Error Codes for the full error reference.

MCP integration

The complete model schema declares result decoding in mcp.result and supported file bindings in mcp.attachments. These are client integration metadata, not generation input parameters. Attachment paths: image_urls. Preserve the user’s file order. Model parameter validation remains on the API.