Grok Imagine video API: text-to-video and image-to-video
Connect to Grok Imagine Video and Grok Imagine Video 1.5 with a BetterToken API Key and choose fields, media and generation methods by Model ID and operation.
Generate 16:9 video with audio from text, or generate video from a first-frame image. grok-imagine-video-1.5 supports text-to-video and image-to-video at up to 1080p. grok-imagine-video supports text-to-video at up to 720p.
Prepare your BetterToken API Key. The Base URL is https://bettertoken.ai/v1, with Authorization: Bearer YOUR_API_KEY for authentication. Copy the Model ID exactly, including capitalization.
Every request.json below follows the same workflow: quote, confirm creation, poll and download. A quote does not start generation; creating a task submits a paid request. See current costs in the model plaza.
Models and operations
The table below lists available values by operation. See each subsection for field defaults, media counts and combination constraints. Media sizes use 1 MB = 1048576 bytes.
| Model ID | Operation | Duration (seconds) | Output level | Aspect ratio | Audio | Media roles |
|---|---|---|---|---|---|---|
grok-imagine-video | text_to_video | 1–15, step 1 | 480p, 720p | 16:9 | on | None |
grok-imagine-video-1.5 | image_to_video | 1–15, step 1 | 480p, 720p, 1080p | omit | on | first_frame |
grok-imagine-video-1.5 | text_to_video | 1–15, step 1 | 480p, 720p, 1080p | 16:9 | on | None |
Both models generate videos with audio, which is fixed to on. Omit output.aspect_ratio for image-to-video. The output aspect ratio follows the first-frame image.
Sample media
The image-to-video example uses a blue ceramic mug on a white table. Keep the sample image to try the example, or first replace it with a public HTTPS image that you have the right to use and that meets this page’s limits. The sample image is square, so the image-to-video example also produces a square video.

Text-to-video
grok-imagine-video
Use this operation when you have only a text description and a resolution of up to 720p is enough.
Set model to this subsection’s Model ID and operation to text_to_video. Use only the generation fields listed below.
| Field | Type | Required | Allowed values or range | Default |
|---|---|---|---|---|
audio.mode | string | No | on | on |
duration.mode | string | No | fixed | fixed |
duration.seconds | integer | No | 1–15, step 1 s; only for fixed duration | 8 |
output.aspect_ratio | string | No | 16:9 | 16:9 |
output.format | string | No | mp4 | mp4 |
output.resolution | string | No | 480p, 720p | 480p |
prompt | string | Yes | string | None |
watermark | boolean | No | false | false |
Media requirements
This operation does not accept media.
Combination constraints
duration.mode="fixed"requiresduration.seconds. Include the number of seconds whenever you explicitly setfixed.
Request example
Save the JSON below as request.json, then follow the shared workflow to quote first and create after confirmation.
{ "model": "grok-imagine-video", "operation": "text_to_video", "prompt": "A blue ceramic mug on a white table. Slowly move the camera closer in soft daylight.", "duration": { "mode": "fixed", "seconds": 5 }, "output": { "resolution": "720p", "aspect_ratio": "16:9" }}Common 422 errors
| 422 error code | Action |
|---|---|
enum / range / step | Adjust values and increments to match this subsection’s field table. |
unsupported_field | Remove fields absent from this operation’s field table. |
requires | Add seconds as required by this subsection’s combination constraints. |
grok-imagine-video-1.5
Use this operation when you have only a text description and need 1080p.
Set model to this subsection’s Model ID and operation to text_to_video. Use only the generation fields listed below.
| Field | Type | Required | Allowed values or range | Default |
|---|---|---|---|---|
audio.mode | string | No | on | on |
duration.mode | string | No | fixed | fixed |
duration.seconds | integer | No | 1–15, step 1 s; only for fixed duration | 8 |
output.aspect_ratio | string | No | 16:9 | 16:9 |
output.format | string | No | mp4 | mp4 |
output.resolution | string | No | 480p, 720p, 1080p | 480p |
prompt | string | Yes | string | None |
watermark | boolean | No | false | false |
Media requirements
This operation does not accept media.
Combination constraints
duration.mode="fixed"requiresduration.seconds. Include the number of seconds whenever you explicitly setfixed.
Request example
Save the JSON below as request.json, then follow the shared workflow to quote first and create after confirmation.
{ "model": "grok-imagine-video-1.5", "operation": "text_to_video", "prompt": "A blue ceramic mug on a white table. Slowly move the camera closer in soft daylight.", "duration": { "mode": "fixed", "seconds": 5 }, "output": { "resolution": "1080p", "aspect_ratio": "16:9" }}Common 422 errors
| 422 error code | Action |
|---|---|
enum / range / step | Adjust values and increments to match this subsection’s field table. |
unsupported_field | Remove fields absent from this operation’s field table. |
requires | Add seconds as required by this subsection’s combination constraints. |
Image-to-video
grok-imagine-video-1.5
Use this operation to set the opening frame with a single image.
Set model to this subsection’s Model ID and operation to image_to_video. Use only the generation fields listed below. Put the first-frame image in the media array.
| Field | Type | Required | Allowed values or range | Default |
|---|---|---|---|---|
audio.mode | string | No | on | on |
duration.mode | string | No | fixed | fixed |
duration.seconds | integer | No | 1–15, step 1 s; only for fixed duration | 8 |
output.format | string | No | mp4 | mp4 |
output.resolution | string | No | 480p, 720p, 1080p | 480p |
prompt | string | Yes | string | None |
watermark | boolean | No | false | false |
Media requirements
| Media role | Type and count | Formats | Per-file limits |
|---|---|---|---|
first_frame | image, 1 (required) | jpg, jpeg, png, webp | size at most 20 MB; width 1–16384 px; height 1–16384 px |
Combination constraints
duration.mode="fixed"requiresduration.seconds. Include the number of seconds whenever you explicitly setfixed.- Provide exactly one
first_frameimage. Omitoutput.aspect_ratiobecause the output aspect ratio follows the first-frame image.
Image-to-video is billed for the first-frame image in addition to the video duration. Check the amount in the quote before you create the task.
Request example
Save the JSON below as request.json, then follow the shared workflow to quote first and create after confirmation.
{ "model": "grok-imagine-video-1.5", "operation": "image_to_video", "prompt": "Slowly move the camera closer to the blue ceramic mug. Preserve its shape and the white table.", "duration": { "mode": "fixed", "seconds": 5 }, "output": { "resolution": "720p" }, "media": [ { "id": "first", "type": "image", "role": "first_frame", "source": "https://docs.bettertoken.ai/images/nano-banana-guide/sample-07.png" } ]}Common 422 errors
| 422 error code | Action |
|---|---|
enum / range / step | Adjust values and increments to match this subsection’s field table. |
unsupported_field | Remove fields absent from this operation’s field table, such as output.aspect_ratio. |
requires | Add seconds or a first-frame image as required by this subsection’s combination constraints. |
count / media_role | Send only one first_frame image as shown in this subsection’s media table. |
video_input_unsupported | Check the public HTTPS URL, Content-Type and file format, then quote again. |
Official resources
When calling BetterToken, use this page’s fields and the corresponding operation in the live model catalog.

