Grok Imagine Image to Video
Endpoint
POST /videos/generations
Full URL: https://modelfold.ai/v1/videos/generations
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Send model parameters directly in the JSON body. Do not wrap them in input. This request waits for generation to finish and returns data[].url; supported media models also offer async jobs, polling and callbacks. Replace example media URLs with your own publicly accessible files. See API gateway for billing and errors.
Input parameters for the video generation task
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model name to use for generation. Required field. - Must be grok-imagine/image-to-video for this endpoint Default:"grok-imagine/image-to-video"。 Allowed values:grok-imagine/image-to-video。 Example:grok-imagine/image-to-video。 |
image_urls | array<string> | No | Provide an external image URL as a reference for video generation. Up to 7 images are supported. Do not use it simultaneously with task_id. In your prompt, reference an uploaded image by typing @image(n) followed by a space (for example: @image1 a sunset over the ocean). - Supports JPEG, PNG, and WEBP formats - Maximum file size for each image: 10MB - The Spicy mode is not available when using external images - The array can contain a maximum of seven URLs - Only one is supported when the resolution is 1080p. maxItems: 7. |
task_id | string | No | Task ID from a previously generated Grok image. Use with index to select a specific image. Do not use with image_urls. - Use task ID from grok-imagine/text-to-image generations - Supports all modes including Spicy - Maximum length: 100 characters maxLength: 100. Example:task_grok_12345678。 |
index | integer | No | When using task_id, the 0-based index of the image to use. A grok-imagine/text-to-image task returns 2 images, so valid values are 0 and 1. Default 0. - Ignored if image_urls is provided Default: 0。 minimum: 0. maximum: 1. Example:0。 |
prompt | string | Yes | Prompt required by the ModelFold gateway; at most 2000 characters. Text prompt describing the desired video motion. Optional field. - Should be detailed and specific about the desired visual motion - Describe movement, action sequences, camera work, and timing - Include details about subjects, environments, and motion dynamics - Maximum length: 5000 characters - Supports English language prompts maxLength: 2000. Example:POV hand comes into frame handing the girl a cup of take away coffee, the girl steps out of the screen looking tired, then takes it and she says happily: "thanks! Back to work" she exits the frame and walks right to a different part of the office.。 |
mode | string | No | Specifies the generation mode affecting the style and intensity of motion. Note: Spicy mode is not available for external image inputs. - fun: More creative and playful interpretation - normal: Balanced approach with good motion quality - spicy: More dynamic and intense motion effects (not available for external images) Default: normal Default: "normal"。 Allowed values:fun / normal / spicy。 Example:normal。 |
duration | string | No | The duration of the generated video (in seconds) (6-30). (Minimum: 6, Maximum: 30, Step: 1) ModelFold minimum: 6 seconds; -1 is not supported. |
resolution | string | No | The resolution of the generated video. Default:"480p"。 Allowed values:480p / 720p / 1080p。 Example:480p。 |
aspect_ratio | string | No | Image ratio selection only applies to multi-image generation mode. In single-image mode, the video width and height are referenced to the image width and height. Default:"16:9"。 Allowed values:2:3 / 3:2 / 1:1 / 16:9 / 9:16。 Example:16:9。 |
nsfw_checker | boolean | No | Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model. |
Request Example
bash
curl -X POST "https://modelfold.ai/v1/videos/generations" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine/image-to-video",
"index": 0,
"prompt": "POV hand comes into frame handing the girl a cup of take away coffee, the girl steps out of the screen looking tired, then takes it and she says happily: \"thanks! Back to work\" she exits the frame and walks right to a different part of the office.",
"mode": "normal",
"resolution": "480p",
"aspect_ratio": "16:9"
}'json
{
"model": "grok-imagine/image-to-video",
"index": 0,
"prompt": "POV hand comes into frame handing the girl a cup of take away coffee, the girl steps out of the screen looking tired, then takes it and she says happily: \"thanks! Back to work\" she exits the frame and walks right to a different part of the office.",
"mode": "normal",
"resolution": "480p",
"aspect_ratio": "16:9"
}Response
200 — Generation completed. usage contains actual billing details; result URLs are illustrative.
json
{
"ok": true,
"created": 1792134000,
"data": [
{
"url": "https://modelfold.ai/uploads/outputs/result.mp4"
}
],
"usage": {}
}