Skip to main content
POST
For users in mainland China, use https://toapis.cn instead of https://toapis.com in these examples.
Use grok-video-1.5 with one of the three input modes below. Modes are available only when enabled on a compatible channel. A successful price quote does not guarantee that a generation channel is available.
Use public http:// or https:// image URLs. For local files, use the Upload Image API first. Do not send base64 data. JSON with uploaded URLs works across the supported channels; some channels reject multipart binary uploads.

Generation modes

For new requests, set video_generation_mode explicitly. Without it, legacy single-image input remains image-to-video; one reference_images entry alone does not select reference mode. Text mode rejects images.

Authorization

string
required
Authenticate with your API key as a Bearer token.

Body

string
default:"grok-video-1.5"
required
Use the public model name grok-video-1.5; do not substitute a supplier model name.
string
Describe the scene and motion. Required for text and reference modes. Some legacy single-frame requests may omit it; other first-frame requests may still require it. Include a non-empty prompt in new integrations.
string
Optional for legacy clients. Choose the value matching the input: text_to_video for text only, first_frame_image_to_video for exactly one first frame via image or input_reference, reference_images_to_video for 1-7 reference_images. A mode that does not match the media fields is rejected. Explicit reference mode is required to distinguish one reference image from a legacy single-frame input.
string
One first-frame URL. Required in first-frame mode, unless input_reference is used instead. Omit in text and pure reference mode. The upstream handling of a first frame depends on the channel.
string
String alias for the first-frame URL. Use image or input_reference, not conflicting values in both. For portable new requests using this alias, also set the mode explicitly.
array
1-7 reference URLs, as strings or objects such as {"url":"https://example.com/reference.jpg"}. Required in reference mode. Legacy image_urls and images aliases remain supported, but avoid sending multiple list fields with different contents.
integer
Integer seconds. Set it explicitly. Supports 1-15 seconds.
string
Use 480p or 720p for reference mode. Text and first-frame modes may use 1080p when supported by the channel. These examples explicitly request 720p.
string
Video aspect ratio, for example 16:9. Common values are 1:1, 16:9, 9:16, 3:2 and 2:3; availability depends on the channel.

Compatibility limits

Some channels handle single-frame and single-reference input in the same way. The mode name does not guarantee a strict first frame there. Enabling a mode does not remove protocol limits. Unsupported input can be rejected before submission; requests with no compatible enabled channel cannot generate a task.

Pricing

Video pricing follows the current account and SKU configuration. Check current pricing and the authenticated quote for your parameters. No fixed per-second price is guaranteed by this page.

Create a video task

The examples explicitly specify the mode, duration and resolution. Replace example image URLs with accessible images.

Reference images

Response

string
Task ID used for polling.
string
Object type: generation.task.
string
Public model name.
string
Task state: queued, in_progress, completed or failed.

Query task status

Use the returned id with Video Task Status.